Packet transmission method, apparatus, device, system, chip, and product

WO2026179058A1PCT designated stage Publication Date: 2026-09-03HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/110828
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-02-27
Filing Date
2025-07-28
Publication Date
2026-09-03

Smart Images

  • Figure CN2025110828_03092026_PF_FP_ABST
    Figure CN2025110828_03092026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and provides a packet transmission method, an apparatus, a device, a system, a chip, and a product. The method comprises: a first device receives service packets from a client (S601); on at least two transmission paths, the first device respectively sends to a second device service packets to which identifiers are added (S602), the identifiers being used for indicating the transmission order of the service packets among a plurality of service packets of a same service; the second device receives the service packets respectively sent by the first device on the at least two transmission paths (S603), the service packets comprising the identifiers; and on the basis of the identifiers, the second device sends to the client a service packet transmitted on the first transmission path among the at least two transmission paths (S604).
Need to check novelty before this filing date? Find Prior Art

Description

Message transmission methods, devices, equipment, systems, chips and products

[0001] This application claims priority to Chinese Patent Application No. 202510246248.4, filed with the State Intellectual Property Office of China on February 27, 2025, entitled “Message Transmission Method, Apparatus, Device, System, Chip and Product”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communication technology, and in particular to a message transmission method, apparatus, device, system, chip, and product. Background Technology

[0003] With the explosive growth of internet data and large-scale data interaction between data centers (DCs), higher demands have been placed on data transmission rates, capacities, and distances. Currently, long-distance fiber optic transmission technology, due to its high-speed, high-capacity, and long-distance transmission characteristics, can meet the interconnection needs between data centers and has been widely used in data center-based communication systems.

[0004] In long-distance fiber optic transmission scenarios, service messages are transmitted along a pre-set fixed transmission path, resulting in poor flexibility in message transmission. Summary of the Invention

[0005] This application provides a message transmission method, apparatus, device, system, chip, and product for improving the flexibility of message transmission.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] In a first aspect, a message transmission method is provided. This method can be executed by a first device, or by a component of the first device, such as the processor, chip, or chip system of the first device, or by a logic module or software capable of implementing all or part of the functions of the first device.

[0008] The first device is a network device used to send service messages. The method includes: the first device receiving service messages from a client. The client refers to a device within a data center connected to the first device, such as a switch or server. In this application, the client refers to the initiator of the service message, responsible for starting relevant service operations, thereby triggering the service message sending process. Furthermore, the first device sends the identified service messages to the second device on at least two transmission paths.

[0009] Among these, at least two transmission paths can be two transmission paths, three transmission paths, or more than three transmission paths. In this application, the path lengths of different transmission paths can be different. The identifier is used to indicate the transmission order of a service message among multiple service messages within the same service. For example, the identifier can be a sequence number (SN), such as 0, 1, 2, etc.

[0010] It is worth noting that the service packets transmitted on at least two transmission paths are service packets that include the same identifier. For example, a service packet with the same identifier can be obtained by copying, and then the service packet with the same identifier can be sent to a second device on at least two transmission paths.

[0011] In the above technical solution, the first device adds an identifier to the service message to indicate the transmission order of the service message among multiple service messages of the same service. Service messages with the same identifier are then sent to the second device on at least two transmission paths. By adding an identifier to the service message, the second device can select one of the at least two transmission paths as the working path based on the identifier, thus improving the flexibility of message transmission compared to transmission on a preset fixed transmission path.

[0012] Furthermore, since the identifier of a service message can indicate the transmission order of a service message among multiple service messages in the same service, the subsequent second device can process the service messages transmitted on at least two transmission paths according to the transmission order indicated by the identifier of the service message (such as discarding if the identifier is duplicated or forwarding if the identifier is not duplicated in the case of path switching, and ensuring the continuity of the identifiers of the preceding and following service messages). This can avoid the problem of message out-of-order transmission due to packet loss or duplication, ensure the continuity of service message transmission, and improve the reliability of message transmission.

[0013] In some possible implementations, the first identifier added to the first service message among multiple service messages is an initial value. For example, the initial value can be 0 or other numerical values. The first service message can be the first service message among multiple service messages, i.e., the first service message transmitted. The first identifier is used to identify the first service message, such as a sequence number.

[0014] The second identifier added to the second service message following the first service message is a value obtained by accumulating the initial value by a step size. The second service message can be a service message that is transmitted after the first service message in a sequence of multiple service messages. The second identifier is used to identify the second service message, such as a sequence number. It is understood that the transmission order indicated by the second identifier follows the transmission order indicated by the first identifier, and the first identifier and the second identifier are consecutive.

[0015] The value of the second identifier in multiple second service messages is obtained by summing. For example, the step size can be 1 or other values. Taking an initial value of 0 and a step size of 1 as an example, the second identifier represents the value obtained by summing 1 to 0. For instance, the identifier of the first service message is 0, the identifier of the first second service message after the first service message is 1, the identifier of the second second service message is 2, and so on.

[0016] In this application, the maximum value of the second identifier is equal to 2. N -1. Wherein, 2 N -1 can be represented in binary form. N can be used to indicate the number of bits required for the maximum value of the second identifier.

[0017] In the above implementation, considering the limited number of bits (or bit width) that the second identifier can occupy during transmission or storage, setting a maximum value for the second identifier can more effectively utilize the limited bit width resources. This avoids the problem of the second identifier overflowing due to an excessive number of second service messages to be sent and a value that is too small, thus ensuring the stability of message transmission. Overflow refers to a value exceeding the range that its data type can represent, resulting in an error or anomaly.

[0018] In some possible implementations, N is a positive integer greater than 16. Further, N is 24, 32, 40, or 48.

[0019] In the above implementation, by determining 16, N is set to a positive integer greater than 16, which means that the maximum value of the second identifier requires more than 16 bits, thus covering the bit requirements of the identifier in most message transmission scenarios. Considering that the identifier needs to be carried in the field during actual transmission and that the common unit of the field is a byte, N can be selected from positive integers greater than 16 (i.e., 2 bytes) that correspond to the byte unit, such as 24 (corresponding to 3 bytes), 32 (corresponding to 4 bytes), 40 (corresponding to 5 bytes), or 48 (corresponding to 6 bytes), to ensure compatibility with the common unit of bytes in subsequent applications.

[0020] In some possible implementations, the maximum value of the second identifier is related to the difference in the number of packets transmitted by at least two transmission paths within the same time period. For example, the correlation between the maximum value of the second identifier and the difference in the number of packets transmitted by at least two transmission paths within the same time period can be positive. It is understood that the larger the difference in the number of packets transmitted by at least two transmission paths within the same time period, the larger the maximum value of the second identifier.

[0021] In the above implementation, using the difference in the number of messages to determine the maximum value of the second identifier can more accurately adapt to the identifier requirements of different transmission paths, thereby making more reasonable use of identifier resources and avoiding situations where there are not enough identifiers for one transmission path while identifiers for another transmission path are wasted.

[0022] In some possible implementations, the maximum value of the second identifier is greater than or equal to the difference in the number of messages transmitted by at least two transmission paths within the same time period. It is worth noting that, taking two transmission paths as an example, the difference in the number of messages transmitted by the two transmission paths within the same time period can be the difference in the number of messages transmitted by the two transmission paths within the same time period. Taking multiple transmission paths as an example, the difference in the number of messages transmitted by the multiple transmission paths within the same time period can be the maximum difference in the number of messages transmitted by the multiple transmission paths within the same time period.

[0023] The process of determining the difference in the number of messages transmitted between two transmission paths within the same time period includes:

[0024] Based on the message transmission rate, the delay difference between the two transmission paths, the message length of the service message, the preamble length of the service message, the frame interval length of the service message, and the following formula, the difference in the number of messages transmitted by the two transmission paths in the same time period is determined.

[0025] In the formula, Δw represents the difference in the number of messages transmitted by the two transmission paths within the same time period; v represents the message transmission rate; Δt represents the delay difference between the two transmission paths; l1 represents the message length of the service message; l2 represents the preamble length of the service message; and l3 represents the frame interval length of the service message. It is understood that the units for message length, preamble length, and frame interval length are bytes. Here, 1 byte = 8 bits, and the 8 in the above formula refers to the multiple relationship between bytes and bits.

[0026] Based on the above formula, it can be found that by calculating the product of the message transmission rate and the delay difference between the two transmission paths, the total amount of data (in bits) allowed to be transmitted within the delay difference can be determined. Furthermore, by multiplying the sum of the message length, preamble length, and frame interval length of the service message by 8, the amount of data (in bits) included in the service message can be determined. Finally, by determining the quotient of the total data amount and the amount of data included in the service message, the message quantity difference can be determined.

[0027] In the above embodiments, a method for calculating the message quantity difference is provided, which can quickly and efficiently obtain the message quantity difference.

[0028] In some possible implementations, the process of determining N includes:

[0029] Based on the difference in message counts and the following formula, determine N: N=CEILING(LOG(4*Δw,2),1)

[0030] In the formula, LOG(4*Δw,2) represents the logarithm of 4*Δw with base 2, where 4 is determined based on the size of the sliding window of the second device; CEILING represents rounding up from base 1. The sliding window size is greater than the target size, which is twice the difference in the number of packets transmitted by at least two transmission paths within the same time period.

[0031] Understandably, considering that the sliding window size of the second device must be at least twice the difference in the number of packets to ensure that delayed packets can be buffered while maintaining normal transmission, then based on the packet number difference Δw = 2... N -1, which means the size of the sliding window must be at least greater than 2*Δw=2*(2 N -1), that is, at least 2 should be selected. 2 *(2 N -1) A sliding window of size. Furthermore, based on Δw = 2 2 *(2 N -1)=2 N+2 By reversing the derivation from -4, we can obtain the above formula and thus determine the value of N. Here, 4 is obtained by performing a logarithmic transformation on the difference of four times the number of messages.

[0032] In the above embodiments, a method for determining N is provided, which can quickly and efficiently determine N using the above formula.

[0033] In some possible implementations, the identifier is added to the target field of the business message.

[0034] In the above implementation, by adding an identifier to the target field of the service message, it is made easier for the second device to perform subsequent message processing based on the identifier.

[0035] In some possible implementations, the target field occupies 3, 4, 5, or 6 bytes. It is understood that when the maximum value of the second identifier occupies 24, 32, 40, or 48 bits (N), the corresponding byte values ​​are 3, 4, 5, or 6. Therefore, by setting the target field to 3, 4, 5, or 6 bytes, the maximum value of the second identifier (24, 32, 40, or 48 bits) can be accommodated.

[0036] In some possible implementations, the target field is an original field or a newly added field in the header of the service message, or the target field is an original field or a newly added field in the payload of the service message.

[0037] The above implementation provides multiple types of target fields, improving the flexibility of adding identifiers.

[0038] Secondly, a message transmission method is provided. This method can be executed by a second device, or by a component of the second device, such as the processor, chip, or chip system of the second device, or by a logic module or software that can implement all or part of the functions of the second device.

