Message transmission method and device and electronic equipment
By fragmenting and FEC encoding the messages, and combining this with a link quality adjustment retransmission strategy, the problem of low service quality in single-link wide area networks is solved, and efficient data transmission under different link conditions is achieved.
Patent Information
- Application Number
- CN202411311264.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2026-03-20
AI Technical Summary
In single-link wide area network transmission, existing technologies cannot effectively manage link quality, resulting in low service quality.
The message to be sent is fragmented to generate multiple target message segments. The retransmission interval and number of times are determined based on the link quality. Forward error correction (FEC) coding and retransmission are used to improve data transmission quality.
By adjusting the retransmission interval and number of times, packet loss rate can be reduced, service quality can be improved, different link qualities can be adapted, and the effect of business traffic transmission can be enhanced.
Smart Images

Figure CN121711064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technology, and in particular to a message transmission method, apparatus and electronic device. Background Technology
[0002] A Wide Area Network (WAN) is a computer network with a wide coverage area, typically spanning different geographical locations. It connects networks in different cities, countries, and even globally. WANs use various transmission media, such as fiber optics, satellite, cable, and wireless connections, to enable long-distance communication. For example, branch offices of a company often use WANs for network connectivity. As enterprises, data centers, and other organizations grow larger and more geographically distributed, the traffic transmitted between regions via WANs is also increasing. However, WANs inevitably suffer from low bandwidth, high latency, and packet loss, leading to a decline in the quality of service for application systems that rely on them for transmission.
[0003] In related technologies, when ensuring the quality of service (QoS) of service traffic over a wide area network (WAN) in a point-to-point manner, multiple links are typically used for multiple-transmission-selection. Multiple-transmission-selection can be achieved through multiple paths between the sender and receiver. The sender transmits the same signal to the receiver almost simultaneously via different paths. After multiple senders transmit signals, the receiver selects one signal to receive based on factors such as signal frequency, power, and interference, thus ensuring the QoS of the service traffic.
[0004] However, in scenarios where multiple links cannot be set up due to cost control reasons, it is usually impossible to manage the quality of link transmission. In other words, even when transmitting data through a single link in a point-to-point manner, the service quality remains low. Summary of the Invention
[0005] This application provides a message transmission method, apparatus, and electronic device to improve the quality of service for business traffic when performing point-to-point data transmission over a wide area network in a single-link scenario.
[0006] In a first aspect, embodiments of this application provide a message transmission method, applied to a sender in a single-link scenario, comprising:
[0007] The message to be sent is fragmented to obtain multiple target message segments corresponding to the message to be sent; the retransmission interval and retransmission number of the multiple target message segments are determined according to the link quality between the sending end and the receiving end; the multiple target message segments are retransmitted according to the retransmission interval and the retransmission number.
[0008] In one possible implementation, the step of fragmenting the message to be sent to obtain multiple target message segments corresponding to the message to be sent includes: dividing the message to be sent into multiple message segments; adding labels to the message segments according to their respective positions in the message to be sent; and performing forward error correction (FEC) encoding on each of the multiple message segments to be sent to obtain the target message segments corresponding to each of the multiple message segments to be sent.
[0009] In one possible implementation, performing forward error correction (FEC) coding on the plurality of message segments to be sent to obtain the target message segment corresponding to each of the plurality of message segments to be sent includes: determining the redundancy code corresponding to any one of the message segments to be sent; and adding corresponding redundancy information to any one of the message segments to be sent according to the redundancy code to obtain the target message segment corresponding to any one of the message segments to be sent.
[0010] In one possible implementation, the link quality includes jitter and packet loss rate; determining the retransmission interval and retransmission count of the plurality of target message segments based on the link quality between the sender and receiver includes: determining the retransmission interval of the plurality of target message segments based on the jitter value of the link between the sender and receiver; the jitter value is negatively correlated with the retransmission interval; determining the retransmission count of the plurality of target message segments based on the packet loss rate of the link between the sender and receiver; the packet loss rate is positively correlated with the retransmission count.
[0011] In one possible implementation, the plurality of target message segments are contained in a sending queue; the step of repeatedly sending the plurality of target message segments according to the repeated sending interval and the repeated sending count includes: repeatedly performing the following sending operation, and when the number of times any of the target message segments in the sending queue has been sent reaches the repeated sending count, performing a dequeue operation on any target message segment: sequentially sending all the target message segments included in the sending queue in ascending order of the labels; wherein, the time interval between the execution times of every two sending operations is the repeated sending interval.
[0012] In one possible implementation, before initially sending any of the target message segments, the method further includes: obtaining the current link quality of the link; and updating the retransmission interval and retransmission count of any of the target message segments based on the current link quality.
[0013] In one possible implementation, before sequentially sending all the target message segments included in the sending queue in ascending order of the labels, the method further includes: determining the message sending order of the target message segments according to the priority of the messages to be sent to which the target message segments belong; the step of sequentially sending all the target message segments included in the sending queue in ascending order of the labels includes: based on the message sending order, sequentially sending multiple target message segments included in the sending queue in ascending order of the labels.
[0014] In one possible implementation, before performing fragmentation processing on the message to be sent, the method further includes: obtaining candidate messages; and determining the candidate message as a message to be sent when the message type of the candidate message is not a set type and the length of the candidate message is greater than or equal to a preset length.
[0015] Secondly, embodiments of this application provide a message transmission method applied to a receiving end in a single-link scenario, comprising: receiving multiple target message segments; and reassembling the multiple target message segments based on their respective positions in their respective to-be-sent messages to obtain a target message.
[0016] In one possible implementation, receiving multiple target message segments includes: for any one of the received target message segments, if the receiving end does not store a prior message segment with the same label as any one of the target message segments, receiving any one of the target message segments.
[0017] In one possible implementation, the reassembly of the multiple target message segments based on their respective positions in their respective to-be-sent messages to obtain a target message includes: arranging the multiple target message segments belonging to the same to-be-sent message in ascending order of their labels; and reassembling the multiple target message segments into the target message when the labels are consecutive and the segment is located at the end of its respective to-be-sent message.
[0018] In one possible implementation, after obtaining the target message, the method further includes: verifying the target message; and after the verification passes, determining that the transmission of the message to be sent corresponding to the target message is complete.
[0019] In one possible implementation, the verification of the target message includes: obtaining the verification interval time carried in the target message; and performing FEC decoding verification on the target message when the time interval between the current time and the time when the target message was obtained reaches the verification interval time.
[0020] Thirdly, embodiments of this application provide a message transmission apparatus applied to a sending end in a single-link scenario, comprising: a message processing unit, configured to perform fragmentation processing on a message to be sent to obtain multiple target message segments corresponding to the message to be sent; and determine the retransmission interval and retransmission number of the multiple target message segments according to the link quality of the link between the sending end and the receiving end; and a communication unit, configured to retransmit the multiple target message segments according to the retransmission interval and the retransmission number.
[0021] In one possible implementation, when the message processing unit performs fragmentation processing on the message to be sent to obtain multiple target message segments corresponding to the message to be sent, it specifically performs the following steps: dividing the message to be sent into multiple message segments; adding labels to the message segments to be sent according to their respective positions in the message to be sent; and performing forward error correction (FEC) encoding processing on each of the multiple message segments to be sent to obtain the target message segments corresponding to each of the multiple message segments to be sent.
[0022] In one possible implementation, when the message processing unit performs forward error correction (FEC) coding on the plurality of message segments to be sent to obtain the target message segments corresponding to each of the plurality of message segments to be sent, it is specifically used to: determine the redundancy code corresponding to any one of the message segments to be sent; and add corresponding redundancy information to any one of the message segments to be sent according to the redundancy code to obtain the target message segment corresponding to any one of the message segments to be sent.
[0023] In one possible implementation, the link quality includes jitter value and packet loss rate; when the message processing unit determines the retransmission interval and retransmission number of the plurality of target message segments based on the link quality between the sending end and the receiving end, it is specifically configured to: determine the retransmission interval of the plurality of target message segments based on the jitter value of the link between the sending end and the receiving end; the jitter value is negatively correlated with the retransmission interval; and determine the retransmission number of the plurality of target message segments based on the packet loss rate of the link between the sending end and the receiving end; the packet loss rate is positively correlated with the retransmission number.
[0024] In one possible implementation, the plurality of target message segments are contained in a transmission queue; the communication unit repeatedly transmits the plurality of target message segments according to the retransmission interval and the retransmission count, specifically by: repeatedly performing the following transmission operation, and when the transmission count of any target message segment in the transmission queue reaches the retransmission count, performing a dequeue operation on any target message segment: sequentially transmitting all target message segments included in the transmission queue in ascending order of the labels; wherein, the interval between the execution time of every two transmission operations is the retransmission interval.
[0025] In one possible implementation, before the communication unit first sends any of the target message segments, the communication unit is further configured to obtain the current link quality; the message processing unit is further configured to update the retransmission interval and retransmission number of any of the target message segments according to the current link quality.
[0026] In one possible implementation, before the communication unit sequentially sends all the target message segments included in the sending queue in ascending order of the labels, the message processing unit is further configured to determine the message sending order of the target message segments according to the priority of the messages to be sent to which the target message segments belong; when the communication unit sequentially sends all the target message segments included in the sending queue in ascending order of the labels, it is specifically configured to: based on the message sending order, sequentially send multiple target message segments included in the sending queue in ascending order of the labels.
[0027] In one possible implementation, before the message processing unit performs fragmentation processing on the message to be sent, it is further configured to: obtain candidate messages; and determine the candidate message as a message to be sent when the message type of the candidate message is not a set type and the length of the candidate message is greater than or equal to a preset length.
[0028] Fourthly, embodiments of this application provide a message transmission apparatus, including: a communication unit for receiving multiple target message segments; and a message processing unit for reassembling the multiple target message segments based on their respective positions in their respective to-be-sent messages to obtain a target message.
[0029] In one possible implementation, when the communication unit receives multiple target message segments, it is specifically configured to: for any one of the received target message segments, if the receiving end does not store a prior message segment with the same label as any one of the target message segments, receive any one of the target message segments.
[0030] In one possible implementation, when the message processing unit reassembles the multiple target message segments based on their respective positions in their respective messages to be sent to obtain a target message, it specifically performs the following steps: arranging the multiple target message segments belonging to the same message to be sent in ascending order of their labels; and reassembling the multiple target message segments into the target message when the labels are consecutive and the segment is located at the end of its respective message to be sent.
[0031] In one possible implementation, after obtaining the target message, the message processing unit is further configured to: verify the target message; and after the verification is passed, determine that the transmission of the message to be sent corresponding to the target message is completed.
[0032] In one possible implementation, when the message processing unit verifies the target message, it is specifically configured to: obtain the verification interval time carried in the target message; and when the time interval between the current time and the time when the target message is obtained reaches the verification interval time, perform FEC decoding verification on the target message.
[0033] Fifthly, embodiments of this application provide an electronic device, including:
[0034] Memory, used to store computer instructions;
[0035] A processor, connected to the memory, is configured to execute computer instructions in the memory, and, in executing the computer instructions, implement the method as described in any one of the first or second aspects.
[0036] Sixthly, embodiments of this application provide a computer-readable storage medium, comprising:
[0037] The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of the first or second aspects.
[0038] The beneficial effects of this application are as follows:
[0039] This application provides a message transmission method, apparatus, and electronic device. The method includes: performing fragmentation processing on a message to be transmitted to obtain multiple target message segments corresponding to the message to be transmitted; determining the retransmission interval and retransmission number of the multiple target message segments based on the link quality of the link between the sending end and the receiving end; and retransmitting the multiple target message segments according to the retransmission interval and the retransmission number.
[0040] In this embodiment, since the retransmission interval and number of retransmissions of the target packet segment can be determined based on the link quality, the packet loss rate can be reduced by adjusting the retransmission interval and number of retransmissions when the link quality is poor, and the link bandwidth can be saved by adjusting the retransmission interval and number of retransmissions when the link quality is good. This allows for improved service quality of traffic transmitted on the link under different link quality conditions. Furthermore, since each target packet segment can be retransmitted according to the retransmission interval and number of retransmissions, the probability of packet loss at the receiving end can be significantly reduced, thereby further improving the service quality of traffic.
[0041] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application.
[0043] Figure 1 This is a schematic diagram illustrating an application scenario of the message transmission method provided in the embodiments of this application;
[0044] Figure 2 One of the exemplary flowcharts of a message transmission method provided in an embodiment of this application;
[0045] Figure 3 One of the exemplary flowcharts of a message transmission method provided in an embodiment of this application;
[0046] Figure 4 This is a schematic diagram of a message transmission method provided in an embodiment of this application;
[0047] Figure 5 A schematic diagram of a message transmission device provided in an embodiment of this application;
[0048] Figure 6 A schematic diagram of a message transmission device provided in an embodiment of this application;
[0049] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] To facilitate understanding of the technical solutions provided in the embodiments of this application, the following describes the technical terms involved in the embodiments of this application.
[0051] (1) Quality of Service: In network communication, quality of service refers to the performance of network transmission in terms of reliability, bandwidth, latency and jitter.
[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0053] The terms "first" and "second" in the embodiments of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more; the embodiments of this application do not impose any limitations.
[0054] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0055] See Figure 1 This diagram illustrates an application scenario of the message transmission method provided in this embodiment. The scenario may include a sender 110 and a receiver 120, which are interconnected via a wide area network (WAN). Both the sender 110 and receiver 120 can access the WAN through their respective gateway devices. A link 130 exists between the gateway devices of the sender 110 and the receiver 120, enabling data transmission between them. In this scenario, the sender 110 may refer to the network of Company A's headquarters, and the receiver 120 may refer to the network of a branch of Company A.
[0056] Specifically, when the sending end 110 and the receiving end 120 transmit messages, the sending end 110 can perform fragmentation on the message to be sent to obtain multiple target message segments corresponding to the message to be sent. Then, based on the link quality of link 130, the retransmission interval and retransmission number of the multiple target message segments are determined, and the multiple target message segments are retransmitted according to the determined retransmission interval and retransmission number.
[0057] When receiving multiple target message fragments sent by sending end 110, receiving end 120 can reassemble the multiple target message fragments according to their respective positions in the message to be sent, and obtain the target message when reassembled into a complete message.
[0058] It should be noted that a wide area network (WAN) can be various types of networks. For example, Internet Protocol (IP) / Multi-Protocol Label Switching (MPLS) networks, and fifth-generation broadband cellular network technology (5G) networks, etc. Figure 1 The application scenario shown is only an example. For the same sending end, there may be multiple receiving ends. This application does not limit this.
[0059] See Figure 2 This is one of the exemplary flowcharts of a message transmission method provided in an embodiment of this application. This process can be applied to... Figure 1 The transmitting end 110 shown may include the following processes S201-S203.
[0060] S201, the message to be sent is fragmented to obtain multiple target message fragments corresponding to the message to be sent.
[0061] Here, the message to be sent can refer to the messages included in the sending queue. The sending queue is a queue used by the sender to buffer messages to be sent. The sending queue can include one or more messages to be sent, and each message to be sent can be processed through... Figure 2 The process shown is used for message transmission.
[0062] In one possible implementation, before fragmenting the message to be sent, the sending end can first obtain candidate messages. If the message type of the candidate message is not a set type and the length of the candidate message is greater than or equal to a preset length, the candidate message is determined as a message to be sent and added to the sending queue. The candidate message can be any message that needs to be sent to the receiving end. The message type and length of the candidate message can be determined based on the values of relevant fields in the message header of the candidate message.
[0063] Conversely, if the candidate message's message type is a specified type, or if the candidate message's length is less than a preset length, then the candidate message is added to the acceleration queue and directly sent to the receiving end; that is, no acceleration is performed. Figure 2 The message transmission method shown.
[0064] For example, the configuration type may include control messages and private protocol messages, with a preset length of 53 bytes. It should be noted that both the configuration type and the preset length can be set based on experience or actual circumstances, and this application does not impose any limitations on them.
[0065] In one possible implementation, the sending end can be configured to enable the message transmission method provided in this embodiment for message transmission. In this case, after obtaining a candidate message, it can be determined whether the candidate message can be added to the sending queue based on the destination address field in the message header, that is, whether the candidate message is a message to be sent. For example, if the link between sending end A and receiving end B enables the message transmission method provided in this embodiment for message transmission, and the link between sending end A and receiving end C does not enable the message transmission method provided in this embodiment for message transmission, then if the candidate message is sent to B, it can be added to the sending queue; if the candidate message is sent to C, it cannot be added to the sending queue.
[0066] In one possible implementation, S201 can be performed as follows: dividing the message to be sent into multiple message segments. Then, according to the position of each message segment in the message to be sent, adding a label to each message segment. Then, performing forward error correction (FEC) encoding on each message segment to obtain the target message segment carrying the label for each message segment.
[0067] When performing FEC encoding on multiple message segments to be sent, the following operations can be performed on any message segment to be sent: determine the redundancy code corresponding to any message segment to be sent, and then add corresponding redundancy information to the message segment to be sent based on the redundancy code to obtain the target message segment corresponding to the message segment to be sent.
[0068] Specifically, the sending end can fill any message fragment to be sent into a set matrix and calculate the redundancy code. Then, the redundancy code is also filled into the set matrix for encapsulation, and an FEC message header is added to obtain the target message fragment corresponding to the message fragment to be sent.
[0069] It should be noted that the algorithm for redundancy coding can be selected based on experience or actual conditions, such as Hamming codes, convolutional codes, Reed-Solomon codes, etc., and this application does not limit it.
[0070] Based on the above scheme, since the target message segment is obtained by FEC encoding the message segment to be sent, even if the data received by the receiving end is lost, the data sent by the sending end can be restored as much as possible. Therefore, the packet loss rate can be further reduced and the service quality of the business flow can be improved.
[0071] S202, based on the link quality between the sender and receiver, determine the retransmission interval and retransmission number of multiple target message segments.
[0072] In some embodiments, link quality can be represented by parameters such as jitter, packet loss rate, latency, and bandwidth. Packet loss rate refers to the proportion of data packets lost during network transmission. A high packet loss rate leads to incomplete data transmission, affecting the quality of service of the traffic transmitted in the link. Latency refers to the time required for data to travel from the sender to the receiver; higher latency indicates lower link quality. Jitter refers to the fluctuation in latency, i.e., the amount of delay variation between different data packets on the same link. Excessive jitter can cause inconsistent data packet transmission times, affecting link stability. Bandwidth represents the link's ability to transmit data per unit of time; higher bandwidth allows for the transmission of more data, resulting in higher link quality.
[0073] In one possible implementation, when determining the retransmission interval and retransmission count of multiple target message segments based on the link quality between the sender and receiver, the retransmission interval can be determined based on the link jitter value, where the jitter value can be negatively correlated with the retransmission interval. The retransmission count of multiple target message segments can be determined based on the link packet loss rate, where the packet loss rate can be positively correlated with the retransmission count.
[0074] In some embodiments, when determining the retransmission interval of multiple target packet segments based on the jitter value of the link, it can be determined according to the mapping relationship between the jitter value and the retransmission interval, which can be pre-configured at the transmitting end. For example, a jitter value between 150ms and 30ms can be non-linearly mapped to a retransmission interval between 1ms and 10ms, and this mapping satisfies the condition that the higher the jitter value, the greater the rate of change of the retransmission interval. That is, the higher the jitter value, the shorter the retransmission interval, and the lower the jitter value, the longer the retransmission interval.
[0075] In some embodiments, when determining the number of retransmissions of multiple target packet segments based on the link's packet loss rate, it can also be determined based on a mapping relationship between the packet loss rate and the number of retransmissions. This mapping relationship can be pre-configured at the sending end. Specifically, the packet loss rate can be pre-divided into multiple ranges, and each range can correspond to a value for the number of retransmissions, thereby obtaining the mapping relationship between the packet loss rate and the number of retransmissions. For example, the packet loss rate can be divided into 1%–4%, 4%–20%, 20%–45%, and greater than 45%. When the packet loss rate is between 1% and 4%, the number of retransmissions can be determined to be 2; when the packet loss rate is between 4% and 20%, the number of retransmissions can be determined to be 3; when the packet loss rate is between 20% and 45%, the number of retransmissions can be determined to be 4. To avoid consuming too much bandwidth on the link, when the packet loss rate is greater than 45%, it can be determined that the current link cannot meet the transmission requirements, and the processing flow ends. Thus, when the packet loss rate is high, the number of retransmissions increases, and when the packet loss rate is low, the number of retransmissions decreases.
[0076] It should be noted that the methods for setting the above-mentioned mapping relationship between jitter value and retransmission interval, and the mapping relationship between packet loss rate and number of retransmissions, are exemplary and are not limited in this application.
[0077] In some embodiments, the retransmission interval and retransmission count for each target message segment included in the transmission queue can also be determined based on latency and bandwidth. Higher latency allows for a longer retransmission interval and more retransmissions. Higher bandwidth allows for a shorter retransmission interval and fewer retransmissions.
[0078] It should be noted that the mapping relationship between delay and retransmission interval and retransmission number, as well as between bandwidth and retransmission interval and retransmission number, can be set according to actual conditions or experience, and this application does not limit it.
[0079] In one possible implementation, before each target message segment is initially sent, the current link quality can be obtained, and the retransmission interval and retransmission number of each target message segment can be determined based on the current link quality.
[0080] For example, suppose that for a target packet segment labeled 0, based on the current link quality, the retransmission interval might be determined to be 8ms and the number of retransmissions to be 2. However, when sending a target packet segment labeled 155, the retransmission interval might become 5ms and the number of retransmissions might become 3, based on the current link quality.
[0081] In another possible implementation, when the sending queue includes multiple messages to be sent, the destination addresses of these messages may be different, meaning that the receiving ends corresponding to each message may be different, and therefore the links between the sender and receiver may also be different. Therefore, the retransmission interval and retransmission count of the target message segment can be determined based on the link quality corresponding to the message to be sent; that is, the retransmission interval and retransmission count of target message segments belonging to different messages to be sent may be different.
[0082] For example, the sending queue includes message A and message B to be sent. The two messages correspond to different receivers: receiver aa for message A and receiver bb for message B. Assuming that the retransmission interval is determined to be 10ms and the retransmission count is 2 based on the link quality between the sender and receiver aa, then the retransmission interval for all target message segments belonging to message A is 10ms, and the retransmission count is 2. Similarly, assuming that the retransmission interval is determined to be 2ms and the retransmission count is 4 based on the link quality between the sender and receiver bb, then the retransmission interval for all target message segments belonging to message B is 2ms, and the retransmission count is 4.
[0083] S203, Repeatedly transmit multiple target message segments according to the repeated transmission interval and the number of repeated transmissions.
[0084] In one possible implementation, since multiple target message segments are contained in the sending queue, the sending end can repeatedly perform the following sending operation when sending each target message segment. When the number of times any target message segment in the sending queue has been sent reaches the repeated sending count, a dequeue operation is performed on that target message segment: all target message segments included in the sending queue are sent sequentially in ascending order of their labels. The interval between each two sending operations is called the repeated sending interval.
[0085] Specifically, the interval between two transmission operations is called the retransmission interval. This can refer to the interval between two transmission operations when repeatedly transmitting the same target message segment.
[0086] In some embodiments, target message segments belonging to the same message to be sent can be sent sequentially according to their labels, from smallest to largest. For example, if the sending queue includes multiple target message segments belonging to the same message to be sent, and the labels of these multiple target message segments range from 0 to 9, then the target message segment with label 0 can be sent first, followed by the target message segment with label 1, then the target message segment with label 2, and so on, until the target message segment with label 9 is sent, thus completing one sending operation.
[0087] In other embodiments, for target message segments belonging to different messages to be sent, the message sending order of the target message segments can be determined according to the priority of the messages to be sent. Then, based on the message sending order, the multiple target message segments contained in the sending queue are sent sequentially in ascending order of their labels. For example, assuming that the priority of message A to be sent is higher than the priority of message B to be sent, the target message segments belonging to message A to be sent are first sent sequentially in ascending order of their labels, and then the target message segments belonging to message B to be sent are sent sequentially in ascending order of their labels.
[0088] In one possible implementation, when repeatedly sending multiple target message segments according to the number of retransmissions, each target message segment can be copied separately based on the number of retransmissions, and one or more copies can be added to the sending queue. In this case, both the target message segments and their copies in the sending queue can be dequeued after transmission.
[0089] For example, assuming the target segment of message A to be sent corresponds to a retransmission count of 2, then each target segment of message A to be sent is copied once and added to the sending queue. Assuming the target segment of message B to be sent corresponds to a retransmission count of 4, then each target segment of message B to be sent is copied three times and added to the sending queue.
[0090] By employing the above method, since the retransmission interval and number of retransmissions for target packet segments can be determined based on link quality, the packet loss rate can be reduced by increasing the retransmission interval and number of retransmissions when link quality is poor, and the link bandwidth can be saved by reducing the retransmission interval and number of retransmissions when link quality is good. This allows for improved service quality of traffic transmitted on the link under different link quality conditions. Furthermore, since each target packet segment can be retransmitted according to the retransmission interval and number of retransmissions, the probability of packet loss at the receiving end can be significantly reduced, further improving the service quality of traffic.
[0091] See Figure 3 This is one of the exemplary flowcharts of a message transmission method provided in an embodiment of this application. This process can be applied to... Figure 1 The receiver 120 shown may include the following processes S301-S302.
[0092] S301 receives multiple target message fragments.
[0093] In one possible implementation, S301 can be specifically executed as follows: For any received target message segment, if the receiving end does not store a prior message segment with the same identifier as any target message segment, the receiving end receives the target message segment and adds it to the receive queue. Conversely, if the receiving end stores a prior message segment with the same identifier as any target message segment, the target message segment is discarded. Here, the prior message segment and the target message segment belong to the same type of message to be sent.
[0094] For example, suppose the currently arriving segment at the receiver is target segment number 5 belonging to message A to be sent. If the receiver has not yet received target segment number 5 belonging to message A to be sent, that is, if the receiver does not have a prior segment numbered 5 stored, then target segment number 5 is added to the receive queue. If the receiver has already received target segment number 5 belonging to message A to be sent, then target segment number 5 can be discarded.
[0095] Based on the above scheme, the receiving end can selectively receive the sent message segments according to the target message segment's label, which can avoid the receiving end caching too much redundant information.
[0096] S302, based on the position of each target message segment in its respective message to be sent, reassemble the multiple target message segments to obtain the target message.
[0097] Based on the position of each of the multiple target message fragments in the receiving queue within their respective messages to be sent, the multiple target message fragments are reassembled, and when reassembled into a complete message, the target message is obtained.
[0098] In one possible implementation, when reassembling a message to be sent, multiple target message fragments belonging to the same message to be sent in the receiving queue can be arranged in ascending order of their labels. Then, when the labels are consecutive and contain a target message fragment located at the end of its respective message to be sent, the multiple target message fragments can be reassembled into a target message.
[0099] When determining whether a target message fragment located at the end of its assigned message can be included, the value of the second flag in the Flags field of the message header, More Fragment (MF), can be used. The value of MF indicates whether the message is the last fragment; 0 indicates that the message is the last fragment, and 1 indicates that there are more fragments to follow.
[0100] In one possible implementation, after obtaining the target message, the target message can be verified, and if the verification passes, the transmission of the message to be sent corresponding to the target message is completed.
[0101] In one possible implementation, if the target message segment sent by the sending end is obtained by FEC encoding the message segment to be sent, the receiving end can perform FEC decoding and verification on the target message after receiving it.
[0102] In some embodiments, FEC decoding verification of the target packet may not be performed in real time; that is, FEC decoding verification is not performed on the target packet immediately after it is obtained. Specifically, when performing FEC decoding verification on a target packet, the verification interval time carried in the target packet can be obtained first, and FEC decoding verification is performed on the target packet when the time interval between the current time and the time when the target packet was obtained reaches the verification interval time.
[0103] The verification interval can be determined based on the link quality between the sender and receiver, and can be the same as the retransmission interval of the target message corresponding to the message to be sent. In this case, the verification interval can be added to the target message segment after determining the retransmission interval for each target message segment.
[0104] Optionally, the verification interval may also be different from the retransmission interval of the message to be sent corresponding to the target message. The verification interval can be set according to the actual situation or experience, and this application does not limit it.
[0105] In some embodiments, in addition to FEC decoding verification, the receiving end can also verify the target message using a checksum, that is, detect whether errors have occurred in the data during transmission by calculating the checksum of the message content. Furthermore, verification algorithms such as cyclic redundancy check can also be used to verify the target message; this application does not limit this approach.
[0106] In one possible implementation, if the target packet fails the verification, a retransmission request can be sent to the sender corresponding to the target packet, requesting the sender to retransmit the packet and dequeue and destroy the target packet.
[0107] The message transmission method provided in this application not only adds FEC encoding processing, but also allows for the repeated transmission of various target message segments at different time intervals based on link quality. Therefore, when transmitting messages using this method, packet loss rate and jitter can be effectively reduced, thereby improving the service quality of business traffic.
[0108] Specifically, with 100 bidirectional data streams per link on a single link, and each stream having a data transmission rate of 1Mbps, a 10% bidirectional packet loss scrambling effect reduces the packet loss rate to no more than 0.01%, achieving smooth, pixelated playback of both 480p and 1080p videos. Here, 480p and 1080p represent two different video resolution standards, and "p" stands for progressive scan. File transfers can also achieve download speeds no less than 90% of the original download speed. With a 20% bidirectional packet loss scrambling effect, the packet loss rate can be reduced to no more than 0.05%, and file transfers can achieve download speeds no less than 80% of the original download speed.
[0109] In one possible implementation, the message transmission method provided in this application embodiment can also be extended to be applied to multi-link scenarios. In multi-link scenarios, the message transmission method provided in this application embodiment can be executed for each link separately, thereby combining the time-division multiple transmission and reception of this application with the multiple transmission and reception of multiple links or other routing schemes to provide higher quality reliability assurance for service traffic.
[0110] Below, in order to more clearly understand the solution proposed in the embodiments of this application, a message transmission method provided by this application will be introduced in conjunction with specific embodiments.
[0111] See Figure 4 This is a schematic diagram illustrating a message transmission method provided in an embodiment of this application. When sending a message, the sending device adds candidate messages that enable the message transmission method provided in this embodiment to a sending queue, performs sending processing on each message to be sent in the sending queue, and then sends each target message segment after sending processing to the corresponding receiving end through a single link. After receiving and processing each arriving target message segment, the receiving end completes the transmission of the corresponding message to be sent.
[0112] During the transmission process, the sending end can perform FEC encoding on the message to be transmitted to obtain multiple target message fragments, which may include fragmentation and labeling of the message to be transmitted. Then, based on the link quality, the number of retransmissions and the retransmission interval are determined. Based on the number of retransmissions, the target message fragments are multiplied, that is, one or more copies of the target message fragments are added to the transmission queue. Finally, according to the retransmission interval, each target message fragment and its copy in the transmission queue is transmitted.
[0113] During reception processing, the receiving end can selectively determine the target message segments to add to the receive queue based on the labels carried on the target message segments. Then, it organizes the target message segments in the receive queue according to their labels to obtain the target message. This allows the receiving end to consolidate multiple messages to be sent by the sending end into a single message to be sent. Finally, FEC decoding is performed on the target message to verify its data integrity. After successful verification, the transmission of the corresponding message to be sent can be completed.
[0114] It should be understood that the specific implementation process of sending and receiving can be found in [reference needed]. Figure 2 and Figure 3 The relevant descriptions in the method embodiments shown will not be repeated here.
[0115] Based on the same concept as the above method, see [link to relevant documentation]. Figure 5 This application provides a message transmission device 500, which can be applied to a sending end and includes a message processing unit 501 and a communication unit 502. In one scenario:
[0116] The message processing unit 501 is used to perform fragmentation processing on the message to be sent to obtain multiple target message segments corresponding to the message to be sent; and to determine the retransmission interval and retransmission number of the multiple target message segments according to the link quality between the sending end and the receiving end.
[0117] The communication unit 502 is used to repeatedly transmit the plurality of target message segments according to the repeated transmission interval and the repeated transmission number.
[0118] In one possible implementation, when the message processing unit 501 performs fragmentation processing on the message to be sent to obtain multiple target message segments corresponding to the message to be sent, it is specifically used to: divide the message to be sent into multiple message segments; add labels to the message segments to be sent according to their respective positions in the message to be sent; and perform forward error correction (FEC) encoding processing on each of the multiple message segments to be sent to obtain the target message segments corresponding to each of the multiple message segments to be sent.
[0119] In one possible implementation, when the message processing unit 501 performs forward error correction (FEC) coding on the plurality of message segments to be sent to obtain the target message segments corresponding to each of the plurality of message segments to be sent, it is specifically used to: determine the redundancy code corresponding to any one of the message segments to be sent; and add corresponding redundancy information to any one of the message segments to be sent according to the redundancy code to obtain the target message segment corresponding to any one of the message segments to be sent.
[0120] In one possible implementation, the link quality includes jitter value and packet loss rate; when the message processing unit 501 determines the retransmission interval and retransmission number of the plurality of target message segments based on the link quality between the sending end and the receiving end, it is specifically used to: determine the retransmission interval of the plurality of target message segments based on the jitter value of the link between the sending end and the receiving end; the jitter value is negatively correlated with the retransmission interval; and determine the retransmission number of the plurality of target message segments based on the packet loss rate of the link between the sending end and the receiving end; the packet loss rate is positively correlated with the retransmission number.
[0121] In one possible implementation, the plurality of target message segments are contained in a transmission queue; the communication unit 502 repeatedly transmits the plurality of target message segments according to the repeated transmission interval and the repeated transmission count, specifically: repeatedly performing the following transmission operation, and when the transmission count of any target message segment in the transmission queue reaches the repeated transmission count, performing a dequeue operation on any target message segment: sequentially transmitting all target message segments included in the transmission queue in ascending order of the labels; wherein, the interval between the execution time of each two transmission operations is the repeated transmission interval.
[0122] In one possible implementation, before the communication unit 502 initially sends any of the target message segments, the communication unit 502 is further configured to obtain the current link quality of the link; the message processing unit 501 is further configured to update the retransmission interval and retransmission number of any of the target message segments according to the current link quality.
[0123] In one possible implementation, before the communication unit 502 sequentially sends all the target message segments included in the sending queue in ascending order of the labels, the message processing unit 501 is further configured to determine the message sending order of the target message segments according to the priority of the messages to be sent to which the target message segments belong; when the communication unit 502 sequentially sends all the target message segments included in the sending queue in ascending order of the labels, it is specifically configured to: based on the message sending order, sequentially send multiple target message segments included in the sending queue in ascending order of the labels.
[0124] In one possible implementation, before performing fragmentation processing on the message to be sent, the message processing unit 501 is further configured to: obtain candidate messages; and determine the candidate message as a message to be sent when the message type of the candidate message is not a set type and the length of the candidate message is greater than or equal to a preset length.
[0125] Based on the same concept as the above method, see [link to relevant documentation]. Figure 6 This application provides a message transmission device 600, which can be applied to a receiving end and includes a communication unit 601 and a message processing unit 602. In one scenario:
[0126] Communication unit 601 is used to receive multiple target message segments;
[0127] The message processing unit 602 is used to reassemble the multiple target message segments based on their respective positions in the message to be sent, to obtain a target message.
[0128] In one possible implementation, when the communication unit 601 receives multiple target message segments, it is specifically used to: for any one of the received target message segments, if the receiving end does not store a prior message segment with the same label as any one of the target message segments, receive any one of the target message segments.
[0129] In one possible implementation, when the message processing unit 602 reassembles the multiple target message segments based on their respective positions in their respective messages to be sent to obtain a target message, it specifically performs the following steps: arranging the multiple target message segments belonging to the same message to be sent in ascending order of their labels; and reassembling the multiple target message segments into the target message when the labels are consecutive and the segment is located at the end of its respective message to be sent.
[0130] In one possible implementation, after obtaining the target message, the message processing unit 602 is further configured to: verify the target message; and after the verification is passed, determine that the transmission of the message to be sent corresponding to the target message is completed.
[0131] In one possible implementation, when the message processing unit 602 verifies the target message, it is specifically used to: obtain the verification interval time carried in the target message; and when the time interval between the current time and the time when the target message is obtained reaches the verification interval time, perform FEC decoding verification on the target message.
[0132] Based on the same concept as the above method, see [link to relevant documentation]. Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes at least one processor 702 and a memory 701 connected or coupled to the at least one processor 702. In addition, the electronic device may also include a communication interface 703. The electronic device can interact with other devices through the communication interface 703.
[0133] For example, the communication interface 703 can be a transceiver, circuit, bus, module, pin, or other type of communication interface. When the electronic device is a chip-based device or circuit, the communication interface 703 in the electronic device can also be an input / output circuit, capable of inputting information (or receiving information) and outputting information (or sending information). The processor can be an integrated processor, a microprocessor, an integrated circuit, or a logic circuit, and the processor can determine the output information based on the input information.
[0134] The coupling in this application embodiment is an indirect coupling or communication connection between devices, units, or modules, which can be electrical, mechanical, or other forms, used for information exchange between devices, units, or modules. The processor 702 may operate in conjunction with the memory 701 and the communication interface 703. This application does not limit the specific connection medium between the processor 702, the memory 701, and the communication interface 703.
[0135] Optional, see Figure 7 The processor 702, the memory 701, and the communication interface 703 are interconnected via a bus. This bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0136] In this embodiment, memory 701, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 701 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 701 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. Memory 701 in this embodiment may also be a circuit or any other device capable of implementing storage functions for storing instructions, computer programs, and / or data.
[0137] In the embodiments of this application, the processor 702 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the message transmission method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0138] By designing and programming the processor 702, the code corresponding to the message transmission method described in the foregoing embodiments can be embedded into the chip, so that the chip can execute the steps of the aforementioned message transmission method when running. How to design and program the processor 702 is a well-known technique to those skilled in the art, and will not be described in detail here.
[0139] In one or more embodiments, memory 701 stores instructions that can be executed by at least one processor 702, which can implement the steps of any of the above methods by calling the instructions stored in memory 701 or a computer program.
[0140] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the steps of any of the above methods.
[0141] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the message transmission methods discussed above. Since the principle by which the above-described computer program product solves the problem is similar to that of the message transmission method, the implementation of the above-described computer program product can be referred to the implementation of the method, and repeated details will not be described again.
[0142] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0143] While specific embodiments of this application have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this application is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this application, and all such changes and modifications fall within the scope of protection of this application. Although preferred embodiments of this application have been described, those skilled in the art, once they understand the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0144] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A message transmission method, characterized in that, include: The message to be sent is fragmented to obtain multiple target message fragments corresponding to the message to be sent. The retransmission interval and retransmission number of the multiple target message segments are determined based on the link quality between the sender and receiver. The plurality of target message segments are sent according to the specified retransmission interval and the specified number of retransmissions.
2. The method according to claim 1, characterized in that, The fragmentation process of the message to be sent yields multiple target message fragments corresponding to the message to be sent, including: The message to be sent is divided into multiple message segments to be sent; According to the position of the plurality of message segments to be sent in the message to be sent, add a label to the message segments to be sent; Forward error correction (FEC) encoding is performed on the multiple message segments to be sent to obtain multiple target message segments corresponding to the multiple message segments to be sent.
3. The method according to claim 2, characterized in that, The forward error correction (FEC) encoding process is performed on the plurality of message segments to be sent to obtain a plurality of target message segments corresponding to the plurality of message segments to be sent, including: For any one of the plurality of message segments to be sent, determine the redundancy code corresponding to any one of the message segments to be sent; Based on the redundancy coding, corresponding redundancy information is added to any of the message segments to be sent to obtain the target message segment corresponding to any of the message segments to be sent.
4. The method according to claim 1, characterized in that, The link quality includes jitter and packet loss rate; determining the retransmission interval and retransmission number of the multiple target message segments based on the link quality between the sender and receiver includes: The retransmission interval of the plurality of target message segments is determined based on the jitter value of the link between the sending end and the receiving end. The number of times the multiple target message segments are repeatedly sent is determined based on the packet loss rate of the link between the sending end and the receiving end.
5. The method according to claim 2, characterized in that, The plurality of target message segments are contained in a sending queue; the step of repeatedly sending the plurality of target message segments according to the repeated sending interval and the repeated sending number includes: According to the order of the labels from smallest to largest, the multiple target message fragments included in the sending queue are sent according to the retransmission interval and the number of retransmissions; For any target message segment among the plurality of target message segments, when the actual number of times any target message segment is sent reaches the number of repeated transmissions, a dequeue operation is performed on any target message segment.
6. The method according to claim 5, characterized in that, For any one of the plurality of target message segments, before initially sending any one of the target message segments, the method further includes: Get the current link quality; Based on the current link quality, update the retransmission interval and retransmission count of any of the target packet segments.
7. The method according to any one of claims 1-6, characterized in that, Before performing fragmentation processing on the message to be sent, the method further includes: Obtain candidate messages; If the message type of the candidate message is not a set type and the length of the candidate message is greater than or equal to the preset length, the candidate message is determined to be a message to be sent.
8. A message transmission method, characterized in that, include: Receive multiple target message fragments; Based on the positions of the multiple target message segments in the corresponding message to be sent, the multiple target message segments are reassembled to obtain the target message.
9. The method according to claim 8, characterized in that, The receiving of multiple target message fragments includes: Receive any of the target message segments, wherein each of the target message segments carries a label, the label being used to indicate the position of the target message segment in the message to be sent; If the receiving end does not store a prior message segment with the same label as any of the target message segments, then store any of the target message segments.
10. The method according to claim 9, characterized in that, The reassembly of the multiple target message segments based on their positions in the corresponding message to be sent, to obtain the target message, includes: Arrange the multiple target message fragments in ascending order of their labels; If the numbered segments are consecutive and the plurality of target message segments include a target message segment located at the end of the message to be sent, the plurality of target message segments are reassembled into the target message.
11. The method according to any one of claims 8-10, characterized in that, After obtaining the target message, the method further includes: Verify the target message; After the verification is successful, the transmission of the message to be sent corresponding to the target message is confirmed to be complete.
12. The method according to claim 11, characterized in that, The verification of the target message includes: Obtain the verification interval time carried in the target message; When the time interval between the current time and the time when the target message is obtained reaches the verification interval, the target message is subjected to FEC decoding verification.
13. A message transmission device, characterized in that, include: The message processing unit is used to perform fragmentation processing on the message to be sent to obtain multiple target message fragments corresponding to the message to be sent. The retransmission interval and retransmission number of the multiple target message segments are determined based on the link quality between the sender and receiver. The communication unit is configured to repeatedly transmit the plurality of target message segments according to the repeated transmission interval and the repeated transmission number.
14. A message transmission device, characterized in that, include: The communication unit is used to receive multiple target message fragments; The message processing unit is used to reassemble the multiple target message segments based on their respective positions in their respective messages to be sent, to obtain a target message.
15. An electronic device, characterized in that, include: Memory, used to store computer instructions; A processor, connected to the memory, is configured to execute computer instructions in the memory, and, in executing the computer instructions, implement the method as described in any one of claims 1 to 7, or implement the method as described in any one of claims 8 to 12.
16. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 7, or the method as described in any one of claims 8 to 12.