Packet transmission method, apparatus and device
By employing a cyclic offset strategy and a dynamic path adjustment message transmission method, the problem of balancing reliability and efficiency in existing technologies is solved, achieving load balancing and improved bandwidth utilization in critical business scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies cannot balance the reliability and efficiency of data transmission. High-reliability transmission schemes have low bandwidth utilization, while high-efficiency transmission schemes have poor fault tolerance, making it impossible to achieve the best balance in critical business scenarios.
A cyclic offset strategy is adopted to select the transmission path. Message copies with the same sequence number are distributed on multiple consecutive paths, and paths with different sequence numbers are kept as separate as possible. The receiving end performs deduplication and sorting, and dynamically adjusts the number of targets to balance reliability and efficiency.
It achieves spatiotemporal discretization of load in critical business scenarios, effectively avoids the risk of sudden congestion, improves bandwidth utilization and fault tolerance, and finds the best balance between reliability and transmission efficiency.
Smart Images

Figure CN122496461A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a message transmission method, apparatus, and device. Background Technology
[0002] With the rapid development of high-value businesses such as the Industrial Internet, financial transactions, and remote control, communication networks are placing extremely high demands on the reliability and real-time performance of data transmission. In these critical business scenarios, it is not only necessary to ensure zero data packet loss and low latency, but also to maximize bandwidth utilization while maintaining reliability in order to reduce network operating costs.
[0003] In existing technologies, high reliability and high efficiency are generally categorized into two technical approaches. High-reliability transmission employs a full-path redundancy replication approach. (Refer to...) Figure 1 The sending end copies the same data packet multiple times and sends it simultaneously through all available transmission paths. The receiving end uses a deduplication mechanism to retain the first arriving packet and discard subsequent duplicate packets. The advantage of this scheme is its extremely high reliability, capable of tolerating simultaneous failures of multiple paths. However, its disadvantages are also quite obvious: regardless of network conditions, it requires bandwidth resources from all paths, resulting in excessive redundant traffic and extremely low bandwidth utilization.
[0004] High-efficiency transmission employs a static load-sharing technique. (Refer to...) Figure 2 The sending end distributes the data stream across different transmission paths according to rules (such as hash algorithms). The advantage of this approach is high bandwidth utilization, fully utilizing the total bandwidth of all paths. However, its disadvantages include poor fault tolerance, inability to avoid packet loss, and immediate interruption and data packet loss if a path fails. Furthermore, fault recovery is slow, relying on network routing protocol convergence to reallocate traffic.
[0005] In conclusion, existing technologies cannot balance reliability and transmission efficiency, which severely restricts the development of critical services. Summary of the Invention
[0006] This application provides a message transmission method, apparatus, device, and readable storage medium, which can solve the problem that reliability and transmission efficiency cannot be achieved simultaneously in the prior art.
[0007] In a first aspect, embodiments of this application provide a message transmission method, the message transmission method comprising: The sending end identifies the message to be transmitted for the target service flow and adds a sequence number to the message to be transmitted. The sequence number of the message for the same service flow increases continuously. The sending end selects a consecutive number of transmission paths from the transmission paths of the target service flow as target paths based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. It then transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number, the transmission paths of the target service flow are arranged cyclically, and the target paths of messages with adjacent sequence numbers are arranged consecutively.
[0008] Furthermore, in one embodiment, the message transmission method further includes: The receiving end identifies a copy of the message for the target service flow and reads the sequence number from the copy of the message; The receiving end deduplicates message copies with the same sequence number; The receiving end sends the deduplicated message copies to the user side in ascending order of sequence number.
[0009] Furthermore, in one embodiment, the receiving end is provided with multiple forwarding decision units, each forwarding decision unit corresponding to a transmission path; The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each forwarding decision unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit uses the sequence number of the current message copy as the first sequence number, queries the arrival flag of the first sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
[0010] Furthermore, in one embodiment, the receiving end is provided with multiple queue mapping units and forwarding decision units. Each queue mapping unit corresponds to a transmission path, and each forwarding decision unit corresponds to a forwarding decision queue. The number of forwarding decision queues is equal to the target number. The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each queue mapping unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; Each queue mapping unit determines the order of the actual transmission path of the current message copy in the target path based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the current message copy and the index of the actual transmission path, and maps the current message copy to the forwarding decision queue with the same order. The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit obtains a copy of the message from the corresponding forwarding decision queue and reads the sequence number from the copy of the message; Each forwarding decision unit uses the sequence number of the current message copy as the second sequence number, queries the arrival flag of the second sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
[0011] Further, in one embodiment, for the receiving end, the step of sending the deduplicated message copies to the user side in ascending order of sequence number includes: Check if a copy of the message with the third sequence number exists in the waiting area. The waiting area is used to store deduplicated copy of the message. If a copy of the message with the third sequence number exists in the waiting area, the copy of the message with the third sequence number is retrieved from the waiting area and sent to the user side, and the third sequence number is updated to the next sequence number. If there is no copy of the message with the third sequence number in the waiting area and the timeout condition is met, then the third sequence number will be updated to the next sequence number.
[0012] Furthermore, in one embodiment, the timeout determination condition is any of the following conditions: The elapsed time since the last message copy was sent to the user side is greater than the duration threshold; The number of message copies in the waiting area exceeds the quantity threshold; The difference between the largest sequence number and the third sequence number of the message copy in the waiting area is greater than the difference threshold.
[0013] Further, in one embodiment, for the sending end, the step of identifying the target service flow's message to be transmitted and adding a sequence number to the message to be transmitted includes: Extract message features from received messages, identify messages of the target service flow based on message features, use them as messages to be transmitted, and add target flow ID and sequence number to messages to be transmitted. For the receiving end, the step of identifying a copy of the message for the target service flow includes: Extract the flow ID from the received message. If the flow ID is the target flow ID, then determine that the corresponding message is a copy of the target service flow.
[0014] Further, in one embodiment, for the sending end, the step of selecting a consecutive number of transmission paths as target paths from the transmission paths of the target service flow based on the total number of transmission paths of the target service flow, the target number, and the sequence number of the message to be transmitted includes: The index of the target path is calculated using the path calculation formula, which is: {p_j | p_j=[(r+j-1) mod N]+1, j=0→K-1}, r = [(m-1)K mod N] + 1, Where p_j is the index of the (j+1)th target path, r is the index of the 1st target path, mod is the modulo operation, N is the total number of transmission paths, K is the number of targets, and m is the sequence number of the message to be transmitted.
[0015] Secondly, embodiments of this application also provide a message transmission device, the message transmission device comprising: The first identification module, located at the sending end, is used to identify the message to be transmitted in the target service flow and add a sequence number to the message to be transmitted. The sequence number of the message in the same service flow increases continuously. The redundant transmission module, located at the sending end, is used to select a consecutive number of transmission paths from the transmission paths of the target service flow as target paths based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. It then transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number, the transmission paths of the target service flow are arranged cyclically, and the target paths of messages with adjacent sequence numbers are arranged consecutively.
[0016] Thirdly, embodiments of this application also provide a message transmission device, the message transmission device including a processor, a memory, and a message transmission program stored in the memory and executable by the processor, wherein when the message transmission program is executed by the processor, it implements the steps of the above-described message transmission method.
[0017] Fourthly, embodiments of this application also provide a readable storage medium storing a message transmission program, wherein when the message transmission program is executed by a processor, it implements the steps of the above-described message transmission method.
[0018] This application employs a cyclic offset strategy to select target paths for message replica transmission. Multiple message replicas with the same sequence number are distributed across multiple consecutive paths, while message replicas with different sequence numbers use paths that are as non-repetitive as possible, achieving a spatiotemporal discretization of the load. Even if a momentary failure occurs on some paths, it only affects the transmission of some replicas of some messages, preventing the entire service flow from being interrupted. This effectively avoids the risk of sudden congestion. In the long run, all message replicas are evenly distributed across all transmission paths, fully utilizing the bandwidth of all transmission paths. The number of target replicas can be dynamically adjusted according to actual conditions. When network quality is good, the number of target replicas can be reduced to improve bandwidth utilization; when network quality is poor, the number of target replicas can be increased to improve fault tolerance. This application enables the finding of the optimal balance between reliability and transmission efficiency based on business needs, laying the foundation for the development of critical services. Attached Figure Description
[0019] Figure 1 Data flow diagram for full-path redundant replication; Figure 2 Data flow diagram for static load sharing; Figure 3 This is a flowchart illustrating a message transmission method in one embodiment of this application; Figure 4 This is a data flow diagram of a message transmission method in one embodiment of this application; Figure 5 This is a data flow diagram of queue mapping operations in one embodiment of this application; Figure 6 This is a schematic diagram of the functional modules of a message transmission device in one embodiment of this application; Figure 7 This is a schematic diagram of the hardware structure of the message transmission device involved in the embodiments of this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0022] Firstly, embodiments of this application provide a message transmission method.
[0023] Figure 3 A flowchart illustrating a message transmission method according to an embodiment of this application is shown.
[0024] Reference Figure 3 In one embodiment, the message transmission method includes the following steps: S1. The sending end identifies the message to be transmitted for the target service flow and adds a sequence number to the message to be transmitted. The sequence number of the message for the same service flow increases continuously.
[0025] Specifically, the sending end extracts and matches message features to identify whether each message belongs to the target service flow, and then transmits it using the message transmission method of this embodiment, denoted as the message to be transmitted. The sequence number is a number used to identify the order in which messages are sent; the sequence number of each message is globally unique within the same service flow.
[0026] Optionally, the packet features used to identify service flows can be PORT+VLAN, 5-tuple, APNID, etc.
[0027] S2. The sending end selects a consecutive number of transmission paths from the transmission paths of the target service flow as target paths based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. The sending end transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number. The transmission paths of the target service flow are arranged in a circular manner, and the target paths of the messages to be transmitted with adjacent sequence numbers are arranged consecutively.
[0028] Specifically, the target service flow is bound to multiple transmission paths for transmitting its message copies. These transmission paths are arranged cyclically. For example, if the N paths are numbered 1 to N, the order is 1, 2, ..., N, 1, 2..., and so on. The target quantity refers to the number of message copies that each message to be transmitted needs to be replicated, i.e., redundancy.
[0029] Figure 4 A data flow diagram of a message transmission method in one embodiment of this application is shown.
[0030] Reference Figure 4 The total number of transmission paths is configured as 3, and the number of targets is configured as 2. In the diagram, from top to bottom, the paths are 1, 2, and 3. For message 1, paths 1 and 2 are selected as the target paths; for message 2, paths 3 and 1 are selected as the target paths; for message 3, paths 2 and 3 are selected as the target paths, and so on.
[0031] In this embodiment, a cyclic offset strategy is used to select target paths for packet replica transmission. Multiple packet replicas with the same sequence number are distributed across multiple consecutive paths, while the paths used by packet replicas with different sequence numbers are minimized to achieve spatiotemporal discretization of the load. Even if a momentary failure occurs on some paths, it only affects the transmission of some replicas of some packets, preventing the entire service flow from being interrupted. This effectively avoids the risk of sudden congestion. In the long run, all packet replicas are evenly distributed across all transmission paths, fully utilizing the bandwidth of all transmission paths. The number of target replicas can be dynamically adjusted according to actual conditions. When network quality is good, the number of target replicas can be reduced to improve bandwidth utilization; when network quality is poor, the number of target replicas can be increased to improve fault tolerance. Through this embodiment, the optimal balance between reliability and transmission efficiency can be found according to service requirements, laying the foundation for the development of critical services.
[0032] Furthermore, in one embodiment, the message transmission method further includes: The receiving end identifies a copy of the message for the target service flow and reads the sequence number from the copy of the message; The receiving end deduplicates message copies with the same sequence number; The receiving end sends the deduplicated message copies to the user side in ascending order of sequence number.
[0033] It should be noted that in the technical approach of full-path redundancy replication, the receiving end also needs to perform deduplication and sorting operations. The receiving end processing method in this embodiment can refer to the implementation method in related technologies, or other implementation methods can be adopted.
[0034] Furthermore, in one embodiment, the receiving end is provided with multiple forwarding decision units, each forwarding decision unit corresponding to a transmission path; The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each forwarding decision unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit uses the sequence number of the current message copy as the first sequence number, queries the arrival flag of the first sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
[0035] In this embodiment, multiple forwarding decision units (the number of which is equal to the total number of transmission paths) are used to perform message copy identification and deduplication operations, thereby improving processing efficiency.
[0036] It should be noted that the message identification operations of multiple forwarding decision units do not affect each other. However, during the deduplication operation, read and write operations are required on the forwarding decision table. One target service flow is bound to one forwarding decision table. When multiple forwarding decision units perform read and write operations on the same forwarding decision table, a mutex lock mechanism is required to ensure the reliability of the arrival mark.
[0037] Figure 5 A data flow diagram of queue mapping operations in one embodiment of this application is shown.
[0038] Furthermore, in one embodiment, the receiving end is provided with multiple queue mapping units and forwarding decision units. Each queue mapping unit corresponds to a transmission path, and each forwarding decision unit corresponds to a forwarding decision queue. The number of forwarding decision queues is equal to the target number. The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each queue mapping unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; Each queue mapping unit determines the order of the actual transmission path of the current message copy in the target path based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the current message copy and the index of the actual transmission path, and maps the current message copy to the forwarding decision queue with the same order. The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit obtains a copy of the message from the corresponding forwarding decision queue and reads the sequence number from the copy of the message; Each forwarding decision unit uses the sequence number of the current message copy as the second sequence number, queries the arrival flag of the second sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
[0039] In this embodiment, multiple queue mapping units (the number of which is equal to the total number of transmission paths) are used to perform message copy identification and queue mapping operations. The queue mapping operation uses the same path calculation method as the sender to reverse-derive the order of the actual transmission path of the message copy in the target path, thereby mapping the message copy to a forwarding decision queue with the same order. Then, multiple forwarding decision units (the number of which is equal to the total number of targets) are used to perform message copy deduplication operations.
[0040] Compared to the previous embodiment, this embodiment reduces the number of forwarding decision units, thereby reducing hardware resource consumption and avoiding unnecessary mutex lock operations, further improving processing efficiency.
[0041] For example, refer to Figure 5 , Figure 5 Basic configuration and Figure 4 Similarly, based on this, three queue mapping units are used to perform message replica identification and queue mapping operations, and two forwarding decision units are used to perform message replica deduplication operations. In the diagram, solid arrows represent first-arriving message replicas, and dashed arrows represent later-arriving message replicas. Later-arriving message replicas are discarded, indicated by an "×" drawn on the corresponding sequence number in the diagram.
[0042] For example, for the sending end, the step of selecting a consecutive number of transmission paths as target paths from the transmission paths of the target service flow based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the message to be transmitted, includes: The index of the target path is calculated using the path calculation formula, which is: {p_j | p_j=[(r+j-1) mod N]+1, j=0→K-1}, r = [(m-1)K mod N] + 1, Where p_j is the index of the (j+1)th target path, r is the index of the 1st target path, mod is the modulo operation, N is the total number of transmission paths, K is the number of targets, and m is the sequence number of the message to be transmitted.
[0043] Accordingly, in this embodiment, for the queue mapping unit, the step of determining the order of the actual transmission path of the current message replica in the target path based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the current message replica and the index of the actual transmission path, includes: The order of the actual transmission path in the target path is calculated based on the queue calculation formula, which is: q = [offset mod K] + 1, offset = (p - r' + N) mod N, r'=[(m'-1)K mod N]+1, Where q is the order of the actual transmission path in the target path, K is the number of targets, offset is the offset of the actual transmission path relative to the first target path, p is the index of the actual transmission path, r' is the index of the first target path, N is the total number of transmission paths, and m' is the sequence number of the message copy.
[0044] Further, in one embodiment, for the receiving end, the step of sending the deduplicated message copies to the user side in ascending order of sequence number includes: Check if a copy of the message with the third sequence number exists in the waiting area. The waiting area is used to store deduplicated copy of the message. If a copy of the message with the third sequence number exists in the waiting area, the copy of the message with the third sequence number is retrieved from the waiting area and sent to the user side, and the third sequence number is updated to the next sequence number. If there is no copy of the message with the third sequence number in the waiting area and the timeout condition is met, then the third sequence number will be updated to the next sequence number.
[0045] In this embodiment, considering that the receiving order of message copies may not be the same as the sending order, and there may be packet loss, a third sequence number is used to represent the message sequence number that is currently to be sent. Message copies with a higher sequence number in the waiting area are blocked, while message copies with a sequence number equal to the third sequence number in the waiting area are sent. The third sequence number is incremented when a message copy is successfully sent and when the timeout condition is met. The former is used to ensure the sequential sending of message copies, and the latter is used to limit the waiting time to avoid deadlock.
[0046] Furthermore, in one embodiment, the timeout determination condition is any of the following conditions: The elapsed time since the last message copy was sent to the user side is greater than the duration threshold; The number of message copies in the waiting area exceeds the quantity threshold; The difference between the largest sequence number and the third sequence number of the message copy in the waiting area is greater than the difference threshold.
[0047] In this embodiment, three timeout conditions are provided. The first condition directly limits the waiting time; the second condition indirectly limits the waiting time by limiting the cache capacity; and the third condition indirectly limits the waiting time by limiting the sequence number span. Each condition constitutes a timeout condition on its own, or multiple conditions can be combined using logical AND, OR, or OR operations to form a timeout condition.
[0048] Further, in one embodiment, for the sending end, the step of identifying the target service flow's message to be transmitted and adding a sequence number to the message to be transmitted includes: Extract message features from received messages, identify messages of the target service flow based on message features, use them as messages to be transmitted, and add target flow ID and sequence number to messages to be transmitted. For the receiving end, the step of identifying a copy of the message for the target service flow includes: Extract the flow ID from the received message. If the flow ID is the target flow ID, then determine that the corresponding message is a copy of the target service flow.
[0049] In this embodiment, after the sending end identifies the service flow using message features, it adds the corresponding flow ID to the message to be transmitted, so that the receiving end can quickly determine the service flow using the flow ID, thereby improving the processing efficiency of the receiving end and simplifying the processing logic of the receiving end.
[0050] Secondly, embodiments of this application also provide a message transmission device.
[0051] Figure 6 A schematic diagram of the functional modules of a message transmission device in one embodiment of this application is shown.
[0052] Reference Figure 6 In one embodiment, the message transmission device includes: The first identification module 10 is set at the sending end and is used to identify the message to be transmitted of the target service flow and add a sequence number to the message to be transmitted, wherein the sequence number of the message of the same service flow is continuously increased. The redundant transmission module 20, located at the sending end, is used to select a consecutive number of transmission paths as target paths from the transmission paths of the target service flow based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. It then transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number, the transmission paths of the target service flow are arranged cyclically, and the target paths of messages with adjacent sequence numbers are arranged consecutively.
[0053] Furthermore, in one embodiment, the message transmission device further includes: The second identification module, located at the receiving end, is used to identify the message copy of the target service flow and read the sequence number from the message copy; The redundancy deduplication module is located at the receiving end and is used to deduplicat message copies with the same sequence number. The out-of-order processing module, located at the receiving end, is used to send deduplicated message copies to the user side in ascending order of sequence number.
[0054] Furthermore, in one embodiment, the receiving end is provided with multiple forwarding decision units, each forwarding decision unit corresponding to a transmission path; The second identification module is located in the forwarding decision unit and is used for: Identify the message copy of the target service flow from the corresponding transmission path, and read the sequence number from the message copy; The redundancy deduplication module is located in the forwarding decision unit and is used for: The sequence number of the current message copy is used as the first sequence number. The arrival flag of the first sequence number is queried in the forwarding decision table. If the arrival flag is not arrived, the arrival flag is changed to arrived and the current message copy is stored in the waiting area. If the arrival flag is arrived, the current message copy is discarded. The default value of the arrival flag is not arrived.
[0055] Furthermore, in one embodiment, the receiving end is provided with multiple queue mapping units and forwarding decision units. Each queue mapping unit corresponds to a transmission path, and each forwarding decision unit corresponds to a forwarding decision queue. The number of forwarding decision queues is equal to the target number. The second identification module is located in the queue mapping unit and is used for: Identify the message copy of the target service flow from the corresponding transmission path, and read the sequence number from the message copy; The message transmission device also includes a queue mapping module, which is located in the queue mapping unit and is used for: Based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the current message copy and the index of the actual transmission path, determine the order of the actual transmission path of the current message copy in the target path, and map the current message copy to the forwarding decision queue with the same order. The redundancy deduplication module is located in the forwarding decision unit and is used for: Obtain a copy of the message from the corresponding forwarding decision queue, and read the sequence number from the copy of the message; Use the sequence number of the current message copy as the second sequence number, look up the arrival flag of the second sequence number in the forwarding decision table. If the arrival flag is not arrived, change the arrival flag to arrived and store the current message copy in the waiting area. If the arrival flag is arrived, discard the current message copy. The default value of the arrival flag is not arrived.
[0056] Furthermore, in one embodiment, the out-of-order processing module is used for: Check if a copy of the message with the third sequence number exists in the waiting area. The waiting area is used to store deduplicated copy of the message. If a copy of the message with the third sequence number exists in the waiting area, the copy of the message with the third sequence number is retrieved from the waiting area and sent to the user side, and the third sequence number is updated to the next sequence number. If there is no copy of the message with the third sequence number in the waiting area and the timeout condition is met, then the third sequence number will be updated to the next sequence number.
[0057] Furthermore, in one embodiment, the timeout determination condition is any of the following conditions: The elapsed time since the last message copy was sent to the user side is greater than the duration threshold; The number of message copies in the waiting area exceeds the quantity threshold; The difference between the largest sequence number and the third sequence number of the message copy in the waiting area is greater than the difference threshold.
[0058] Furthermore, in one embodiment, the first identification module 10 is used for: Extract message features from received messages, identify messages of the target service flow based on message features, use them as messages to be transmitted, and add target flow ID and sequence number to messages to be transmitted. The second identification module is used for: Extract the flow ID from the received message. If the flow ID is the target flow ID, then determine that the corresponding message is a copy of the target service flow.
[0059] Furthermore, in one embodiment, the redundant transmission module 20 is used for: The index of the target path is calculated using the path calculation formula, which is: {p_j | p_j=[(r+j-1) mod N]+1, j=0→K-1}, r = [(m-1)K mod N] + 1, Where p_j is the index of the (j+1)th target path, r is the index of the 1st target path, mod is the modulo operation, N is the total number of transmission paths, K is the number of targets, and m is the sequence number of the message to be transmitted.
[0060] The functions of each module in the above-mentioned message transmission device correspond to the steps in the above-mentioned message transmission method embodiment, and their functions and implementation processes will not be described in detail here.
[0061] Thirdly, embodiments of this application provide a message transmission device, which may be a user terminal device (e.g., a personal computer, a laptop, or a server) or a network access transmission device (e.g., a router, a switch, an SPN, or an IPRAN) or other device with data processing capabilities.
[0062] Figure 7 A schematic diagram of the hardware structure of the message transmission device involved in the embodiment of this application is shown.
[0063] Reference Figure 7 In this embodiment of the application, the message transmission device may include a processor, a memory, a communication interface, and a communication bus.
[0064] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0065] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting devices within the message transmission equipment, as well as interfaces used for interconnecting the message transmission equipment with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, FLEXE interfaces, etc.; user equipment can be personal computers, CPEs, etc.
[0066] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0067] The processor can be a general-purpose processor, which can call a message transmission program stored in memory and execute the message transmission method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), etc. The method executed when the message transmission program is called can be referred to in the various embodiments of the message transmission method of this application, and will not be repeated here.
[0068] Those skilled in the art will understand that Figure 7 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0069] Fourthly, embodiments of this application also provide a readable storage medium.
[0070] The present application has a message transmission program stored on a readable storage medium, wherein when the message transmission program is executed by a processor, it implements the steps of the message transmission method as described above.
[0071] The method implemented when the message transmission program is executed can be referred to in various embodiments of the message transmission method of this application, and will not be repeated here.
[0072] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0073] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus 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 such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0074] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0075] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0076] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0077] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0078] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A message transmission method, characterized in that, The message transmission method includes: The sending end identifies the message to be transmitted for the target service flow and adds a sequence number to the message to be transmitted. The sequence number of the message for the same service flow increases continuously. The sending end selects a consecutive number of transmission paths from the transmission paths of the target service flow as target paths based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. It then transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number, the transmission paths of the target service flow are arranged cyclically, and the target paths of messages with adjacent sequence numbers are arranged consecutively.
2. The message transmission method as described in claim 1, characterized in that, The message transmission method further includes: The receiving end identifies a copy of the message for the target service flow and reads the sequence number from the copy of the message; The receiving end deduplicates message copies with the same sequence number; The receiving end sends the deduplicated message copies to the user side in ascending order of sequence number.
3. The message transmission method as described in claim 2, characterized in that, The receiving end is equipped with multiple forwarding decision units, each of which corresponds to a transmission path; The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each forwarding decision unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit uses the sequence number of the current message copy as the first sequence number, queries the arrival flag of the first sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
4. The message transmission method as described in claim 2, characterized in that, The receiving end has multiple queue mapping units and forwarding decision units. Each queue mapping unit corresponds to a transmission path, and each forwarding decision unit corresponds to a forwarding decision queue. The number of forwarding decision queues is equal to the number of targets. The step of the receiving end identifying a copy of the target service flow and reading the sequence number from the copy of the message includes: Each queue mapping unit identifies a copy of the target service flow from the corresponding transmission path and reads the sequence number from the copy of the message; Each queue mapping unit determines the order of the actual transmission path of the current message copy in the target path based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the current message copy and the index of the actual transmission path, and maps the current message copy to the forwarding decision queue with the same order. The steps for the receiving end to deduplicate message copies with the same sequence number include: Each forwarding decision unit obtains a copy of the message from the corresponding forwarding decision queue and reads the sequence number from the copy of the message; Each forwarding decision unit uses the sequence number of the current message copy as the second sequence number, queries the arrival flag of the second sequence number in the forwarding decision table, and if the arrival flag is not arrived, it modifies the arrival flag to arrived and stores the current message copy in the waiting area. If the arrival flag is arrived, it discards the current message copy. The default value of the arrival flag is not arrived.
5. The message transmission method as described in claim 3 or 4, characterized in that, For the receiving end, the step of sending the deduplicated message copies to the user side in ascending order of sequence number includes: Check if a copy of the message with the third sequence number exists in the waiting area. The waiting area is used to store deduplicated copy of the message. If a copy of the message with the third sequence number exists in the waiting area, the copy of the message with the third sequence number is retrieved from the waiting area and sent to the user side, and the third sequence number is updated to the next sequence number. If there is no copy of the message with the third sequence number in the waiting area and the timeout condition is met, then the third sequence number will be updated to the next sequence number.
6. The message transmission method as described in claim 5, characterized in that, The timeout condition can be any of the following: The elapsed time since the last message copy was sent to the user side is greater than the duration threshold; The number of message copies in the waiting area exceeds the quantity threshold; The difference between the largest sequence number and the third sequence number of the message copy in the waiting area is greater than the difference threshold.
7. The message transmission method as described in claim 2, characterized in that, For the sending end, the step of identifying the target service flow's message to be transmitted and adding a sequence number to the message to be transmitted includes: Extract message features from received messages, identify messages of the target service flow based on message features, use them as messages to be transmitted, and add target flow ID and sequence number to messages to be transmitted. For the receiving end, the step of identifying a copy of the message for the target service flow includes: Extract the flow ID from the received message. If the flow ID is the target flow ID, then determine that the corresponding message is a copy of the target service flow.
8. The message transmission method as described in claim 1, characterized in that, For the sending end, the step of selecting a consecutive number of transmission paths as target paths from the transmission paths of the target service flow based on the total number of transmission paths and the target number of the target service flow, as well as the sequence number of the message to be transmitted, includes: The index of the target path is calculated using the path calculation formula, which is: {p_j | p_j=[(r+j-1) mod N]+1, j=0→K-1}, r = [(m-1)K mod N] + 1, Where p_j is the index of the (j+1)th target path, r is the index of the 1st target path, mod is the modulo operation, N is the total number of transmission paths, K is the number of targets, and m is the sequence number of the message to be transmitted.
9. A message transmission device, characterized in that, The message transmission device includes: The first identification module, located at the sending end, is used to identify the message to be transmitted in the target service flow and add a sequence number to the message to be transmitted. The sequence number of the message in the same service flow increases continuously. The redundant transmission module, located at the sending end, is used to select a consecutive number of transmission paths from the transmission paths of the target service flow as target paths based on the total number of transmission paths, the target number, and the sequence number of the message to be transmitted. It then transmits a copy of the message to be transmitted to the receiving end through each target path. The total number of transmission paths is greater than the target number, the transmission paths of the target service flow are arranged cyclically, and the target paths of messages with adjacent sequence numbers are arranged consecutively.
10. A message transmission device, characterized in that, The message transmission device includes a processor, a memory, and a message transmission program stored in the memory and executable by the processor, wherein when the message transmission program is executed by the processor, it implements the steps of the message transmission method as described in any one of claims 1 to 8.