[0039] The second device is a network device used to receive service packets. The method includes: the second device receiving service packets sent by the first device on at least two transmission paths. Each service packet includes an identifier indicating the transmission order of the service packet within multiple service packets of the same service. Notably, service packets transmitted on at least two transmission paths are those including the same identifier. Furthermore, based on the identifier, the second device sends the service packet transmitted on the first transmission path of the at least two transmission paths to a client. The client refers to a device within a data center connected to the second device, such as a switch or server. In this application, the client refers to the destination of the service packet, responsible for performing specific processing of the relevant service after receiving the service packet.

[0040] In the above technical solution, a first device adds an identifier to the service message to indicate the transmission order of the service message among multiple service messages of the same service. Service messages including the same identifier are sent to a second device on at least two transmission paths. After receiving the service message with the added identifier, the second device can send the service message transmitted on the first transmission path of the at least two transmission paths to the client based on the identifier. By adding an identifier to the service message, the amount of information included in the service message is increased, allowing the second device to select the service message transmitted on the first transmission path from the at least two transmission paths based on the identifier, and then send the service message transmitted on the first transmission path to the client. This allows the second device to select one transmission path as the working path from at least two transmission paths, rather than transmitting on a preset fixed transmission path, thus improving the flexibility of message transmission.

[0041] In some possible implementations, the first transmission path is the transmission path with the shorter delay among at least two transmission paths.

[0042] The delay of at least two transmission paths is determined based on the time when service packets carrying the same identifier are received on at least two transmission paths. For example, by recording the arrival times of service packets with the same identifier along at least two transmission paths, the transmission path that arrives first is determined as the transmission path with the shorter delay.

[0043] In the above embodiments, by selecting the transmission path with the shorter latency among at least two transmission paths, the transmission latency of the message can be effectively shortened, thereby improving the message transmission efficiency. Furthermore, a method for determining the latency of different transmission paths based on identifiers is provided, which can quickly and efficiently determine the latency of different transmission paths.

[0044] In some possible implementations, the method further includes: the second device, in response to an anomaly or switching command in the first transmission path, ceasing to receive service packets transmitted on the first transmission path. The anomaly in the first transmission path can be a fiber optic link failure, discontinuous identification of service packets (such as intermittent interruptions or bit errors), etc. The switching command can be a manually issued switching command, such as in network maintenance or network testing scenarios where switching can be manually controlled.

[0045] Furthermore, the second device receives service packets transmitted on the second transmission path of the at least two transmission paths based on the identifier. The second transmission path is any one of the at least two transmission paths other than the first transmission path. For example, the second transmission path can be any one of the at least two transmission paths other than the first transmission path. Alternatively, the second transmission path can also be a transmission path other than the first transmission path that meets switching requirements, such as bandwidth or latency requirements for switching.

[0046] In the above implementation, when an anomaly occurs in the first transmission path or a switchover command is received, the system switches from the first transmission path to the second transmission path and begins receiving service packets transmitted on the second transmission path. Since the identifier of the service packet can indicate the transmission order of the service packet among multiple service packets of the same service, receiving service packets transmitted on the second transmission path according to the identifier of the service packet can avoid the problem of out-of-order packets due to packet loss or duplication, thus improving the reliability of packet transmission.

[0047] In some possible implementations, the method further includes: a second device performing anomaly detection on the first transmission path. The anomaly detection includes at least one of fiber optic link fault detection and service packet identification continuity detection.

[0048] The above implementation provides two methods for anomaly detection, improving the comprehensiveness and flexibility of anomaly detection.

[0049] In some possible implementations, the method further includes: a second device receiving and buffering service packets transmitted on the first transmission path in response to the first transmission path returning to normal. The first transmission path returning to normal may be characterized by continuous identifiers of the service packets on the first transmission path. It is understood that, at this time, only the service packets transmitted on the first transmission path are buffered and not transmitted, considering that the first transmission path, as a low-latency path, has a faster reception rate, while the second transmission path, as a high-latency path, has a slower reception rate; therefore, it is necessary to buffer and wait for the service packets on the second transmission path.

[0050] The second device responds by concatenating the identifier of the currently received service packet on the second transmission path with the identifier of the first buffered service packet, and by ceasing to receive service packets transmitted on the second transmission path after the currently received service packet has been sent to the client. Here, "concatenation" means ensuring that the two identifiers are consecutive, without any interruption or skipping, thereby ensuring that the service packets are not out of order.

[0051] The second device sends cached service messages to the client.

[0052] In the above implementation, when the first transmission path returns to normal, the continuity of the identifier is ensured by determining whether the identifier of the currently received service message on the second transmission path is consecutive with the identifier of the cached first service message, and whether the currently received service message has been sent to the client. This avoids the problem of out-of-order messages due to packet loss or duplication, and improves the reliability of message transmission.

[0053] In some possible implementations, the method further includes the method responding to the restoration of the first transmission path to normal operation by the second device:

[0054] After a preset time elapsed since the first transmission path resumed normal operation, the second device determines whether the identifier of the currently received service packet on the second transmission path is concatenated with the identifier of the first buffered service packet. The preset time elapsed is the time delay difference between the first and second transmission paths.

[0055] In the above embodiments, a method is provided for determining whether the identifier of the currently received service packet on the second transmission path is consecutive to the identifier of the first cached service packet. By determining whether the duration from the moment the first transmission path returns to normal reaches a preset duration, the method determines whether the identifier of the currently received service packet on the second transmission path is consecutive to the identifier of the first cached service packet, which can complete the determination quickly and efficiently.

[0056] In some possible implementations, the reception status of the associated service message is identified, and the reception status is used to indicate whether the identified service message has been received.

[0057] For each target service message received on the second transmission path, the method further includes: the second device sending the target service message to the client if the reception status associated with the identifier of the target service message indicates that it has not been received; or, the second device discarding the target service message if the reception status associated with the identifier of the target service message indicates that it has been received.

[0058] In the above implementation, by maintaining the association between the identifier of the service message and the reception status of the service message, the dropping or forwarding of the service message can be performed based on the association, which can avoid the problem of message out-of-order due to packet loss or duplication and improve the reliability of message transmission.

[0059] In some possible implementations, the target service message is a service message received on the second transmission path that is within a sliding window.

[0060] A sliding window is used to indicate the number of packets transmitted in a single transmission. The size of the sliding window is larger than the target size, which is twice the difference in the number of packets transmitted by at least two transmission paths within the same time period.

[0061] In the above implementation, due to the possibility of flag flipping, the size of the sliding window must be at least twice the difference in the number of messages to ensure that delayed messages can be buffered while maintaining normal transmission, thus ensuring the normal reception of service messages and preventing them from being out of order. Flipping refers to the process of re-incrementing the flag by step size after it reaches its maximum value, such as starting from 0 and incrementing by 1.

[0062] In some possible implementations, the method further includes: for each target service message received based on the sliding window, in response to the target service message's identifier being greater than all identifiers within the sliding window, moving the sliding window to the position corresponding to the target service message.

[0063] Furthermore, each time the sliding window is moved, the reception status of received service packets outside the sliding window is deleted. Alternatively, in response to the sliding window moving a preset number of times, the reception status of received service packets outside the sliding window is deleted.

[0064] In the above implementation, by deleting the reception status of received service messages outside the sliding window, the reception status of service messages can be updated in a timely manner, avoiding packet loss or duplication caused by incorrect reception status, which in turn leads to message out-of-order issues.

[0065] Thirdly, a message transmission apparatus is provided for implementing any of the methods provided in the first aspect. The message transmission apparatus includes modules, units, or means that implement the methods described above. The actions performed by these modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above.

[0066] In one possible implementation, the device may include a receiving module and a transmitting module; wherein:

[0067] The receiving module is used to receive service messages from the client;

[0068] The sending module is used to send service messages with added identifiers to the second device on at least two transmission paths. The identifiers are used to indicate the transmission order of the service messages in multiple service messages of the same service.

[0069] Fourthly, a message transmission apparatus is provided for implementing any of the methods provided in the second aspect above. The message transmission apparatus includes modules, units, or means that implement the methods described above. The actions performed by these modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functions described above.

[0070] In one possible implementation, the device may include a receiving module and a transmitting module; wherein:

[0071] The receiving module is used to receive service messages sent by the first device on at least two transmission paths. The service message includes an identifier, which is used to indicate the transmission order of the service message in multiple service messages of the same service.

[0072] The sending module is used to send service messages transmitted on the first transmission path of at least two transmission paths to the client based on the identifier.

[0073] Fifthly, a first device is provided, comprising: a memory and a processor, the memory and the processor being connected; the memory being used to store computer-executable instructions; and the processor being used to invoke the computer-executable instructions to implement the method of the first aspect or any implementation thereof.

[0074] The first device in the fifth aspect can be: the first device in any implementation of the first aspect, or an apparatus containing the first device, or an apparatus contained in the first device, such as a chip.

[0075] In a sixth aspect, a second device is provided, comprising: a memory and a processor, the memory and the processor being connected; the memory being used to store computer-executable instructions; and the processor being used to invoke the computer-executable instructions to implement the method of the second aspect above or any implementation thereof.

[0076] The second device in the sixth aspect can be: a second device in any implementation of the second aspect, or an apparatus containing the second device, or an apparatus contained in the second device, such as a chip.

[0077] A seventh aspect provides a message transmission system, including a first device as described in the fifth aspect and a second device as described in the sixth aspect. The first device is configured to: receive service messages from a client; and send service messages with added identifiers to the second device on at least two transmission paths, the identifiers indicating the transmission order of the service messages among multiple service messages of the same service. The second device is configured to: receive service messages sent by the first device on at least two transmission paths; and, based on the identifiers, send service messages transmitted on the first transmission path out of the at least two transmission paths to the client.

[0078] Eighthly, a chip is provided, comprising: a processor and an interface circuit; the interface circuit for receiving computer execution instructions and transmitting them to the processor; and the processor for executing the computer execution instructions to perform the methods of the first aspect, the second aspect, or any implementation thereof described above.

[0079] When the chip is deployed on the first device, the processor executes computer execution instructions to perform the method of the first aspect or any implementation thereof. When the chip is deployed on the second device, the processor executes computer execution instructions to perform the method of the second aspect or any implementation thereof.

[0080] A ninth aspect provides a computer-readable storage medium comprising computer-executable instructions that, when executed on a first device, cause the first device to perform the method described in the first aspect or any implementation thereof, and when executed on a second device, cause the second device to perform the method described in the second aspect or any implementation thereof.

[0081] In a tenth aspect, a computer program product is provided, comprising computer execution instructions that, when executed on a first device, cause the first device to perform the method described in the first aspect or any implementation thereof, and when executed on a second device, cause the second device to perform the method described in the second aspect or any implementation thereof.

[0082] The technical effects of any of the implementation methods in aspects three through ten can be found in the technical effects of the corresponding implementation methods in aspects one or two, and will not be repeated here.

[0083] All possible implementations of any of the above aspects can be combined, provided that the solutions do not contradict each other. Attached Figure Description

[0084] Figure 1 is a schematic diagram of a path switching method provided by related technologies;

[0085] Figure 2 is a schematic diagram of the architecture of a message transmission system provided in an embodiment of this application;

[0086] Figure 3 is a schematic diagram of an example message transmission system provided in an embodiment of this application;

[0087] Figure 4 is a schematic diagram of a message transmission module structure provided in an embodiment of this application;

[0088] Figure 5 is a schematic diagram of the hardware structure of an OTN device provided in an embodiment of this application;

[0089] Figure 6 is a flowchart illustrating a message transmission method provided in an embodiment of this application;

[0090] Figure 7 is a schematic diagram of an expanded target field provided in an embodiment of this application;

[0091] Figure 8 is a schematic diagram illustrating the principle of a delay detection method provided in an embodiment of this application;

[0092] Figure 9 is a schematic diagram of a path switching process provided in an embodiment of this application;

[0093] Figure 10 is a schematic diagram of a fault detection-triggered switching based on an embodiment of this application;

[0094] Figure 11 is a schematic diagram of a switching triggered by identifier continuity detection provided in an embodiment of this application;

[0095] Figure 12 is a schematic diagram illustrating the principle of path switching provided in an embodiment of this application;

[0096] Figure 13 is a schematic diagram of the size of a sliding window provided in an embodiment of this application;

[0097] Figure 14 is a schematic diagram of a process for processing service messages based on a sliding window according to an embodiment of this application;

[0098] Figure 15 is a schematic diagram of a path switching process performed when the system returns to normal, according to an embodiment of this application.

[0099] Figure 16 is a schematic diagram illustrating the principle of path switching when the system returns to normal, according to an embodiment of this application.

[0100] Figure 17 is a schematic diagram of another path switching process provided by an embodiment of this application when the system returns to normal.

[0101] Figure 18 is a schematic diagram of a message transmission device provided in an embodiment of this application;

[0102] Figure 19 is a schematic diagram of another message transmission device provided in an embodiment of this application. Detailed Implementation

[0103] In the description of this application, unless otherwise stated, "multiple" means two or more. At least one of the following or similar expressions refer to any combination of these terms, including any combination of single or plural terms. For example, at least one of a, b, and / or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0104] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0105] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0106] It is understood that the term "embodiment" used throughout the specification means that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, throughout the specification, various embodiments do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0107] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Correspondingly, the apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.

[0108] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. In the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments are consistent and can be mutually referenced. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships. The following embodiments of this application do not constitute a limitation on the scope of protection of this application.

[0109] The following provides an exemplary description of the application scenarios of the embodiments of this application.

[0110] With the explosive growth of internet data and large-scale data interaction between data centers, higher demands have been placed on data transmission rates, capacities, and distances. Currently, long-distance fiber optic transmission technology, due to its high-speed, high-capacity, and long-distance transmission characteristics, can meet the interconnection needs between data centers and has been widely used in data center-based communication systems.

[0111] In data center-based communication systems, devices need to frequently transmit and exchange large amounts of data. Typically, data transmission can be performed using the remote direct memory access (RDMA) data transmission mode.

[0112] RDMA, or Direct Memory Access, is a technology that allows data to be transferred directly from the memory of one device to the memory of another without the intervention of the operating systems of either device. Therefore, RDMA enables direct transfer of memory data between two devices during network transmission, bypassing multiple memory copies within the operating system and directly transferring the memory data of the current device to the memory of the remote device over the network.

[0113] Compared to traditional data transmission modes such as Transmission Control Protocol (TCP) and Internet Protocol (IP), RDMA does not require the intervention of an operating system or TCP or IP protocols. It can easily achieve ultra-low latency data processing and ultra-high throughput data transmission, and it does not require remote devices to copy data layer by layer based on the central processing unit (CPU), thus saving CPU resources consumed in data transmission.

[0114] RDMA's high performance and low latency characteristics are well-suited for network communication in data centers, effectively improving overall performance. Therefore, with the emergence of massively parallel systems in data centers, such as high-performance computing systems, cluster training systems, and distributed storage systems, the data transmission mode in future data centers is gradually evolving towards RDMA-based data transmission, with service flows typically being RDMA flows. A service flow refers to the data stream transmitted between devices, used to transmit data that users need to exchange, such as various types of data like text, images, audio, and video. In some embodiments, a service flow may include multiple service messages. The embodiments in this application will subsequently describe the solution from the perspective of service messages.

[0115] Data centers can be general-purpose data centers or intelligent computing data centers. In artificial intelligence (AI) applications, data centers can be intelligent computing data centers. Currently, with the rise of AI, AI solutions represented by large-scale models are gradually penetrating various industries. For example, large-scale models have shown excellent performance in natural language processing and computer vision processing. Currently, the number of model parameters and training scale are growing exponentially, leading to a surge in computing power demands. For instance, the computing power requirements for large-scale models are increasing tenfold, limiting the scale of a single intelligent computing data center. Therefore, by geographically distributing multiple intelligent computing data centers (which can be referred to as intelligent computing geographical distribution), ultra-large intelligent computing clusters can be built, thereby enabling cross-domain distributed training of large-scale models.

[0116] Intelligent computing remote transmission refers to separating the physical location of storage resources from the physical location of computing resources and achieving efficient remote data transmission and access through advanced network technologies. For example, in some possible embodiments, in a communication system based on an intelligent computing data center, long-distance fiber optic transmission technology can be used to remotely transmit data samples (such as images, text, audio, etc.) required for model training via the network. Similarly, in other possible embodiments, in a communication system based on an intelligent computing data center, long-distance fiber optic transmission technology can be used to remotely transmit intermediate training results (such as model training results) obtained during model training via the network.

[0117] Currently, in long-distance fiber optic transmission scenarios, service packets are transmitted along pre-defined fixed transmission paths, resulting in poor transmission flexibility. For example, in conventional transmission scenarios, service packets are transmitted along a single fixed transmission path. Conversely, in switching transmission scenarios, service packets are transmitted along two fixed transmission paths.

[0118] In conventional transmission scenarios, service packets are transmitted along only one fixed transmission path. Packet loss due to faults, interruptions, or bit errors can easily lead to out-of-order packets. Similarly, in switching transmission scenarios, service packets are transmitted along two fixed transmission paths. Path switching can also cause packet loss and duplication, resulting in out-of-order packets.

[0119] Among these, a fault refers to an abnormality in the fiber optic link, network equipment, or network system, leading to transmission interruption or performance degradation. A brief interruption refers to a temporary interruption or instability in the transmission of signals or the link status within the fiber optic link. A bit error refers to the inconsistency between the received and transmitted data due to factors such as noise, interference, and signal attenuation during transmission. Switching refers to the process of switching to a backup path (or protection path) to receive service packets when the primary path (or working path) experiences any of the aforementioned faults, brief interruptions, or bit errors.

[0120] In related technologies, subnetwork connection protection (SNCP), automatic protection switching (APS), or fast reroute (FRR) techniques can be used to implement switching in transmission scenarios. Since path switching needs to be completed within 50ms to 200ms, packet loss and duplication may occur due to path switching, leading to out-of-order packets.

[0121] Based on Figure 1, and taking SNCP technology as an example, the following describes the switching scheme in related technologies. Figure 1 is a schematic diagram of path switching provided by related technologies. Referring to Figure 1(1-1), before switching, the source end (or sender) transmits service packets to the destination end (or receiver) through the working path and the protection path. At this time, the destination end is connected to the working path to receive service packets transmitted on the working path. When the working path experiences the aforementioned fault, interruption, or bit error, switching is triggered. Referring to Figure 1(1-2), after switching, the device at the destination end is connected to the protection path to receive service packets transmitted on the protection path.

[0122] In summary, long-distance fiber optic transmission scenarios suffer from poor message transmission flexibility and reliability under conditions such as the aforementioned faults, interruptions, bit errors, or switching. Therefore, improving the flexibility and reliability of message transmission in long-distance fiber optic scenarios to ensure lossless transmission of service messages is a pressing issue that needs to be addressed.

[0123] In view of this, embodiments of this application provide a message transmission method. A first device adds an identifier to a service message to indicate the transmission order of the service message among multiple service messages within the same service. The identified service messages are then sent to a second device along at least two transmission paths. Upon receiving the identified service messages, the second device can send the service messages transmitted on the first transmission path (one of the at least two transmission paths) to the client based on the identifier. By adding an identifier to the service messages, the amount of information included in the service messages is increased, allowing the second device to select the service messages transmitted on the first transmission path from the at least two transmission paths based on the identifier, and then send the service messages transmitted on the first transmission path to the client. This allows the second device to select one transmission path from at least two transmission paths as its working path, rather than transmitting on a preset fixed transmission path, thus improving the flexibility of message transmission.

[0124] Furthermore, this application embodiment also provides a path switching method. Since the identifier of a service packet can indicate the transmission order of a service packet among multiple service packets of the same service, service packets transmitted on the second transmission path can be selectively processed according to the identifier of the service packet (e.g., discarding when the identifier is duplicated or forwarding when the identifier is not duplicated). In this way, the problem of out-of-order packets due to packet loss or duplication can be avoided, and the reliability of packet transmission can be improved.

[0125] The message transmission method provided in this application can be applied to long-distance fiber optic transmission scenarios in data center-based communication systems, such as long-distance fiber optic transmission scenarios in intelligent computing center-based communication systems. Based on the technical solution provided in this application, the flexibility and reliability of message transmission in long-distance fiber optic transmission scenarios are improved, ensuring lossless transmission of service messages.

[0126] To facilitate understanding of the embodiments of this application, the following points will be explained before introducing the embodiments of this application.

[0127] 1. In the embodiments of this application, "instruction" can include direct instruction and indirect instruction, as well as explicit instruction and implicit instruction. The information indicated by a certain piece of information is called the information to be instructed. In specific implementation, there are many ways to indicate the information to be instructed, such as, but not limited to, directly indicating the information to be instructed, such as the information to be instructed itself or its index. It can also indirectly indicate the information to be instructed by indicating other information, where there is a relationship between the other information and the information to be instructed. It can also indicate only a part of the information to be instructed, while the other parts of the information to be indicated are known or pre-agreed.

[0128] 2. In the embodiments of this application, the descriptions such as "in the case of", "if" and "if" all refer to the fact that the device (e.g., the first device or the second device) will make corresponding processing under certain objective circumstances. They are not time limits, nor do they require the device (e.g., the first device or the second device) to have a judgment action when implementing it, nor do they mean that there are other limitations.

[0129] Furthermore, the system architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0130] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.

[0131] The system architecture of the embodiments of this application will be described below as an example.

[0132] In some embodiments, the message transmission method provided in this application can be applied to the message transmission system shown in FIG2. For example, FIG2 is a schematic diagram of the architecture of a message transmission system provided in an embodiment of this application. Referring to FIG2, the message transmission system includes: a first client 201, a first device 202, a second device 203, and a second client 204.

[0133] The first client 201, the first device 202, the second device 203, and the second client 204 are connected in sequence.

[0134] The first client 201 is a device within the data center connected to the first device 202, such as a switch or server. In this embodiment, the first client 201 refers to the initiator of the service message, responsible for starting relevant service operations, thereby triggering the service message sending process.

[0135] The second client 204 is a device within the data center connected to the second device 203, such as a switch or server. In this embodiment, the second client 204 refers to the destination of the service message and is responsible for performing specific processing of the relevant service after receiving the service message.

[0136] The first device 202 and the second device 203 are network devices used to transmit service messages in a long-distance transmission network. It is understood that, based on the long-distance transmission network between the first device 202 and the second device 203, long-distance message transmission across data centers can be achieved.

[0137] For example, the first device 202 and the second device 203 can be connected via long-distance optical fiber, such as 16 * 400 gigabit-per-second (Gbps) * 100 (km) optical fibers, to construct a 16 * 400G * 100km long-distance optical fiber transmission network. Here, 16 * 400G * 100km indicates that 16 400Gbps optical fiber links are set up over a distance of 100 kilometers. 400Gbps indicates that the message transmission rate of each optical fiber link is 400Gbps.

[0138] In some embodiments, the first device 202 and the second device 203 may be optical transport network (OTN) devices. Alternatively, in other embodiments, the first device 202 and the second device 203 may also be network devices such as switches or routers. This application does not limit these embodiments.

[0139] In this embodiment of the application, long-distance message transmission can be achieved between the first device 202 and the second device 203 through at least two transmission paths as shown in FIG2.

[0140] In this embodiment, the first device 202 is a network device for sending service packets. Specifically, it is used to: receive service packets from the first client 201, and send service packets with added identifiers to the second device 203 on at least two transmission paths. The identifiers are used to indicate the transmission order of the service packets among multiple service packets of the same service.

[0141] In this embodiment, the second device 203 is a network device for receiving service packets. Specifically, it is used to: receive service packets sent by the first device 202 on at least two transmission paths, and, based on the identifier of the service packet, send the service packet transmitted on the first transmission path of the at least two transmission paths to the second client 204.

[0142] In the message transmission process between the first device 202 and the second device 203, the first device 202 can be understood as the sender of the service message, and the second device 203 can be understood as the receiver of the service message. It is worth noting that the sender and receiver mentioned in this embodiment are relative and can interchange roles in different communication stages or scenarios. For example, in a bidirectional communication system, each device can act as both a sender and a receiver.

[0143] The following description uses the example diagram shown in Figure 3 to illustrate the equipment within a data center. Figure 3 is an example diagram of a message transmission system provided in an embodiment of this application. Referring to Figure 3, the data center includes a core switch, an Ethernet switch, or a server.

[0144] In this embodiment, the client can be a core switch, Ethernet switch, or server within a data center.

[0145] The core switch connects to an Ethernet switch on one end and a network device (such as a first device or a second device) on the other end, connecting the internal and external networks of the data center to provide network connectivity and data forwarding capabilities. For example, taking a Spine-Leaf architecture data center, the core switch could be a Spine switch.

[0146] An Ethernet switch connects to a server on one end and to a core switch on the other, enabling communication between the server and the core switch. Furthermore, the other end of the Ethernet switch can also connect to network devices (such as a first device or a second device) to connect the internal and external networks of the data center, thereby providing network connectivity and data forwarding capabilities. For example, in a Spine-Leaf architecture data center, the Ethernet switch could be a Leaf switch. Alternatively, the Ethernet switch could also be a top-of-rack switch (TOR).

[0147] The server is used to trigger the sending or processing of business messages. In some embodiments, the server may be deployed with multiple neural processing units (NPUs), graphics processing units (GPUs), or other processors, such as eight NPUs, to execute AI-related business.

[0148] Figure 4 is a schematic diagram of a message transmission module structure provided in an embodiment of this application. Referring to Figure 4, the first device may include a sequencing module and a copying module. The second device may include a receiving port, a detection module, a selective receiving module, a sequence-keeping module, and a buffer module. At least two transmission paths exist between the first device and the second device, which may include a first transmission path and a second transmission path. In this embodiment, the first transmission path is used to refer to the transmission path with low latency (i.e., the short path). The second transmission path is used to refer to the transmission path with high latency (i.e., the long path).

[0149] The system comprises several modules: a sequencing module for reordering received service packets according to their transmission order to obtain an identifier; a copying module for copying identified service packets and transmitting them on at least two transmission paths; a detection module for delay and anomaly detection, triggering selective reception processing of transmission paths and service packets; and a selective reception module for performing selective reception processing of transmission paths and service packets. Selective reception processing of transmission paths refers to selectively processing service packets on a first transmission path (e.g., forwarding them to the client) based on their identifiers, from at least two transmission paths. Selective reception processing of service packets refers to selectively processing service packets received on a second transmission path (e.g., discarding them or forwarding them to the client) based on their identifiers. A preordering module sends service packets to the client sequentially according to their identifiers. A caching module caches service packets to be sent.

[0150] In one example of this application, taking the first device and the second device as OTN devices, the hardware structure diagram of the first device and the second device is shown in Figure 5. Figure 5 is a hardware structure diagram of an OTN device provided in an embodiment of this application.

[0151] Referring to Figure 5, the OTN device may include one or more of the following: tributary board 501, line board 502, and cross-connect board 503; it may also include system control board 504, and one or more of the following: power supply board 505, fan board 506, and auxiliary board 507.

[0152] When the OTN device is a box-type device, the tributary board 501 and the circuit board 502 can be integrated into one unit. The circuit board 502 can also be an optical layer processing board. Depending on specific needs, the type and number of boards included in each device may differ. For example, an OTN device acting as a core node may not have a tributary board 501. An OTN device acting as an edge node may have multiple tributary boards 501.

[0153] Branch board 501, line board 502 and cross board 503 are mainly used to process the electrical layer signals of OTN (also known as OTN frames).

[0154] The tributary board 501 is used to receive and transmit various customer signals (also known as customer services), such as the service flows mentioned in the embodiments of this application. Customer signals may include constant bit rate (CBR) signals (e.g., synchronous digital hierarchy (SDH) signals) and packet signals (e.g., Ethernet signals). Furthermore, the tributary board 501 may include a customer-side optical module and a signal processor. The customer-side optical module is used to receive and / or transmit customer signals. The signal processor is used to perform mapping and demapping processing of customer signals to OTN frames. The signal processor may be located inside or outside the customer-side optical module. If the signal processor is a combination of multiple chips, one (or some) of the chips may be inside the customer-side optical module, while the others may be outside.

[0155] Circuit board 502 primarily handles the processing of line-side OTN frames. Specifically, circuit board 502 may include a line-side optical module and a signal processor. The line-side optical module is used to receive and / or transmit optical signals carrying OTN frames. The signal processor is used to perform multiplexing and demultiplexing, or mapping and demapping, of the line-side OTN frames. The signal processor may be located inside or outside the line-side optical module. If the signal processor is a combination of multiple chips, one (or some) of the chips may be inside the line-side optical module, while the others may be outside. The client-side optical module or the line-side optical module may also be collectively referred to as an optical module or an optical transceiver. The signal processor in the client-side optical module or the line-side optical module may be an optical digital signal processor (oDSP) or a framer, or a combination of a framer and an oDSP.

[0156] Cross-connect board 503 is used to implement the switching of OTN frames, such as to complete the switching of one or more types of OTN frames.

[0157] System control board 504 is used for system control. Specifically, the system control board can collect information from different boards or send control commands to the corresponding boards.

[0158] Power supply board 505 is used to power OTN devices and may include a main power supply and a backup power supply. Fan board 506 is used to cool the devices. Auxiliary board 507 is used to provide auxiliary functions such as external alarms or connection to an external clock.

[0159] Unless otherwise specified, there may be one or more components in the OTN device (e.g., tributary board 501), and this application embodiment does not impose any restrictions on this.

[0160] For ease of understanding, the message transmission method provided in the embodiments of this application will be described below with reference to the above system architecture and accompanying drawings.

[0161] It is understood that in the embodiments of this application, the first device or the second device may perform some or all of the steps in the embodiments of this application. These steps or operations are merely examples. The embodiments of this application may also perform other operations or variations of various operations.

[0162] Figure 6 is a schematic flowchart of a message transmission method provided in an embodiment of this application. In some possible implementations, the message transmission method can be completed by the cooperation of the first client, the first device, the second device, and the second client in the above system architecture. Referring to Figure 6, taking the interaction flow between the first client, the first device, the second device, and the second client as an example, the method includes the following S601 to S604.

[0163] S601, The first device receives a service message from the first client.

[0164] In some embodiments, taking the first client as a server, the above-described S601 can be replaced by: the first device receiving service packets from the server. In other embodiments, taking the first client as a switch, the above-described S601 can be replaced by: the first device receiving service packets from the switch. It is worth noting that the first client can also be other types of devices, and this application embodiment does not limit this.

[0165] S602. The first device sends the service message with added identifier to the second device on at least two transmission paths.

[0166] The identifier is used to indicate the transmission order of a service message among multiple service messages in the same service.

[0167] For example, the identifier can be a serial number. For instance, numbers, letters, or other parameters can be used to represent the serial number, and this application embodiment does not limit this. This application embodiment will subsequently use numbers as an example to illustrate the scheme.

[0168] In some embodiments, after receiving a service message from a first client, the first device determines the identifier of the service message. It then adds the identifier to the service message to obtain an identifiable service message. Subsequently, the identifiable service message is sent to the second device on at least two transmission paths. It is worth noting that the service messages transmitted on at least two transmission paths are service messages containing the same identifier. For example, a service message containing the same identifier can be obtained by copying, and then the service message containing the same identifier can be sent to the second device on at least two transmission paths.

[0169] The identifiers for multiple business messages can be determined based on initial values, step values, and sequencing rules.

[0170] The initial value can be 0 or other values. The step size can be 1 or other values. The sequencing rule is based on the maximum value of 2. N The -1 flip rule means that whenever the value of the identifier is greater than the maximum value of 2, the value will be flipped. N When the value is -1, a flag flip operation is performed. The flip operation refers to the process of restarting the accumulation of the flag from the initial value after it has reached the maximum value, such as starting from 0 and accumulating by 1.

[0171] In multiple service messages within the same service, the first identifier added to the first service message is an initial value. The second identifier added to the second service message following the first service message is a value obtained by accumulating the initial value with a step size. The maximum value of the second identifier is 2. N -1.

[0172] For example, taking the identifier as sequence number, the initial value as 0, the step value as 1, and the maximum value of the second identifier as 100, the sequence number of the service message starts from 0 and increments by 1 until it reaches 100, at which point it increments by 1 and flips back to 0, then starts from 0 again and increments by 1, and so on, to obtain the sequence numbers of multiple service messages.

[0173] In the above embodiments, considering the limited number of bits (or bit width) that the second identifier can occupy during transmission or storage, setting a maximum value for the second identifier can more effectively utilize the limited bit width resources. This avoids the problem of the second identifier overflowing due to an excessive number of second service messages to be sent and a value that is too small, thus ensuring the stability of message transmission. Overflow refers to a phenomenon where the value exceeds the range that its storage space or data type can represent, resulting in errors or anomalies.

[0174] Regarding the maximum value of 2 mentioned above N -1 can be represented in binary form. Here, N is the number of bits required for the maximum value of the second identifier. The maximum value is 2. N -1 can be a pre-set quantity or a value determined based on the actual transmission situation.

[0175] In some possible implementations, the maximum value is 2. N -1 is related to the difference in the number of messages transmitted on at least two transmission paths within the same time period, such as a positive correlation. It is understood that since there is a delay difference between the at least two transmission paths provided in this application embodiment, a difference in the number of messages will occur when transmitting service messages on at least two transmission paths within the same time period.

[0176] In some possible implementations, the maximum value of the second identifier is greater than or equal to the difference in the number of messages transmitted by at least two transmission paths within the same time period. For example, taking two transmission paths as an example, the message number difference can be the difference in the number of messages transmitted by the two transmission paths within the same time period. As another example, taking multiple transmission paths as an example, the message number difference can be the maximum difference in the number of messages transmitted by the multiple transmission paths within the same time period. For instance, after obtaining the difference in the number of messages transmitted by each pair of transmission paths within the same time period, there are multiple message number differences; the largest value among them is selected.

[0177] Specifically, the process for determining the difference in the number of messages transmitted between two transmission paths within the same time period includes: First, the first device determines the total amount of data allowed to be transmitted within the delay difference based on the message transmission rate and the delay difference between the two transmission paths. Second, the first device determines the amount of data included in the received service message based on the message length, preamble length, and frame interval length of the received service message. Finally, the first device determines the difference in the number of messages based on the total amount of data and the amount of data included in the received service message.

[0178] For example, the first device, based on the following formula (1), determines the product of the message transmission rate and the delay difference between the two transmission paths, and obtains the total amount of data allowed to be transmitted within the delay difference. Furthermore, based on the message length, preamble length, and frame interval length of the received service message, the device determines the sum of the lengths of the message length, preamble length, and frame interval length, and determines the product of this sum with 8, obtaining the amount of data included in the received service message. Then, based on the total amount of data and the amount of data included in the received service message, the device determines the quotient of the total amount of data and the amount of data included in the received service message, obtaining the message quantity difference.

[0179] In the formula, Δw represents the difference in the number of messages transmitted by each of the two transmission paths within the same time period; v represents the message transmission rate; Δt represents the delay difference between the two transmission paths; l1 represents the message length; l2 represents the preamble length; and l3 represents the frame interval length.

[0180] The message transmission rate in formula (1) above can be determined based on the rate of the data transmission interface of the data center. For example, the physical interface rate maintained by the data center is also the message transmission rate, such as 100Gbps, 400Gbps, 800Gbps, 1600Gbps, etc. It is understood that the physical configurations of different data centers may be different.

[0181] The message length in formula (1) above can be determined based on the header length and data length of the service message. For example, the sum of the header length and data length of the service message can be used as the message length.

[0182] The preamble length in formula (1) above can be determined based on the length of the preamble field in the header of the service message. Similarly, the inter-packet gap (IPG) length in formula (1) above can also be determined based on the length of the inter-packet gap (IPG) field in the header of the service message.

[0183] It is worth noting that the units for message length, preamble length, and frame interval length are bytes, while the unit for data volume is bits. Here, 1 byte = 8 bits, and the 8 in the above formula refers to the multiple relationship between bytes and bits. Therefore, in the above formula (1), multiplying the sum of the message length, preamble length, and frame interval length by 8 yields the amount of data included in the service message.

[0184] The time delay difference between the two transmission paths in the above formula (1) can be determined based on the distance difference between the two transmission paths. For example, if the distance difference between the two transmission paths (such as an optical fiber transmission path) is 1 km, the corresponding time delay difference can be 5 microseconds (µs).

[0185] In the above embodiments, using the difference in the number of packets to determine the maximum value of the second identifier can more accurately adapt to the identifier requirements of different transmission paths, thereby making more rational use of identifier resources and avoiding situations where one transmission path has insufficient identifiers while another transmission path wastes identifiers. Furthermore, a method for calculating the difference in the number of packets transmitted by two transmission paths within the same time period is provided, enabling quick and efficient acquisition of the packet quantity difference.

[0186] After obtaining the difference in the number of messages transmitted by at least two transmission paths within the same time period based on the above formula (1), since the maximum value is 2 N -1 being greater than or equal to the difference in the number of messages obtained allows us to determine the maximum value of 2. N -1. Then, by adjusting the maximum value of 2... N Converting -1 yields N, which is the number of bits required for the maximum value.

[0187] In some embodiments, the first device determines N based on the difference in the number of messages transmitted by at least two transmission paths within the same time period and the following formula (2). N = CEILING(LOG(4*Δw,2),1) (2)

[0188] In the formula, LOG(4*Δw,2) represents the logarithm of 4*Δw with base 2, where 4 is determined based on the size of the sliding window of the second device; CEILING represents rounding up from base 1. The sliding window size is greater than the target size, which is twice the difference in the number of packets transmitted by at least two transmission paths within the same time period.

[0189] This provides a way to determine N. Understandably, considering that the sliding window size of the second device must be at least twice the difference in the number of packets to ensure both buffering delayed packets and maintaining normal transmission, then based on the packet number difference Δw = 2... N -1, which means the size of the sliding window must be at least greater than 2*Δw=2*(2 N -1), that is, at least 2 should be selected. 2 *(2 N -1) A sliding window of size. Furthermore, based on Δw = 2 2 *(2 N -1)=2 N+2 By reversing the derivation from -4, we can obtain the above formula and thus determine the value of N. Here, 4 is obtained by performing a logarithmic transformation on the difference between twice the number of messages.

[0190] Considering that the second device will use a sliding window to receive service messages, and due to the possibility of flag flipping, the size of the sliding window must be at least twice the difference in the number of messages. Based on this, it can be deduced that N is at least 2 bits larger than the maximum value of the flag.

[0191] In this embodiment, N is a positive integer greater than 16. For example, N is 24, 32, 40, or 48. The process of obtaining the reference value of 16 is described below. In different transmission scenarios, based on Δw = 2... NBy converting -1, we can calculate multiple values ​​as shown in Table 1, which represent the actual number of bits occupied by the maximum value of the identifier under different transmission scenarios.

[0192] Table 1

[0193] Referring to Table 1, taking the transmission scenario of 1600G@64B and 1000km@5ms as an example, 1600G represents the message transmission rate v. 64B represents the message length l1 (B refers to the unit of bytes). 1000km@5ms means that the distance difference between the two transmission paths is 1000km, and the corresponding delay difference Δt is 5 milliseconds (ms). In addition, the preamble length l2 of the service message is usually a fixed value of 8, and the frame interval length l3 of the service message is usually 12. Substituting the obtained parameter values ​​into the above formula (1), we can obtain the difference in the number of messages transmitted by the two transmission paths in the same time period, Δw. Substituting the difference in the number of messages transmitted by the two transmission paths in the same time period, Δw, into the above formula (2), we can obtain N = 24 bits as shown in Table 1. Other scenarios are similar and will not be elaborated further.

[0194] Adding 2 bits to the multiple values ​​shown in Table 1 above can yield multiple values ​​of N as shown in Table 2.

[0195] Table 2

[0196] Based on Table 2 above, it can be seen that many values ​​of N are greater than 16 bits. Therefore, by setting N to a positive integer greater than 16, and further setting it to 24, 32, 40, or 48, the requirements for N in most message transmission scenarios can be covered, which means that the bit requirement occupied by the maximum value of the identifier is met.

[0197] In some embodiments, when the first device adds the identifier to the service message, it can add the identifier to the target field of the service message to obtain the service message with the added identifier.

[0198] In some possible implementations, the target field is an original field or a newly added field in the header of the service message. Alternatively, the target field is an original field or a newly added field in the payload of the service message. The payload is the core content of the service message, including the actual transmitted service data.

[0199] For example, Table 3 shows the field format of a service message. The message header may include an IPG field, a preamble field, a source address (SA) field, a destination address (DA) field, a redundancy tag (RTAG) field, and an ether type field. As shown in Table 3, taking the 802.1CB RTAG format as an example, the RTAG fields in the message header are shown, including the R-TAG tag protocol identifier (R-TAG TPID) field, a reserved field, and an SN field. The service message payload may include a payload field. The service message also includes a frame check sequence (FCS) field.

[0200] Table 3

[0201] For example, the target field can be a raw field in the header such as the IPG field, preamble field, SA field, DA field, or ether type field. Alternatively, the target field can also be a raw field in the payload such as the payload field. Alternatively, the target field can also be a newly added SN field. Table 3 uses the example of the newly added SN field being located in the header. Of course, the newly added SN field can also be located in the payload, and this embodiment of the application does not limit this.

[0202] In this embodiment, the target field occupies 3, 4, 5, or 6 bytes. The number of bytes occupied by the target field can be obtained by converting N. It is understood that when the maximum value of the second identifier occupies 24, 32, 40, or 48 bits (i.e., N), the corresponding byte conversion is 3, 4, 5, or 6. Therefore, by setting the target field to 3, 4, 5, or 6 bytes, it can accommodate the maximum value of the second identifier (24, 32, 40, or 48 bits), thus covering the field width requirements in most message transmission scenarios.

[0203] Taking a target field occupying 3 bytes as an example, assuming the original target field has 2 bytes, the original bytes of the target field need to be expanded. For example, Figure 7 is a schematic diagram of target field expansion provided by an embodiment of this application. Referring to Figure 7, taking the newly added SN field in the RTAG field as an example, the bit width of the SN field in the service message can be expanded from 2 bytes (referred to as 2B) to 3 bytes (referred to as 3B). The bit width of the R-TAG TPID field is 2 bytes, meaning that 0xF1C1 shown in Figure 7 occupies 2 bytes. The bit width of the reserved field is 2 bytes. After expanding the SN field, the bit width of the reserved field changes to 1 byte (referred to as 1B). Of course, in other embodiments, it can be expanded to more than 3 bytes, such as 4, 5, or 6 bytes; this embodiment of the application does not limit this.

[0204] In some embodiments, after the first device adds an identifier to the service message, it also copies the identified service message to obtain a copied service message, so that the copied service message can be sent on at least two transmission paths respectively.

[0205] S603, The second device receives service messages sent by the first device on at least two transmission paths respectively.

[0206] S604. The second device, based on the identifier, sends the service message transmitted on the first transmission path of at least two transmission paths to the second client.

[0207] The first transmission path is the transmission path with the shorter latency among at least two transmission paths.

[0208] In some embodiments, the delay of at least two transmission paths is determined based on the time when service packets carrying the same identifier are received on at least two transmission paths. The corresponding process may be: for service packets carrying the same identifier received on at least two transmission paths, record the arrival time of the service packet on each of the at least two transmission paths. The transmission path that arrives first is determined as the transmission path with the shorter delay, i.e., the first transmission path. The transmission path that arrives later is determined as the transmission path with the longer delay.

[0209] Understandably, for service packets with the same identifier, the service packet that arrives first is forwarded normally, while the service packet that arrives later is discarded. That is to say, for service packets with the same identifier, the service packet received along the first transmission path is forwarded normally, while the service packet received along other transmission paths is discarded.

[0210] In this embodiment of the application, the first transmission path is used as the working path, and the other transmission paths are used as protection paths.

[0211] For example, Figure 8 is a schematic diagram of the principle of delay detection provided in an embodiment of this application. Referring to Figure 8, taking two transmission paths as an example and using sequence numbers as identifiers, service packets with sequence numbers 1 to 8 as shown in Figure 8 can be transmitted on the two transmission paths respectively. For service packets with the same sequence number, such as service packet with sequence number 1, the timing starts from the time T0 when the first device starts transmitting the service packet. Assuming that the arrival time on one of the two transmission paths is T1 and the arrival time on the other transmission path is T2, and T2>T1, it means that the packet on the transmission path with arrival time T1 arrives first and can be used as the transmission path with the smaller delay, i.e., the first transmission path, i.e., the working path; the packet on the transmission path with arrival time T2 arrives later and can be used as the transmission path with the larger delay, i.e., the protection path. It can be understood that when performing delay detection, for service packets with the same sequence number, it is determined whether the arrival times are different. If the arrival times are different, it is necessary to select the transmission path with the smaller delay from the two transmission paths as the first transmission path. If the arrival times are the same, one of the two transmission paths can be selected as the first transmission path, such as arbitrarily selecting one.

[0212] The technical solution provided in this application involves a first device adding an identifier to service packets to indicate the transmission order of service packets within multiple service packets of the same service. The identified service packets are then sent to a second device along at least two transmission paths. Upon receiving the identified service packets, the second device can send the service packets transmitted on the first transmission path (one of the at least two transmission paths) to a second client based on the identifier. Adding an identifier to the service packets increases the amount of information included in the service packets, allowing the second device to select the service packets transmitted on the first transmission path from the at least two transmission paths based on the identifier, and then send the service packets transmitted on the first transmission path to the second client. This allows the second device to select one transmission path from at least two transmission paths as its working path, rather than transmitting on a preset fixed transmission path, thus improving the flexibility of packet transmission.

[0213] Figure 6 above illustrates a scheme for message transmission based on at least two transmission paths. After executing S604 based on Figure 6, the second device can perform anomaly detection or manual control on the first transmission path. Furthermore, in the event of an anomaly or switching command in the first transmission path, path switching can also be performed. Figure 9 is a schematic flowchart of a path switching procedure provided by an embodiment of this application. Referring to Figure 9, the method includes the following S901 to S903.

[0214] S901, The second device performs anomaly detection on the first transmission path.

[0215] Anomaly detection includes at least one of the following: fiber optic link fault detection and service message identification continuity detection.

[0216] In some embodiments, fiber optic link fault detection is used to detect whether a fault exists in the fiber optic link. It is understood that the presence of a fault in the fiber optic link indicates an anomaly in the first transmission path. The absence of a fault in the fiber optic link indicates that the first transmission path is not experiencing an anomaly.

[0217] In some embodiments, the service message identifier continuity detection is used to detect whether the identifiers of consecutively received service messages are continuous. It is understood that if the identifiers of consecutively received service messages are not continuous, it indicates an anomaly in the first transmission path. If the identifiers of consecutively received service messages are continuous, it indicates that the first transmission path is not abnormal. For example, if the identifier of the previously received service message is 5, but the identifier of the currently received service message is not 6, then the identifiers are not continuous.

[0218] It is worth noting that in other embodiments, other methods may be used to detect anomalies in the first transmission path, and this application does not limit this method.

[0219] S902. In response to an anomaly in the first transmission path, the second device stops receiving service messages transmitted on the first transmission path.

[0220] In some embodiments, in response to an anomaly in the first transmission path, the second device shuts down the receiving port of the first transmission path to stop receiving service packets transmitted on the first transmission path.

[0221] The above-described S901 to S902 process of triggering path switching through anomaly detection has been explained. In other embodiments, the second device, in response to the switching command of the first transmission path, stops receiving service packets transmitted on the first transmission path. The switching command can be a manually issued switching command, such as in network maintenance or network testing scenarios where switching can be manually controlled.

[0222] S903. The second device receives service messages transmitted on the second transmission path of at least two transmission paths based on the identifier.

[0223] The second transmission path is one of at least two transmission paths other than the first transmission path.

[0224] For example, the second transmission path can be any one of the at least two transmission paths other than the first transmission path. Alternatively, the second transmission path can also be any one of the at least two transmission paths other than the first transmission path that meets the switching requirements, such as bandwidth requirements, latency requirements, etc.

[0225] In some embodiments, the second device switches from the first transmission path to the second transmission path to receive service messages transmitted on the second transmission path, which is one of at least two transmission paths, based on an identifier.

[0226] For example, taking the second device as an OTN device, the process of completing S901 to S903 based on the OTN device can be as follows: The OTN device's line board performs anomaly detection on the first transmission path. In response to an anomaly in the first transmission path, the OTN device's line board reports an anomaly notification to the OTN device's main control board. Upon determining that the first transmission path is abnormal, the OTN device's main control board issues a switching command to the OTN device's cross-connect board. Then, in response to the switching command, the OTN device's cross-connect board connects the OTN device's output to the second transmission path, thereby receiving service packets transmitted on the second transmission path.

[0227] For example, Figure 10 is a schematic diagram of a fault detection-triggered switching based on an embodiment of this application. Referring to (10-1) in Figure 10, taking the working path as an example to refer to the first transmission path and the protection path as an example to refer to the second transmission path, and taking the sequence number as an identifier, service messages with sequence numbers 1 to 8 as shown in Figure 10 can be transmitted on the two transmission paths respectively. When a fault occurs in the optical fiber link of the working path, switching can be triggered. If no service messages are received for a long time, it is considered that a fault exists, and the system switches to the protection path to receive service messages.

[0228] Referring to Figure 10(10-2), fault detection of the fiber optic link is used to determine whether a failover is required for the working path. If a fault exists in the fiber optic link, it indicates an anomaly in the working path, and a failover is determined to be necessary. In the case of a failover, the receiving port of the working path is shut down to stop receiving service packets transmitted on the working path, and the system switches to the protection path to receive service packets transmitted on the protection path. If no fault exists in the fiber optic link, it indicates that the working path is not abnormal, and a failover is not required. In the case of no failover, receiving service packets transmitted on the working path continues.

[0229] For example, Figure 11 is a schematic diagram of a switching triggered by identifier continuity detection according to an embodiment of this application. Referring to (11-1) in Figure 11, taking the working path as an example to refer to the first transmission path and the protection path as an example to refer to the second transmission path, and taking the identifier as the sequence number as an example, service packets with sequence numbers 1 to 8 as shown in Figure 11 can be transmitted on the two transmission paths respectively. Among them, a switching can be triggered when the sequence numbers before and after the working path are not continuous. For example, if a service packet is lost (such as 3, 5 or 7), the sequence numbers will be not continuous, and then the system will switch to the protection path to receive service packets.

[0230] Referring to Figure 11(11-2), a continuity check is performed to determine whether out-of-order switching is required on the working path. If the received identifiers are discontinuous, it indicates an anomaly in the working path. In this case, a fault switchover is necessary. The fault switchover process includes: shutting down the receiving port of the working path to stop receiving service packets transmitted on the working path, and switching to the protection path to receive service packets transmitted on the protection path. If the received identifiers are continuous, it indicates that the working path is not abnormal. In this case, no fault switchover is required, and reception of service packets transmitted on the working path continues.

[0231] For example, Figure 12 is a schematic diagram of a path switching principle provided in an embodiment of this application. Referring to Figure 12(12-1), taking the working path as an example to refer to the first transmission path and the protection path as an example to refer to the second transmission path, under normal transmission conditions of the working path, i.e., when no abnormality occurs and no switching is required, the second device is connected to the working path through port 1 (i.e., receiving port 1) to receive service packets transmitted on the working path, such as service packets with sequence numbers 1 to 6. Furthermore, the second device is connected to the protection path through port 2 (i.e., receiving port 2) to receive service packets transmitted on the protection path, such as service packets with sequence numbers 1 to 6. It is understood that service packets with sequence numbers 1 to 6 transmitted on the working path arrive before service packets with sequence numbers 1 to 6 transmitted on the protection path. The output of the second device is connected to port 1 to send service packets transmitted on the working path, such as service packets with sequence numbers 1 to 6 transmitted on the working path, to the second client through the output.

[0232] Referring to Figure 12 (12-2), in the event of an anomaly in the working path requiring a switchover, the exit of the second device can be switched from port 1 to port 2, i.e., from the working path to the protection path. At this time, receiving service packets transmitted on the working path ceases, and service packets transmitted on the protection path are sent to the second client based on the identifier (e.g., sequence number) of the last service packet received on the working path. For example, assuming that during the switch from the working path to the protection path, service packets with sequence numbers 1 to 3 transmitted on the working path have been received, and the sequence number of the last service packet is 3, then service packets with sequence numbers 4 to 6 transmitted on the protection path are sent to the second client. It is understandable that there is a time delay difference ΔT between the service packets with sequence numbers 1 to 3 sent to the second client and the service packets with sequence numbers 4 to 6 sent to the second client; this is due to the larger time delay of the protection path.

[0233] In this embodiment of the application, the reception status of the associated service message is identified. The reception status is used to indicate whether the service message identified is received, such as 1 indicating that it has been received and 0 indicating that it has not been received.

[0234] In some embodiments, for each target service packet received on the second transmission path, if the reception status associated with the identifier of the target service packet indicates that it has not been received, the target service packet is sent to the second client. If the reception status associated with the identifier of the target service packet indicates that it has been received, the target service packet is discarded. It is understood that, based on the reception status associated with the identifier, service packets with duplicate identifiers are discarded, and service packets with non-duplicate identifiers are forwarded following the identifier on the working path.

[0235] In this embodiment of the application, the target service message is the service message received on the second transmission path that is within the sliding window.

[0236] The sliding window is used to indicate the number of packets transmitted in a single transmission. The size of the sliding window is larger than the target size, which is twice the difference in the number of packets transmitted by the two transmission paths within the same time period. Understandably, due to the possibility of flag flipping, the size of the sliding window must be at least twice the difference in the number of packets to ensure that delayed packets can be buffered while maintaining normal transmission.

[0237] For example, Figure 13 is a schematic diagram of the size of a sliding window provided in an embodiment of this application. Taking a sliding window size of 1 times the difference in the number of messages as an example, the reception status associated with the identifier of the service message received by the sliding window in one transmission can be seen in Figure 13(13-1). Here, taking the initial value of the identifier as SN0 as an example, and the maximum value of the identifier as SN... max For example, at the same time, it is very likely that the protection path receives the service message of SN0, and the working path receives the service message of SN0. max Business messages, due to SN max If we need to add 1 and flip the packet starting from SN0, there will be two received SN0s at the same time. Due to the duplicate SN0, the packet will be discarded by mistake, resulting in out-of-order packets.

[0238] Taking a sliding window size that is twice the difference in the number of messages as an example, the reception status associated with the identifier of the service message received by the sliding window in one transmission can be seen in Figure 13 (13-2). At the same time, the protection path may receive the SN0 service message, and the working path may receive the SN... max Business messages, due to SN maxAdding 1 and flipping the sequence number from SN0 will result in two received SN0s occurring simultaneously. This duplicate SN0 will cause packets to be mistakenly dropped, leading to out-of-order delivery. Understandably, for service packets transmitted on the protection path, the minimum sequence number of the service packets received within the sliding window is SN0, and the maximum is SN... max / 2. For service packets transmitted on the working path, the minimum sequence number of the service packets received within the sliding window is SN0, and the maximum sequence number is SN. max .

[0239] Therefore, based on Figure 13 above, when the sliding window size is set to 1 or 2 times the difference in the number of messages, there will be duplicate identifiers for long and short paths, leading to the erroneous discarding of messages and resulting in out-of-order messages. Therefore, the sliding window size needs to be at least twice the difference in the number of messages to ensure the normal reception of service messages and thus prevent out-of-order messages.

[0240] For example, Figure 14 is a schematic diagram of a process for processing service packets based on a sliding window according to an embodiment of this application. Referring to Figure 14, firstly, service packets are received based on a sliding window. Specifically, for each newly received service packet within the sliding window, the reception status associated with its identifier is determined. If the reception status associated with the identifier of the service packet indicates that it has not been received, it is forwarded, such as updating the reception status of the service packet and sending the service packet to a second client. If the reception status associated with the identifier of the service packet indicates that it has been received, it is discarded, i.e., the service packet is dropped.

[0241] Furthermore, for received service packets outside the sliding window, their reception status needs to be promptly deleted. The corresponding process can be as follows: Each time the second device receives a target service packet based on the sliding window, in response to the target service packet's identifier being greater than all identifiers within the sliding window, the sliding window is moved to the position corresponding to the target service packet. Then, each time the sliding window is moved, the reception status of received service packets outside the sliding window is deleted. Alternatively, in response to the sliding window being moved a preset number of times, the reception status of received service packets outside the sliding window is deleted. In this way, by deleting the reception status of received service packets outside the sliding window, the reception status of service packets can be updated promptly, avoiding packet loss or duplication due to incorrect reception status, which could lead to out-of-order packets.

[0242] In the above embodiments, this application provides a path switching method. Since the identifier of a service packet can indicate the transmission order of the service packet among multiple service packets of the same service, the service packets transmitted on the second transmission path are selectively processed according to the identifier of the service packet (e.g., discarding when the identifier is duplicated or forwarding when the identifier is not duplicated). In this way, the problem of out-of-order packets due to packet loss or duplication can be avoided, and the reliability of packet transmission can be improved.

[0243] Furthermore, when the first transmission path returns to normal, it can be switched back to the first transmission path from the second transmission path. For example, Figure 15 is a flowchart illustrating a path switching process performed upon restoration to normal operation according to an embodiment of this application. Referring to Figure 15, the method includes the following steps S1501 to S1504.

[0244] S1501, the second device responds to the restoration of normal operation of the first transmission path by receiving and buffering the service messages transmitted on the first transmission path.

[0245] Whether the first transmission path has returned to normal can be determined based on whether the identifiers of the received service packets are continuous over a period of time. Understandably, if the identifiers of the received service packets are continuous over a period of time, it indicates that the working path has returned to normal. If the identifiers of the received service packets are discontinuous over a period of time, it indicates that the working path has not returned to normal.

[0246] In some embodiments, in response to the first transmission path returning to normal, the second device opens the receiving port of the first transmission path to receive and buffer the service packets transmitted on the first transmission path.

[0247] It is worth noting that at this point, only the service packets transmitted on the first transmission path are cached, and these service packets are not sent to the second client. This is understandable, considering that the first transmission path, with its low latency, has a faster reception rate, while the second transmission path, with its high latency, has a slower reception rate; therefore, it is necessary to cache and wait for the service packets transmitted on the second transmission path.

[0248] S1502. After a preset time period starting from the moment when the first transmission path returns to normal, the second device determines that the identifier of the currently received service message on the second transmission path is concatenated with the identifier of the cached first service message.

[0249] The preset duration is the delay difference between the first and second transmission paths. This delay difference can be understood as the actual delay difference during transmission. "Connection" refers to ensuring that consecutive identifiers are continuous, without interruptions or skips, thus guaranteeing that service messages are not out of order.

[0250] In some embodiments, the second device may be equipped with a timer. The above-described S1502 can be implemented based on a timer, and the corresponding process may be: the second device starts the timer in response to the first transmission path returning to normal. Then, after the timer's duration reaches the preset duration, it is determined that the identifier of the currently received service packet on the second transmission path is concatenated with the identifier of the cached first service packet.

[0251] S1503, the second device responds to the fact that the identifier of the currently received service message on the second transmission path is concatenated with the identifier of the cached first service message, and the currently received concatenated service message has been sent to the second client, and stops receiving service messages transmitted on the second transmission path.

[0252] S1504, The second device sends cached service messages to the second client.

[0253] For example, Figure 16 is a schematic diagram of the principle of performing path switching when the system returns to normal, according to an embodiment of this application. Referring to Figure 16, taking the working path as an example to refer to the first transmission path and the protection path as an example to refer to the second transmission path, the second device is connected to the working path through port 1 (i.e., receiving port 1) and connected to the protection path through port 2 (i.e., receiving port 2).

[0254] Once the working path returns to normal, first close the working path's exit point, such as by controlling the connection or disconnection between the exit point and the buffer via a switch, to stop sending service packets transmitted on the working path to the second client. Then, open port 1 to receive service packets transmitted on the working path. At this time, buffer the service packets transmitted on the working path; for example, the buffered service packets could be service packets with sequence numbers 6 to 10 as shown in Figure 16. Simultaneously, receive the service packets transmitted on the protection path and send the service packets transmitted on the protection path to the second client, such as service packets with sequence numbers 4 and 5 as shown in Figure 16. It can be seen that the service packet with sequence number 5 is followed by the first buffered service packet with sequence number 6. After sending service packets with sequence numbers 4 and 5 to the second client, connect the exit point and the buffer to open the working path's exit point, and then send the buffered service packets to the second client in sequence.

[0255] Figure 17 is a schematic diagram of another path switching process provided by an embodiment of this application when the system returns to normal. Referring to Figure 17, taking the working path as an example to refer to the first transmission path and the protection path as an example to refer to the second transmission path, path switching is performed when the working path returns to normal, and when the working path has not returned to normal, the working path is continuously detected. The path switching process may include: closing the exit of the working path to stop sending service packets transmitted on the working path to the second client; opening the receiving port of the working path to receive service packets transmitted on the working path; receiving service packets based on a sliding window, such as receiving service packets transmitted on the working path and protection path by moving the sliding window; for each service packet (i.e., the target service packet) received within the sliding window, determining the reception status of the service packet; if the reception status of the service packet indicates that it has been received, discarding the service packet; if the reception status of the service packet indicates that it has not been received, updating the reception status of the service packet (e.g., updating it to received) and buffering the service packet; starting a timer; and determining whether the timer's duration is equal to the delay difference. If the timer's duration is not equal to the delay difference, continue timing and check if the timer's duration equals the delay difference. If the timer's duration equals the delay difference, check if the service message for the protection path has been sent. If the service message for the protection path has not been sent, continue checking if the service message for the protection path has been sent. If the service message for the protection path has been sent, open the exit point of the working path to forward the cached service message to the second client.

[0256] In the above embodiments, when the first transmission path returns to normal, the continuity of the identifier is ensured by determining whether the identifier of the currently received service message on the second transmission path is consecutive with the identifier of the cached first service message, and whether the currently received service message has been sent to the second client. This avoids the problem of message out-of-order delivery due to packet loss or duplication, and improves the reliability of message transmission.

[0257] It should be noted that the above description is for the purpose of more clearly explaining the message transmission method described in the embodiments of this application, and should not be construed as a limitation on the specific implementation of this application.

[0258] The above mainly describes the solutions provided by the embodiments of this application from the perspective of processing flow. Correspondingly, the embodiments of this application also provide a message transmission device for implementing the various methods described above. This message transmission device can be one of the methods described above, or include the aforementioned devices, or be a usable component. It is understood that, in order to achieve the above functions, the message transmission device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0259] This application embodiment can divide the message transmission device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be understood that the module division in this application embodiment is illustrative and is only a logical functional division. In actual implementation, there may be other division methods.

[0260] For example, Figure 18 is a schematic diagram of a message transmission device provided in an embodiment of this application. Referring to Figure 18, the message transmission device includes a receiving module 1801 and a sending module 1802. Wherein:

[0261] The receiving module 1801 is used to execute S601 shown in Figure 6 above;

[0262] The sending module 1802 is used to execute S602 shown in Figure 6 above.

[0263] For example, Figure 19 is a schematic diagram of another message transmission device provided in an embodiment of this application. Referring to Figure 19, the message transmission device includes a receiving module 1901 and a sending module 1902. Wherein:

[0264] The receiving module 1901 is used to execute S603 shown in Figure 6 above.

[0265] The sending module 1902 is used to execute S604 shown in Figure 6 above.

[0266] In some possible implementations, the device further includes an anomaly detection module for performing S901 to S903 as shown in FIG9 above.

[0267] In some possible implementations, the device further includes a recovery detection module for performing S1501 to S1504 as shown in FIG15 above.

[0268] For a detailed description of the above-mentioned optional methods, please refer to the foregoing method embodiments, which will not be repeated here. Furthermore, the explanation of any of the message transmission devices provided above and the description of their beneficial effects can be found in the corresponding method embodiments described above, which will not be repeated here.

[0269] As an example, referring to Figure 5, some or all of the functions implemented in the receiving module 1801 and sending module 1802 in the message transmission device shown in Figure 18 or the receiving module 1901 and sending module 1902 in the message transmission device shown in Figure 19 can be implemented by the OTN device in Figure 5 executing computer execution instructions.

[0270] In this embodiment, the message transmission device is presented as an integrated unit divided into functional modules. Here, "module" can refer to a specific ASIC, circuitry, a processor and memory executing one or more software or firmware programs, integrated logic circuitry, and / or other devices that can provide the aforementioned functions. In a simplified embodiment, those skilled in the art will recognize that the message transmission device can take the form of the OTN device shown in Figure 5.

[0271] Since the message transmission device provided in this application embodiment can execute the above message transmission method, the technical effects it can obtain can be referred to the above method embodiment, and will not be repeated here.

[0272] It should be understood that one or more of the above modules or units can be implemented by software, hardware, or a combination of both. When any of the above modules or units are implemented by software, the software exists as computer program instructions and is stored in memory. The processor can be used to execute the program instructions and implement the above method flow. The processor can be built into a SoC (System-on-a-Chip) or ASIC, or it can be a separate semiconductor chip. In addition to the core that executes software instructions for computation or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), PLDs (Programmable Logic Devices), or logic circuits that implement dedicated logic operations.

[0273] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a microprocessor, digital signal processing (DSP) chip, microcontroller unit (MCU), artificial intelligence processor, ASIC, SoC, FPGA, PLD, application-specific digital circuit, hardware accelerator, or non-integrated discrete device, which can run the necessary software or perform the above method flow independently of software.

[0274] Optionally, embodiments of this application also provide a first device (e.g., the first device may be a chip or a chip system), the first device including a processor for implementing the method executed by the first device in any of the above method embodiments. In one possible design, the first device further includes a memory. The memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the first device to execute the method in any of the above method embodiments. Of course, the memory may not be included in the first device. When the first device is a chip system, it may be composed of chips or may include chips and other discrete devices; embodiments of this application do not specifically limit this.

[0275] Optionally, embodiments of this application also provide a second device (e.g., the second device may be a chip or a chip system), the second device including a processor for implementing the method executed by the second device in any of the above method embodiments. In one possible design, the second device further includes a memory. The memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the second device to execute the method in any of the above method embodiments. Of course, the memory may not be included in the second device. When the second device is a chip system, it may be composed of chips or may include chips and other discrete devices; embodiments of this application do not specifically limit this.

[0276] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed on a first device, the first device performs the method executed by any of the message transmission devices provided above. When the computer-executable instructions are executed on a second device, the second device performs the method executed by any of the message transmission devices provided above.

[0277] For explanations of the relevant content and descriptions of the beneficial effects in any of the computer-readable storage media provided above, please refer to the corresponding embodiments described above, which will not be repeated here.

[0278] This application also provides a chip. This chip integrates a control circuit for implementing the functions of the aforementioned message transmission device and one or more ports. Optionally, the functions supported by this chip can be referred to above, and will not be repeated here. Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium. The aforementioned storage medium can be a read-only memory, random access memory, etc. The aforementioned processing unit or processor can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.

[0279] This application also provides a computer program product containing computer-executable instructions. When the computer-executable instructions are executed on a first device, the first device performs any of the methods described in the above embodiments. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on the first device, all or part of the flow or function according to the embodiments of this application is generated. The first device may be a network device or other programmable device. When the computer-executable instructions are executed on a second device, the second device performs any of the methods described in the above embodiments. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on the second device, all or part of the flow or function according to the embodiments of this application is generated. The second device may be a network device or other programmable device.

[0280] Computer-executable instructions can be stored in or transmitted from one computer-readable storage medium to another. For example, computer-executable instructions can be transmitted from one website, computer, network device, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium accessible to a network device or a data storage device that includes one or more network devices, data centers, etc., that can be integrated with media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0281] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of this application, such as but not limited to the memory, computer-readable storage medium and communication chip, are all non-transitory.

[0282] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product.

[0283] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0284] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A message transmission method, characterized in that, Applied to a first device, the method includes: Receive business messages from the client; On at least two transmission paths, service messages with added identifiers are sent to the second device, the identifiers being used to indicate the transmission order of the service messages among multiple service messages of the same service.

2. The method according to claim 1, characterized in that, The first identifier added to the first service message among the plurality of service messages is an initial value; The second identifier added to the second service message following the first service message is a value obtained by accumulating the initial value by a step size, and the maximum value of the second identifier is equal to 2. N -1, where N is a positive integer greater than 16.

3. The method according to claim 2, characterized in that, The N is 24, 32, 40, or 48.

4. The method according to claim 2 or 3, characterized in that, The maximum value of the second identifier is related to the difference in the number of messages transmitted by the at least two transmission paths within the same time period.

5. The method according to claim 4, characterized in that, The maximum value of the second identifier is greater than or equal to the difference in the number of messages transmitted by the at least two transmission paths within the same time period; The process of determining the difference in the number of messages transmitted between two transmission paths within the same time period includes: Based on the message transmission rate, the delay difference between the two transmission paths, the message length of the service message, the preamble length of the service message, the frame interval length of the service message, and the following formula, the difference in the number of messages transmitted by the two transmission paths in the same time period is determined. In the formula, Δw represents the difference in the number of messages transmitted by the two transmission paths within the same time period; v represents the message transmission rate; Δt represents the delay difference between the two transmission paths; l1 represents the message length of the service message; l2 represents the preamble length of the service message; and l3 represents the frame interval length of the service message.

6. The method according to claim 5, characterized in that, The process of determining N includes: The N is determined based on the difference in the number of messages and the following formula; N = CEILING(LOG(4*Δw,2),1) In the formula, LOG(4*Δw,2) represents the logarithm of 4*Δw with base 2; CEILING represents rounding up with base 1.

7. The method according to any one of claims 1-6, characterized in that, The identifier is added to the target field of the service message.

8. The method according to claim 7, characterized in that, The target field occupies 3, 4, 5, or 6 bytes.

9. A message transmission method, characterized in that, Applied to a second device, the method includes: The device receives service packets sent by a first device on at least two transmission paths, wherein the service packets include an identifier, the identifier being used to indicate the transmission order of the service packets among multiple service packets of the same service; Based on the identifier, the service message transmitted on the first transmission path of the at least two transmission paths is sent to the client.

10. The method according to claim 9, characterized in that, The first transmission path is the transmission path with the shorter latency among the at least two transmission paths; The delay of the at least two transmission paths is determined based on the time when service messages carrying the same identifier are received on the at least two transmission paths.

11. The method according to claim 9 or 10, characterized in that, The method further includes: In response to an abnormality or switchover command in the first transmission path, stop receiving service packets transmitted on the first transmission path; Based on the identifier, a service message transmitted on the second transmission path of the at least two transmission paths is received, wherein the second transmission path is one of the at least two transmission paths other than the first transmission path.

12. The method according to claim 11, characterized in that, The method further includes: Anomaly detection is performed on the first transmission path, and the anomaly detection includes at least one of fiber optic link fault detection and service packet identification continuity detection.

13. The method according to claim 11 or 12, characterized in that, The method further includes: In response to the first transmission path returning to normal, the service packets transmitted on the first transmission path are received and buffered. In response to the fact that the identifier of the currently received service message on the second transmission path is concatenated with the identifier of the first cached service message, and the currently received concatenated service message has been sent to the client, the reception of service messages transmitted on the second transmission path is stopped. Send cached business messages to the client.

14. The method according to claim 13, characterized in that, In response to the first transmission path returning to normal, the method further includes: After a preset time period starting from the moment the first transmission path returns to normal, the identifier of the currently received service packet on the second transmission path is determined to be contiguous with the identifier of the first cached service packet, where the preset time period is the delay difference between the first transmission path and the second transmission path.

15. The method according to any one of claims 11-14, characterized in that, The reception status of the service message associated with the identifier is used to indicate whether the service message associated with the identifier has been received. For each target service message received on the second transmission path, the method further includes: If the reception status indication associated with the identifier of the target service message is not received, the target service message is sent to the client. or, If the reception status associated with the identifier of the target service message indicates that it has been received, the target service message is discarded.

16. The method according to claim 15, characterized in that, The target service message is a service message received on the second transmission path that is within a sliding window; The sliding window is used to indicate the number of messages transmitted in one transmission; the size of the sliding window is larger than the target size, which is twice the difference in the number of messages transmitted by the at least two transmission paths in the same time period.

17. The method according to claim 16, characterized in that, The method further includes: For each target service message received based on the sliding window, in response to the target service message's identifier being greater than all identifiers within the sliding window, the sliding window is moved to the position corresponding to the target service message; Each time the sliding window is moved, the reception status of received service packets outside the sliding window is deleted; or, in response to the sliding window moving a preset number of times, the reception status of received service packets outside the sliding window is deleted.

18. The method according to any one of claims 9-17, characterized in that, The first identifier added to the first service message among the plurality of service messages is an initial value; The second identifier added to the second service message following the first service message is a value obtained by accumulating the initial value by a step size, and the maximum value of the second identifier is equal to 2. N -1, where N is a positive integer greater than 16.

19. The method according to claim 18, characterized in that, The N is 24, 32, 40, or 48.

20. The method according to claim 18 or 19, characterized in that, The maximum value of the second identifier is related to the difference in the number of messages transmitted by the at least two transmission paths within the same time period.

21. The method according to claim 20, characterized in that, The maximum value of the second identifier is greater than or equal to the difference in the number of messages transmitted by the at least two transmission paths within the same time period; The process of determining the difference in the number of messages transmitted between two transmission paths within the same time period includes: Based on the message transmission rate, the delay difference between the two transmission paths, the message length of the service message, the preamble length of the service message, the frame interval length of the service message, and the following formula, the difference in the number of messages transmitted by the two transmission paths in the same time period is determined. In the formula, Δw represents the difference in the number of messages transmitted by the two transmission paths within the same time period; v represents the message transmission rate; Δt represents the delay difference between the two transmission paths; l1 represents the message length of the service message; l2 represents the preamble length of the service message; and l3 represents the frame interval length of the service message.

22. The method according to claim 21, characterized in that, The process of determining N includes: The N is determined based on the difference in the number of messages and the following formula; N = CEILING(LOG(4*Δw,2),1) In the formula, LOG(4*Δw,2) represents the logarithm of 4*Δw with base 2; CEILING represents rounding up with base 1.

23. The method according to any one of claims 9-22, characterized in that, The identifier is included in the target field of the service message.

24. The method according to claim 23, characterized in that, The target field occupies 3, 4, 5, or 6 bytes.

25. A message transmission device, characterized in that, Applied to a first device, the device includes: The receiving module is used to receive service messages from the client; The sending module is used to send service messages with added identifiers to the second device on at least two transmission paths, wherein the identifiers are used to indicate the transmission order of the service messages in multiple service messages of the same service.

26. A message transmission device, characterized in that, Applied to a second device, the device includes: A receiving module is configured to receive service packets sent by a first device on at least two transmission paths, wherein the service packets include an identifier, the identifier being used to indicate the transmission order of the service packets among multiple service packets of the same service. The sending module is used to send, based on the identifier, a service message transmitted on the first transmission path of the at least two transmission paths to the client.

27. A first device, characterized in that, The method includes a memory and a processor, the memory and the processor being connected; the memory is used to store computer-executed instructions; the processor is used to invoke the computer-executed instructions to perform the method as described in any one of claims 1-8.

28. A second device, characterized in that, The method includes a memory and a processor, the memory and the processor being connected; the memory is used to store computer-executed instructions; the processor is used to invoke the computer-executed instructions to perform the method as described in any one of claims 9-24.

29. A message transmission system, characterized in that, It includes the first device as described in claim 27 and the second device as described in claim 28.

30. A chip, characterized in that, It includes a processor and an interface circuit; the interface circuit is used to receive computer execution instructions and transmit them to the processor; the processor is used to run the computer execution instructions to perform the method as described in any one of claims 1-8 or 9-24.

31. A computer program product, characterized in that, The method includes computer execution instructions that, when executed on a first device, cause the first device to perform the method as described in any one of claims 1-8, and when executed on a second device, cause the second device to perform the method as described in any one of claims 9-24.