Packet processing method, electronic device, storage medium, and computer program product
By carrying a periodic label in the message and combining it with the forwarding sub-period offset, the target period of the message is adjusted, which solves the problem of message transmission delay jitter in asynchronous networks, realizes end-to-end transmission of deterministic services, and meets more stringent latency and jitter requirements.
Patent Information
- Application Number
- PCT/CN2025/092055
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-21
- Filing Date
- 2025-04-29
- Publication Date
- 2025-12-26
AI Technical Summary
In asynchronous frequency networks, existing technologies cannot guarantee message transmission delay jitter, especially in cross-regional service transmission. CSQF technology cannot adapt to network systems with large physical ranges, resulting in message transmission delay jitter failing to meet deterministic requirements.
By carrying a periodic label in the message and combining it with the forwarding sub-period offset, the target period of the message is adjusted to enable the transmission of deterministic services in asynchronous networks.
It reduces message latency and jitter in asynchronous networks, enabling end-to-end transmission of deterministic services in asynchronous frequency networks and meeting stricter latency and jitter requirements.
Smart Images

Figure CN2025092055_26122025_PF_FP_ABST
Abstract
Description
Message processing methods, electronic devices, storage media, and computer program products
[0001] Cross-reference to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 202410813191.7, filed on June 21, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of communication technology, and in particular to a message processing method, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0004] The Internet Engineering Task Force (IETF) has released Deterministic Networking (DetNet), which uses Cyclic Specified Queuing and Forwarding (CSQF) to meet the transmission requirements of deterministic services in long-distance physical scenarios in wide-area deterministic networks. The CSQF technology applied to deterministic networks requires all devices in the network to maintain frequency synchronization. When deterministic services traverse asynchronous frequency networks, the latency jitter of message transmission cannot be guaranteed. Summary of the Invention
[0005] This application provides a message processing method, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] According to a first aspect of this application, one embodiment provides a message processing method, the method comprising: receiving a message from a first network, wherein the message carries a period tag, the period tag being configured to indicate a forwarding period and a forwarding sub-period corresponding to the message, the forwarding sub-period being located within the forwarding period; determining a target period corresponding to the message based on a forwarding sub-period offset of a second network relative to the first network, the forwarding period and the forwarding sub-period corresponding to the message; and sending the message in the target period.
[0007] According to a second aspect of this application, another embodiment provides an electronic device, including: one or more processors; and a memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the message processing method as described in the first aspect above.
[0008] According to a third aspect of this application, another embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the message processing method described in the first aspect above.
[0009] According to a fourth aspect of this application, yet another embodiment provides a computer program product including a computer program that, when executed by a processor, implements the message processing method described in the first aspect above. Attached Figure Description
[0010] Figure 1 is a schematic diagram of the process of Ethernet devices using store-and-forward mode to process packets in related technologies;
[0011] Figure 2 is a schematic diagram of the process of transmitting messages using CQF in TSN technology in related technologies;
[0012] Figure 3 is a schematic diagram of how time period tags are carried in messages in related technologies;
[0013] Figure 4 is a schematic diagram of the CSQF message transmission process in related technologies;
[0014] Figure 5 is a schematic diagram of the periodic tag correspondence of messages between devices in related technologies;
[0015] Figure 6 is a schematic diagram of how periodic tags are carried in messages in related technologies;
[0016] Figure 7 is a schematic diagram of how forwarding cycles and forwarding sub-cycles are carried in the cycle tag in related technologies;
[0017] Figure 8 is a schematic diagram of the structure of a local network in a related technology;
[0018] Figure 9 is a schematic diagram of the structure of another local network in the related technology;
[0019] Figure 10 is a schematic diagram of a message forwarding process in related technologies;
[0020] Figure 11 is a schematic diagram of another message forwarding process in related technologies;
[0021] Figure 12 is a schematic diagram of the implementation environment of a message processing method provided in an embodiment of this application;
[0022] Figure 13 is a schematic flowchart of a message processing method provided in an embodiment of this application;
[0023] Figure 14 is a schematic diagram of a message forwarding process provided in an embodiment of this application;
[0024] Figure 15 is a schematic diagram of a message forwarding process provided in another embodiment of this application;
[0025] Figure 16 is a schematic diagram of the device structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] It should be understood that in the description of the embodiments of this application, the use of terms such as "first" and "second" is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or implicitly indicating the order of the technical features indicated. "At least one" refers to one or more, and "more" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any group of these items, including any group of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0028] Furthermore, the technical features involved in the various embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0029] To facilitate understanding of the solutions in the embodiments of this application, and to ensure that the descriptions of the following embodiments are clear and concise, a brief introduction to the relevant technologies is given first:
[0030] Communication networks are the highways of the information age. Customer demands drive changes in communication networks. Traditional Ethernet technology, based on a best-effort approach, cannot guarantee the transmission latency and jitter of customer information. With the widespread use of Ethernet technology in industry and vehicles, high demands are placed on the quality of information transmission, requiring transmission latency and jitter to meet certain specified parameters. The Internet Engineering Task Force (IETF) has released Deterministic Networking (DetNet), which uses a Cyclic Specified Queuing and Forwarding (CSQF) mechanism to meet the transmission requirements of deterministic services in long-distance physical scenarios within wide-area deterministic networks. The CSQF technology applied to wide-area deterministic networks uses a time period T (T is a configuration result, typically between 10-100µs) to forward customer packets. A customer packet is forwarded within one period T, and the jitter value caused by the packet's forwarding is less than T (the end-to-end jitter on the network is less than twice T). CSQF technology applied to deterministic networks requires all devices in the network to maintain frequency synchronization. When a device in the service transmission route cannot support frequency synchronization, the delay jitter of message transmission cannot be guaranteed.
[0031] Therefore, how to reduce message transmission latency jitter is a major problem currently facing the industry.
[0032] Figure 1 illustrates how traditional Ethernet devices process packets using a store-and-forward model. Within the device, packets undergo multiple functional modules, including table lookup, parsing, rate limiting, queuing, buffering, and scheduling. These modules are shared across all physical ports, resulting in an uncertain timeframe for each physical port to receive these services. This varying processing time leads to unpredictable latency within each device. With the widespread adoption of Ethernet in industrial production lines and vehicles, high demands are placed on the quality of packet transmission, and packet latency and jitter cannot meet certain performance parameters. In some network systems, such as automated production line networks in industrial parks and in-vehicle communication networks, Ethernet is replacing proprietary fieldbus technologies because it supports higher data rates, lower costs, and easier integration with existing Ethernet systems. However, traditional Ethernet technology, based on a best-effort approach, cannot guarantee the boundaryd end-to-end latency, jitter, and zero packet loss characteristics required for specific application scenarios. To address the latency jitter issue in Ethernet forwarding of customer packets, several technologies exist to achieve deterministic forwarding of customer services: Time-Sensitive Networking (TSN) and Cyclic Specified Queuing and Forwarding (CSQF). Each technology is suited to different application scenarios.
[0033] TSN technology is applied in local area networks (LANs) by configuring a global scheduling schedule and using fixed time slices to schedule and forward client packets, achieving deterministic latency jitter requirements. All network devices in a LAN are located within a small physical area, and the link propagation delay between devices is negligible. Time-sensitive networks require time synchronization between all devices on the network, with upstream and downstream devices working synchronously. When a packet is sent from an upstream device, the downstream device receives the packet at the same time, and upstream and downstream devices send and receive client packets at the same time. TSN technology uses a Cyclic Queuing and Forwarding (CQF) mechanism to achieve deterministic latency forwarding of client services, as shown in Figure 2. Two queues are set at the output port of each device (Queue 1 and Queue 2 in Figure 2). Each queue has an inbound and outbound control gate (labeled as inbound gate and outbound gate), with two states: "open" (labeled "open") and "closed" (labeled "close"). When the gate is open, packet input or output is allowed; when the gate is closed, packet input or output is prohibited. The gating states of the inbound and outbound control gates within the same queue are always mutually exclusive. When the inbound control gate of a queue is open, the outbound control gate of that queue is closed; conversely, when the inbound control gate of a queue is closed, the outbound control gate of that queue is open. Ports are configured with two queues. At any given time, one queue is used for receiving packets, and the other for sending packets. Therefore, the control gates of the same type of port (e.g., the output port of a queue) in both queues are also mutually exclusive. When the control gate of a port (e.g., the output port) in one queue is open, the control gate of the same type of port in the other queue is closed. At any given time, only one queue's control gate is open in the same location port, allowing packet output; the other queue's control gate is closed, disallowing output. The circular queuing forwarding mechanism divides the transmission time into a series of equal time intervals (or time slices), each time interval called a time period T. All time periods T are further divided into even periods and odd periods, identified by T0 and T1. The network system pre-plans the state (open or closed) of each control gate in each time period. Within a cycle, the state of the control gate remains unchanged. When the time cycle ends, the control gate that was previously open switches to the closed state, and that queue stops outputting message information. The control gate of the other queue then opens, and the other queue begins outputting message information. By alternately performing enqueue and dequeue operations between the two queues, CQF can ensure that data packets sent from the upstream node device within a cycle are sent to the downstream node within the same time cycle. The downstream node device receives the data within the same time cycle and then forwards it out within the same time cycle.When all devices on the network start using CQF queues, all devices synchronize their times, and all control gates on all devices pre-plan their operating states and switch their operating states simultaneously, packets are forwarded starting from the first device on the network. All packets forwarded within the same period are output within a fixed time period T on each device, with a delay of one time period T on each device, until the last device outputs the packet. The end-to-end delay of a packet on the network depends only on the period size T and the number of devices H the packet passes through. Since all packets within the same period are forwarded within the same period, packets within the same period in the source device are output in the same period in the destination device. A packet can fluctuate at any position within the same time period T, with the first position being the beginning of a period T and the last position being the end of a period T. When a packet is forwarded at the beginning of the time period on the source device but only at the end of the time period T in the destination device, the total forwarding delay in the network is the maximum, with a maximum delay of (H+1)*T. When a message is forwarded at the end of the time period in the source device and at the beginning of the time period T in the destination device, the total forwarding delay of the message on the network is minimized, with a minimum delay of (H-1)*T. In this case, the total end-to-end forwarding delay of the message from the source device to the destination device in the entire network fluctuates within the range of {(H-1)*T, (H+1)*T}. Thus, CQF technology in a local area network can provide deterministic delay forwarding, thereby ensuring the bounded delay jitter requirements when client messages are forwarded and transmitted in the network.
[0034] The Cyclic Queuing Forwarding (CQF) method requires time synchronization across all devices on the network, with all devices switching control gate states simultaneously, and negligible transmission delay between devices. Therefore, CQF is only suitable for local area networks (LANs) with a small physical area. When devices are far apart, link delays are significant, and packet latency on the link is close to the cycle, it cannot be guaranteed that packets sent from upstream devices will be received by downstream devices within the same cycle when all devices switch control gates simultaneously. This makes TSN (Traffic Signal-Based Networking) technology unsuitable for deterministic transmission of long-distance, cross-regional services. Because TSN cannot adapt to large-scale network systems, the IETF Deterministic Networking Working Group (DNET) proposed a Cyclic Queuing Forwarding (CSQF) mechanism with a specified cycle. This relaxes the constraints of time synchronization between devices and negligible fiber optic transmission delay, extending the TSN forwarding mechanism to wide-area deterministic networks. CSQF does not require time synchronization across all devices on the network; it only requires clock frequencies between devices. Devices only need to recover the service clock signal when receiving services and track the clock frequency of the other device. The CSQF forwarding mechanism only requires network-wide clock frequency synchronization, multi-queue cyclic forwarding at output ports, and mapping of periodic labels (or periodic sequence values) between adjacent node output ports. In CSQF technology, all client packets are required to carry a periodic label when sent by the source node device. Packets within a periodic sequence carry the same periodic label, indicating that these packets are received and forwarded together within the same time period. The source node device adds a time periodic label to the client packet when sending it. The time periodic label can be anywhere in the packet, as shown in Figure 3, and is carried in the Layer 3 extended field. Intermediate devices receive and forward packets with the same periodic label within the same period T. Intermediate devices can modify the periodic label, but all packets with the same periodic label before modification will maintain the same periodic label after modification. The CSQF client transmission process is shown in Figure 4. Time synchronization is not required between all devices on the network; only clock frequency synchronization is needed. Each device switches the working state of its queue according to a fixed period, and all devices have the same period size. Although each device operates independently within its own time cycle, and the start and end times of their time cycles differ (all devices have different start and end times), the switching frequency of the time cycle is the same across all devices when the clock frequency is the same. The number of time cycle switches per unit time is the same, resulting in the same switching frequency. Each device has multiple buffer queues. The period tag carried by the message determines which queue a message enters for buffering; messages with the same period tag enter the same queue. All queues are in different states during each cycle, and they alternate between these states. Within any given time cycle, only one queue is in the sending state; the queue in the sending state only sends messages and does not receive them.Other queues are in the receiving state; the receiving queue only receives messages and does not send them. All queues operate cyclically according to a periodic time. During any given time period, one queue is in the sending state, while the others are in the receiving state. Before formal operation, all node devices determine the periodic mapping relationship between their respective queues. When a message is forwarded in the source node device, it carries a forwarding periodic tag for each device. This periodic tag marks the designated receiving queue for the message within a specific device. After a message has been forwarded by a device, the used periodic tag is removed. When each device receives a client message, it extracts the periodic tag from the message and places the data packet into the designated receiving queue based on the periodic tag. The message awaits forwarding to the next-hop device when the receiving queue is converted to a sending queue. By pre-loading the designated receiving queue for each hop device, the message is received within the specified queue and forwarded within the specified time period (when the receiving queue becomes a sending queue). The message is forwarded within a fixed period within each device, thus achieving a fixed latency for end-to-end forwarding of client messages.
[0035] When the CSQF (Customer Service Quality Forecasting) mechanism is in operation, the network system pre-plans the packet transmission path, latency, bandwidth, and queue resources based on the service quality requirements of customer services, determines the period parameters, generates a period tag for each node device, and distributes it to the node devices. When a customer service packet is sent from the source device, it carries the period tag on each node. Each node device determines which queue the packet should enter for forwarding based on the period tag. Assuming all node devices on the network have synchronized clock frequencies, all nodes change their time periods identically, their queue states switch at the same speed, and the receive and send states of all queues change at a fixed frequency. Packets are sent from a fixed queue on the upstream node device and enter the corresponding fixed queue on the downstream node. Once the corresponding queue transitions to the send state, the packet is sent out. Regardless of the fiber optic delay between upstream and downstream devices, as long as the forwarding period of the upstream device and the forwarding period relationship of the downstream device are planned in advance, the customer packets forwarded by the upstream device can enter a complete receive queue in the downstream device, and all packets within the forwarding period of the upstream device can be received before the designated receive queue transitions to the send state. Downstream devices have numerous receive queues to accommodate varying latency requirements between upstream and downstream devices. They only need to select an appropriate receive queue to receive forwarded packets from upstream devices, and then forward them after the queue transitions to a sending state. Client packets are forwarded at a fixed sending period in each upstream device, and then forwarded again at the downstream device according to a new fixed forwarding period. Therefore, the total forwarding latency from the first source device to the last destination device is fixed, achieving end-to-end deterministic latency forwarding of client packets from the network source node device to the destination node device. In Figure 4, when the network source node device sends a client packet, it carries the periodicity tag that was forwarded on each device. When each device receives a client packet, it removes the used periodicity tag and uses its own periodicity tag for forwarding. The packet carries the periodicity tags forwarded by all devices on the first device, resulting in low packet carrying efficiency. In reality, all periodicity tags carried by the packet on the first device have the same format and predetermined content, and these periodicity tags have a one-to-one correspondence. If the correspondence between periodic tag 1 and periodic tag 2 is passed to device 2, then the correspondence between periodic tag 2 and periodic tag 3 is passed to device 3, and so on. In this way, when a device sends a client message, it only needs to include its own periodic tag 1. When the message is sent to device 2, device 2 can obtain periodic tag 2 based on the periodic tag 1 carried in the message and the correspondence between periodic tag 1 and periodic tag 2. It can then modify the periodic tag 1 carried in the message to periodic tag 2, thus obtaining the periodic tag 2 of the message on device 2.As shown in Figure 5, the periodic label T0 of the message from device 1 and the periodic label T5 of the message from device 2 are in one-to-one correspondence; the periodic label T1 of the message from device 1 and the periodic label T6 of the message from device 2 are in one-to-one correspondence, and so on. Thus, the first message 100 on device 1 is forwarded on device 1 according to the T0 period, carrying the periodic label T0. When the first message 100 is sent to device 2, device 2, according to the correspondence, modifies the periodic label T0 in the message to T5 and sends it out in the T5 period. Similarly, the periodic label T5 of the message from device 2 and the periodic label T2 of the message from device 2 are in one-to-one correspondence; the periodic label T6 of the message from device 2 and the periodic label T3 of the message from device 3 are in one-to-one correspondence, and so on. Thus, when the first message 100 on device 2 is sent to device 3 according to the T5 period, device 3, according to the correspondence, modifies the periodic label T5 in the message to T2 and sends it out in the T2 period. The second message 200 forwarding process is similar. Regardless of the method used to carry periodic tags, all messages carrying the same time period sequence are forwarded within the same time period, thereby achieving deterministic forwarding of customer messages.
[0036] When using CSQF technology, packet latency fluctuations can only occur within a single forwarding cycle, with the fluctuation range not exceeding the forwarding cycle T. When it's necessary to reduce packet latency fluctuations (jitter), the forwarding cycle T of all devices on the network must be reduced. In many scenarios, some devices on the network have a lower limit to their minimum forwarding cycle T due to forwarding capacity limitations, which still cannot meet the needs of some clients' packets. For example, in Figure 1, the minimum forwarding cycle of devices 1, 2, and 4 can reach 20µs, but the minimum forwarding cycle of device 3 is only 100µs. Therefore, when a packet is forwarded from device 1 to device 4, the minimum forwarding cycle for end-to-end network transmission is only 100µs. If the client's packet requires very low jitter and the forwarding cycle cannot exceed 20µs, the network's capacity cannot meet the requirements. To further reduce end-to-end transmission latency jitter, all devices on the network can set multiple periods of different sizes, with different devices using different period sizes for forwarding. For example, two period values can be set: a large period T1 (e.g., T1 = 80µs) and a small period T2 (e.g., T2 = 10µs). The large period value is an integer multiple of the small period value. A large period (in this embodiment, the large period is also called the forwarding period) is divided into multiple small periods (in this embodiment, the small period is also called the forwarding sub-period). In implementation, intermediate devices on the network all use the large period for forwarding, reducing implementation complexity and forwarding costs. The source and destination devices use the small period, which can achieve a smaller jitter index. Messages using large and small period sequence values carry the large and small period sequence values. The period sequence value consists of multiple sequence values, as shown in Figure 6. The period label includes a high-order part and a low-order part. When a message uses a single large-cycle forwarding service, only a portion of the fields in the cycle label are used; for example, the high-order bits are used during large-cycle forwarding, ignoring the low-order bits. When a message uses a two-level cascaded forwarding service (first large-cycle forwarding, then small-cycle forwarding within a large cycle), the high-order bits are used during large-cycle forwarding, and the low-order bits are used during small-cycle forwarding. When a message uses a single small-cycle forwarding service, all fields in the cycle label are used. In summary:
[0037] 1. Single large cycle forwarding mode: The cycle label uses the {high-order part};
[0038] 2. Large and small cycle serial cascade forwarding mode: The large cycle sequence value uses the {high-order part}, and the single small cycle sequence value uses the {low-order part}.
[0039] 3. Single small cycle forwarding mode: The cycle tag uses {high part, low part}.
[0040] Figure 7 is an example of Figure 6. The large cycle sequence is set to 0, 1, 2, 3, represented by two binary digits (the high-order bits in Figure 6). A large cycle is divided into 8 smaller cycles, with the sequence 0, 1, 2, 3, 4, 5, 6, 7. These smaller cycles are represented by three binary digits (the low-order bits in Figure 6). When operating in a single large cycle forwarding mode, the cycle label uses the 2-bit high-order part. When operating in a cascaded forwarding mode, the large cycle sequence value is forwarded using the 2-bit high-order part, and then the customer service packets within the large cycle are forwarded again according to the smaller cycles, with the smaller cycle sequence value using the 3-bit low-order part. When operating in a single small cycle forwarding mode, the cycle label uses a 5-bit label ({high-order part, low-order part}), with 32 cycle labels ranging from 0 to 31. If a small cycle represents a 10µs time slice, then a large cycle is an 80µs time slice. When operating in a single large-cycle forwarding mode, the 2-bit cycle label represents the sequence of four values: 0, 1, 2, and 3. These four values form one cycle, which is 4 * 80µs = 320µs. When operating in a single small-cycle forwarding mode, the small cycle represents a 10µs time slice, and the 5-bit cycle label represents the sequence of 32 values: 0, 1, 2, ..., 31. These 32 values form one cycle, which is 32 * 10µs = 320µs. When operating in a cascaded forwarding mode with large and small cycles, the previous stage forwards according to the large-cycle sequence value. The 2-bit cycle label represents the sequence of four values: 0, 1, 2, and 3. These four values form one cycle, which is 4 * 80µs = 320µs. Within each large cycle, customer service messages are forwarded a second time according to small cycles. The sequence value of the small cycle uses the sequence value of the three lower bits in the order of 0, 1, 2...7. There are 8 small cycles in a cycle, and a small cycle is 8 * 10us = 80us. There will be 8 small cycle cycles in a large cycle.
[0041] In implementation, network devices choose not to use periodic fields when forwarding packets based on their own characteristics. For example, intermediate devices use large-cycle forwarding, which is a coarse-grained jitter solution that reduces the number of forwarding processing steps or cycle tags, thus reducing complexity and forwarding costs. Source and destination devices use small-cycle forwarding, which can achieve even lower jitter metrics.
[0042] Intermediate devices on the network only focus on the high-order bits of the period label, i.e., the large period value, treating it as the original period label. They ignore but retain the low-order bits, i.e., the sequence value of the small period (or sub-period), and transmit them as the message content. Intermediate devices on the network may modify the large period sequence value of the period label, but will not modify the sub-period sequence value. In Figure 7, forwarding is performed according to the sequence of four large periods, each large period being an 80µs time slice.
[0043] When a message is sent to the destination device, the destination device forwards it according to all period tags, as shown in Figure 7. It forwards messages sequentially according to a sequence of 32 small periods, each small period being a 10µs time slice. Alternatively, the destination device can forward messages by concatenating large and small periods. For example, it can first forward messages sequentially according to a sequence of four large periods, and then forward customer messages within the same large period sequentially according to a sequence of eight small periods. Because the destination device schedules messages according to small periods, the jitter range is limited to variations within those small periods, achieving a lower jitter performance requirement.
[0044] CSQF technology does not require time synchronization across all devices on the network; it only requires clock frequency synchronization between devices to achieve deterministic service delivery. In practical applications, sometimes services need to traverse third-party operator networks. These third-party networks may not provide clock frequency synchronization, making end-to-end forwarding of customer services using CSQF impossible and hindering deterministic service forwarding across a larger physical space. As shown in Figure 8, the deterministic local network X, the intermediate third-party network, and the deterministic local network Y are three independent local networks. Deterministic local networks X and Y are locally synchronized networks, forwarding packets according to the CSQF mechanism, with all devices within each local network having synchronized clock frequencies. However, because the intermediate third-party network does not support clock frequency synchronization, frequency islands are formed between X and Y networks. Clock frequency synchronization between X and Y networks is impossible, and they operate independently according to their respective clock frequencies. Therefore, network X is a locally clock-frequency synchronized network, forwarding packets according to the CSQF mechanism, with all devices within the local network having synchronized clocks at a frequency of fx. All devices forward packets according to the CSQF mechanism with a forwarding period of Tx, for example, Tx = 10µs. The message is sent and output to the last device xn through the local synchronous network X. The maximum jitter of the message after passing through the local network is 2Tx (an inherent characteristic of CSQF technology; the maximum jitter value after passing through the network is twice the period value). The intermediate network is an asynchronous network, such as an OTN network or a local network organized by routers. Service penetration through the intermediate third-party network introduces latency and jitter. Assuming the average latency is L and the maximum jitter is J, the minimum latency of the service is LJ / 2, and the maximum latency is L+J / 2. The service experiences an additional jitter value J after passing through the intermediate network.
[0045] The service is forwarded to local network Y, which is a local clock frequency synchronization network. Packets are forwarded according to the CSQF mechanism. All devices in the local network have synchronized clocks at a frequency of fy. The devices forward packets according to the CSQF mechanism with a forwarding period of Ty, for example, Ty = 10µs. The packet is sent out at the last device yn after passing through local network Y. The maximum jitter added after the packet passes through local network Y is 2Ty.
[0046] The service traverses three networks during end-to-end transmission. Each network generates jitter of 2Tx, J, and 2Ty respectively. The total jitter for the end-to-end transmission is the sum of the jitter from all three networks, with a maximum jitter of 2Tx + J + 2Ty. In practice, although the clock frequencies of network X and network Y are not synchronized, they both meet the Ethernet clock frequency variation range, which is within ±100ppm. We can assume that fx is approximately equal to fy, i.e., Tx is approximately equal to Ty, and both are equal to T. Therefore, the maximum jitter for end-to-end transmission from the first device in network X to the last device in network Y is 2Tx + J + 2Ty = 4T + J. The desired end-to-end jitter for the service is less than 2T, but the actual result differs significantly from the expectation.
[0047] If the clock frequencies of the two synchronization networks X and Y are synchronized, and both use the CSQF mechanism to forward packets at the same period T, although the client packets introduce a delay L and jitter J in the intermediate network, the intermediate network can be assumed to be a virtual path with a delay of L and jitter of J. The last device xn in the previous synchronization network and the first device y1 in the next synchronization network are directly interconnected through the virtual path, and devices xn and y1 are directly interconnected, as shown in Figure 9. In application, the output of xn and the input of device y1 can be directly interconnected with zero delay, and the delay of the virtual path can be attributed to the internal delay of device y1. In this way, the service can be forwarded in the manner of a single local synchronization network. In application, the internal equivalent delay of device y1 = virtual path delay + y1's own delay, and the internal equivalent jitter of device y1 = virtual path jitter + y1's own jitter. Device y1 plans the CSQF forwarding scheduling strategy based on the equivalent delay value and the equivalent jitter value. The maximum jitter value of the client packet transmitted end-to-end is 2T.
[0048] When local networks X and Y have the same clock frequency (f) and a forwarding period of T, the maximum jitter caused by end-to-end packet forwarding is 2T. When the clock frequencies of the two local networks are inconsistent, such as fx and fy, although fx is approximately equal to fy and Tx is approximately equal to Ty, their magnitudes are still different, with a slight deviation. Tx is not equal to Ty. Initially, the relative positions of the starting times of the forwarding periods are the same. As time accumulates, after a certain period, the starting times of the two networks deviate, and the offset value gradually accumulates. The accumulated result continues to increase, causing the total offset value to exceed the tolerance range of CSQF. As shown in Figure 10, initially, the starting times of the forwarding periods of network X and network Y are the same, and the phases at the starting times are the same, with a phase difference of 0. As shown in scenario 1, all data packets within a large period of network X are forwarded in a certain large period of network Y according to the planned corresponding forwarding period relationship. When the frequency of network X is higher than that of network Y, and the frequency of network Y is lower, the start time of the forwarding cycle of network Y changes more slowly, and the start time of the forwarding cycle of network Y begins to lag behind that of network X. As time goes on, such as in scenario 1--->scenario 2--->scenario 3, the deviation in the start time will become larger and larger, resulting in an increasing number of accumulated packets inside the device, increasing the latency, and eventually causing the device's internal buffer to overflow, leading to service interruption.
[0049] When the clock frequency of local network X is less than that of local network Y, as shown in Figure 11, initially the forwarding cycles of network X and network Y start at the same time, with a phase difference of 0. All data packets within one cycle of network X are forwarded on network Y within one large cycle according to the planned corresponding forwarding cycle relationship. When the frequency of network X is less than that of network Y, the frequency of network Y is higher, and the start time of the forwarding cycle of network Y is faster, causing the start time of the forwarding cycle of network Y to lead the start time of the forwarding cycle of network X. As time goes on, the leading deviation time will be earlier and earlier. When it accumulates to a certain extent, the start time of the forwarding cycle of network Y is too early, and the packets from the receiving port have not yet arrived or are not ready, causing them to be unable to catch up with the start time of the forwarding cycle and need to wait for a period of time before they are ready for forwarding. This results in a gap or idle period in the early part of the forwarding cycle, during which no packets can be forwarded, reducing the effective forwarding bandwidth within one cycle. As time increases, the idle period in the early part of the forwarding cycle will become larger and larger, eventually causing the entire cycle to become empty.
[0050] When the frequencies in two end-to-end local synchronization networks are inconsistent, although the two local synchronization networks are configured with the same forwarding period T, because the frequencies fx ≠ fy in the two synchronization networks, and the period T is equivalent to a fixed number of clock ticks based on the time frequency, the forwarding period of the two synchronization networks is actually different when using a third-party reference time as a reference, that is, Tx ≠ Ty. The total number of forwarding periods T in the two networks is not equal over a certain duration, and there is a slippage phenomenon in the relative position of the starting time of the forwarding period of the two networks.
[0051] Based on this, embodiments of this application provide a message processing method, an electronic device, a computer-readable storage medium, and a computer program product, which aim to reduce transmission latency jitter when deterministic services such as messages traverse asynchronous networks.
[0052] As shown in Figure 12, which is a schematic diagram of the implementation environment of a message processing method provided in an embodiment of this application, the implementation environment includes a first network, a second network, and a third network.
[0053] In this embodiment, the packet is forwarded in the first network according to the traditional forwarding cycle. The packet traverses the third network and arrives at the second network. In the second network, the first node performs window sliding and maps the packet into the second network, where it is forwarded according to the traditional forwarding cycle. In the second network, the destination node device forwards the packet according to the forwarding cycle and forwarding sub-cycle carried in the packet, achieving a small range of delay jitter, thereby reducing the latency jitter during packet forwarding and enabling customer services to traverse the third network and be deterministically transmitted in the two frequency-asynchronous first and second networks.
[0054] As shown in Figure 13, which is a flowchart of a message processing method provided in an embodiment of this application, the executing entity of the message processing method can be the first node of the second network, and the message processing method may include, but is not limited to, the following steps S110-S130.
[0055] Step S110: Receive a message from the first network, wherein the message carries a period tag, the period tag is set to indicate the forwarding period and forwarding sub-period corresponding to the message, and the forwarding sub-period is located in the forwarding period.
[0056] In this embodiment of the application, in the first network, packets carrying periodic labels are forwarded within the forwarding period corresponding to the periodic label. For example, packets carrying periodic labels {0.0, 0.1, 0.2, ..., 0.6, 0.7} are forwarded in the first network within the forwarding period when the periodic label is 0, thereby enabling the first node of the second network to receive packets from the first network.
[0057] For example, the periodic label includes a forwarding periodic label and a forwarding sub-period label.
[0058] In this embodiment, the period tag carried in the message is represented by two numerical values: 0.0, 0.1, 0.2, 0.3, ... 0.7, 1.0, 1.1, 1.2, 1.3, ... 1.7, 2.0, 2.1, 2.2, ... 2.7, 3.0, 3.1, ... 3.7, 0.0, 0.1, ... The data group is preceded by the forwarding period tag, the high-order part of the period tag carried in the message; followed by the forwarding sub-period tag, the low-order part of the period tag carried in the message.
[0059] Step S120: Determine the target period corresponding to the packet based on the forwarding sub-period offset of the second network relative to the first network, the forwarding period corresponding to the packet, and the forwarding sub-period.
[0060] In this embodiment, as time progresses, the start time of the forwarding sub-cycle of the second network begins to lag behind or precede the start time of the forwarding sub-cycle of the first network. The phase difference of the start time of the forwarding sub-cycle increases from 0. The forwarding sub-cycle offset is obtained based on the forwarding sub-cycles of the second network and the forwarding sub-cycles of the first network. Based on the forwarding sub-cycle offset, the forwarding cycle corresponding to the packet, and the forwarding sub-cycle, the target cycle corresponding to the packet is determined. The target cycle can also be understood as the packet transmission cycle. The current node sends the packet to the next hop node within the target cycle.
[0061] In one possible embodiment, regarding step S120 above, the message processing method includes steps S121-S123:
[0062] Step S121: Determine the forwarding sub-cycle adjustment amount N2 based on the forwarding sub-cycle offset N1.
[0063] In this embodiment of the application, as time goes by, the start time of the forwarding sub-cycle of the second network begins to lag behind or advance the start time of the forwarding sub-cycle of the first network. The phase difference of the start time of the forwarding sub-cycle increases from 0. The forwarding sub-cycle offset N1 represents the degree of offset between the start times of the forwarding sub-cycles of the first network and the second network. The forwarding sub-cycle adjustment amount N2 can be determined based on the forwarding sub-cycle offset N1, and the target period can be determined based on the forwarding sub-cycle adjustment amount N2 so as to forward the packet within the target period.
[0064] In one possible embodiment, regarding step S121 above, the message processing method includes steps S1211-S1212:
[0065] Step S1211: Accumulate the forwarding sub-cycle offset N1 of the second network relative to the first network.
[0066] In this embodiment of the application, as time goes by, the start time of the forwarding sub-cycle of the second network begins to lag behind or advance the start time of the forwarding sub-cycle of the first network, and the phase difference of the start time of the forwarding sub-cycle increases from 0. The forwarding sub-cycle offset N1 of the second network relative to the first network is accumulated, and the forwarding sub-cycle adjustment amount N2 is obtained based on the forwarding sub-cycle offset N1.
[0067] Step S1212: Determine the forwarding sub-cycle adjustment amount N2 based on the forwarding sub-cycle offset N1.
[0068] For example, the forwarding sub-cycle offset N1 can be positive, negative, or 0. When the forwarding sub-cycle offset N1 is positive, it indicates that the forwarding sub-cycle of the second network is ahead of the forwarding sub-cycle of the first network; when the forwarding sub-cycle offset N1 is negative, it indicates that the forwarding sub-cycle of the second network is behind the forwarding sub-cycle of the first network; when the forwarding sub-cycle offset N1 is 0, it indicates that the forwarding sub-cycle of the second network is synchronized with the forwarding sub-cycle of the first network.
[0069] For example, the absolute value of N1 is greater than or equal to 0, and N2 is obtained by rounding down the absolute value of N1.
[0070] In this embodiment of the application, when the start time of the forwarding sub-cycle of the second network is neither delayed nor advanced compared to the start time of the forwarding sub-cycle of the first network, the absolute value of N1 is equal to 0, and the absolute value of N1 is rounded down to obtain N2, that is, N2 equals 0; when the start time of the forwarding sub-cycle of the second network is delayed or advanced compared to the start time of the forwarding sub-cycle of the first network, the absolute value of N1 is greater than 0. For example, when the absolute value of N1 is equal to 3.2, the absolute value of N1 is rounded down to obtain N2, that is, N2 equals 3.
[0071] Step S122: Extend the forwarding sub-cycle corresponding to the message by N2 sub-cycles to obtain the new forwarding cycle and the new forwarding sub-cycle corresponding to the message.
[0072] In this embodiment of the application, after determining the forwarding sub-cycle adjustment amount N2, the forwarding sub-cycle corresponding to the packet is extended by N2 sub-cycles, thereby obtaining the new forwarding cycle and the new forwarding sub-cycle corresponding to the packet.
[0073] For example, extending the forwarding sub-cycle corresponding to the message can include both extending it forward and extending it backward.
[0074] In one possible embodiment, regarding step S122 above, the message processing method includes step S1221:
[0075] Step S1221: If the second network lags behind the first network, the forwarding sub-cycle corresponding to the packet is postponed by N2 sub-cycles.
[0076] In this embodiment, when the second network lags behind the first network, the forwarding sub-cycle corresponding to the packet is postponed by N2 sub-cycles to reduce packet transmission delay jitter. For example, when the start time of the forwarding cycle of the second network lags behind the start time of the forwarding cycle of the first network by more than 1 (but less than 2) forwarding sub-cycles, all packets in one forwarding cycle of the first network are no longer mapped to one forwarding cycle in the corresponding second network. Instead, a sliding, staggered mapping is used, combining the packets in one forwarding cycle of the first network carrying the start of the forwarding sub-cycle and the packets carrying the first forwarding sub-cycle of the next forwarding cycle, and mapping them to one forwarding cycle in the corresponding second network. That is, packets in the first network carrying cycle labels {0.1, 0.2, 0.3, ... 0.} The packets with period tags {0.1, 0.7} and {1.0} are combined and mapped to a forwarding cycle (large cycle) with period tag 0. That is, the packets with period tags {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0} are mapped to a forwarding cycle (large cycle) with period tag 0, and the packets with period tags {1.1, 1.2, 1.3, ..., 1.6, 1.7, 2.0} are mapped to a forwarding cycle (large cycle) with period tag 1, and so on. {2.1, 2.2, 2.3, ..., 2.6, 2.7, 3.0} and {3.1, 3.2, 3.3, ..., 3.6, 3.7, 0.0} are mapped to the adjacent subsequent forwarding cycles (large cycles).
[0077] In one possible embodiment, regarding step S122 above, the message processing method includes step S1222:
[0078] Step S1222: If the second network is ahead of the first network, the forwarding sub-cycle corresponding to the message is delayed by N2 sub-cycles.
[0079] In this embodiment, when the second network is ahead of the first network, the forwarding sub-cycle corresponding to the packet is delayed by N2 sub-cycles to reduce packet transmission delay jitter. For example, when the start time of the second network's forwarding cycle begins to precede the start time of the first network's forwarding cycle by more than one (but less than two) forwarding sub-cycles, all packets in one forwarding cycle of the first network are no longer mapped to a corresponding forwarding cycle in the second network. Instead, a sliding, staggered mapping is used, combining the packet from the last forwarding sub-cycle of the previous forwarding cycle in the first network with all other packets in the next forwarding cycle except the last forwarding sub-cycle, and mapping them to the second network. Within a forwarding cycle in the network, packets carrying the cycle label {3.7} and packets carrying the cycle labels {0.0, 0.1, 0.2, 0.3, ... 0.6} in the first network are combined and mapped to a forwarding cycle (large cycle) with a cycle label of 0. That is, packets carrying the cycle labels {3.7, 0.0, 0.1, 0.2, 0.3, ... 0.6} are mapped to a forwarding cycle (large cycle) with a corresponding cycle label of 0, and packets carrying the cycle labels {0.7, 1.0, 1.1, 1.2, 1.3, ... 1.6} are mapped to the next forwarding cycle (large cycle).
[0080] Step S123: Determine the target period based on the new forwarding period.
[0081] In this embodiment, after determining the new forwarding period and new forwarding sub-period corresponding to the packet, the target period can be obtained based on the new forwarding period. For example, the original period label carried by the packet is {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0}, and the forwarding sub-period offset N1 is -1.1. The absolute value of N1 is rounded down to obtain N2 equal to 1, thereby extending the forwarding sub-period corresponding to the packet by 1 sub-period, resulting in a new period label of {0.0, 0.1, 0.2, 0.3, ..., 0.6, 0.7}. Thus, the new forwarding period is 0. The new forwarding period 0 can be regarded as the period obtained after correcting the forwarding period corresponding to the period label carried by the first node of the first network. Then, according to the preset period mapping relationship, the target period corresponding to forwarding period 0 is determined.
[0082] In one possible embodiment, regarding step S123 above, the message processing method includes steps S1231-S1232:
[0083] Step S1231: Determine the new cycle label based on the new forwarding cycle and the new forwarding sub-cycle.
[0084] In this embodiment of the application, after determining the new forwarding period and the new forwarding sub-period, the period label can be obtained based on the new forwarding period and the new forwarding sub-period. For example, for a packet carrying the original period label {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0}, based on the current forwarding sub-period offset N1 being -1.1, the absolute value of N1 is rounded down to obtain N2 equal to 1, thereby extending the forwarding sub-period corresponding to the packet forward by 1 sub-period, and the new period label is {0.0, 0.1, 0.2, ..., 0.5, 0.6, 0.7}.
[0085] Step S1232: Determine the target period corresponding to the new period label according to the preset period mapping relationship, wherein the period mapping relationship represents the mapping relationship between the period label and the target period.
[0086] In this embodiment of the application, the target period corresponding to the new period label can be obtained through the preset period mapping relationship. For example, the new period label is {0.0, 0.1, 0.2, ... 0.5, 0.6, 0.7}. According to the preset period preset relationship, the large period label 0 is mapped to the sending period 3, so the target period can be determined to be 3.
[0087] For example, a message arrives at a second network via a first network and a third network, and the periodic mapping relationship is determined based on at least one of the delay parameter and jitter parameter of the third network.
[0088] It is understood that the above-mentioned periodic mapping relationship can be determined based on the delay parameters of the third network, the jitter parameters of the third network, or both the delay parameters and jitter parameters of the third network. This application embodiment does not impose specific limitations on it.
[0089] It is understood that the latency jitter generated by the third network in this application embodiment is included in the latency jitter of the first node of the second network. This is equivalent to needing to superimpose the latency jitter parameters of the third network and the second network when planning the target period (the large period position of transmission) corresponding to the first node of the second network to meet the latency jitter requirements of the message transmission.
[0090] Step S130: Send a message during the target period.
[0091] In this embodiment of the application, the first node of the second network sends a message during the target period after determining the target period, thereby reducing the delay jitter in message transmission.
[0092] The embodiments of this application can determine the target period corresponding to the packet by the forwarding sub-period offset of the second network relative to the first network, the forwarding period corresponding to the packet, and the forwarding sub-period, so as to send the packet of the first network in the target period, thereby reducing the delay jitter of packet transmission.
[0093] In one possible embodiment, prior to step S130 above, the message processing method further includes step S140:
[0094] Step S140: Replace the periodic label in the message with a new periodic label.
[0095] In this embodiment of the application, if the start time of the forwarding sub-cycle of the second network is not delayed or advanced compared to the start time of the forwarding sub-cycle of the first network, the forwarding sub-cycle offset N1 of the second network relative to the first network is accumulated, and the forwarding sub-cycle adjustment amount N2 is obtained based on the forwarding sub-cycle offset N1. The forwarding sub-cycle corresponding to the packet is extended by N2 sub-cycles to obtain a new forwarding cycle and a new forwarding sub-cycle, thereby determining a new cycle label, and then replacing the cycle label in the packet with the new cycle label. For example, if the original period label of the message is 1.0, and the second network lags behind the first network by one forwarding sub-cycle (i.e., the forwarding sub-cycle offset N1 is -1), then the forwarding sub-cycle adjustment N2 is 1. Given that the second network lags behind the first network, the forwarding sub-cycle of the message needs to be postponed by one forwarding sub-cycle. After this postponement, the message with the original period label of 1.0 has a new period label of 0.7. The period label carried in the message is then replaced with 0.7 so that downstream nodes can determine the target period for sending the message based on the new period label.
[0096] In one possible embodiment, the message processing method further includes step S150:
[0097] Step S150: In response to the forwarding sub-cycle offset N1 reaching a power of N3, the value of N1 is cleared to zero, where N3 represents the number of forwarding sub-cycles contained in one forwarding cycle.
[0098] In this embodiment, when the forwarding sub-cycle offset N1 is a power of N3, the value of N1 is cleared to zero, the initial state is repeated, and a new round of sliding mapping process begins. For example, the number of forwarding sub-cycles N3 contained in a forwarding cycle is equal to 8. When the phase difference at the start of the forwarding cycle reaches 8 forwarding cycles, that is, the forwarding sub-cycle offset N1 is equal to 64, then the packets carrying the cycle sequence values {0.0, 0.1, 0.2, ..., 0.6, 0.7} in the same forwarding cycle of the first network are mapped to the corresponding forwarding cycle in the second network. This is the situation at the initial forwarding. The sliding mapping lags behind by 8 forwarding cycles, which is the cycle period of the forwarding cycle. From this moment, the initial state is repeated, the value of N1 is cleared to zero, and a new round of sliding mapping process begins.
[0099] In the message processing method provided in this application embodiment, a node of the second network receives a message from the first network. The message carries a period tag, which is set to indicate the forwarding period and forwarding sub-period corresponding to the message. The forwarding sub-period is located in the forwarding period. In order to reduce the jitter caused by the frequency asynchrony between the second network and the first network, the node of the second network determines the target period for sending the message based on the forwarding sub-period offset of the second network relative to the first network, the forwarding period and forwarding sub-period corresponding to the message, so as to meet the deterministic forwarding requirement of the message in two networks with asynchronous frequencies.
[0100] To better understand the solutions of the embodiments of this application, the message processing methods provided in the embodiments of this application will be described below through several application examples.
[0101] Example 1
[0102] Assuming a customer sends packets at a uniform, full throughput on the first device (first node) of the first network, the first device assigns a periodic label to each packet according to its forwarding window position. In this example, under both large and small window schemes, the forwarding period is 0-3, and the forwarding sub-period is 0-7. The forwarding period and sub-period are carried in the forwarding label within the packet. The periodic label carried in the packet is represented by two numerical values: 0.0, 0.1, 0.2, 0.3, ..., 0.7, 1.0, 1.1, 1.2, 1.3, ..., 1.7, 2.0, 2.1, 2.2, ..., 2.7, 3.0, 3.1, ..., 3.7, 0.0, 0.1, ... The data group begins with the forwarding periodic label (the high-order part of the periodic label carried in the packet), and ends with the forwarding sub-period label (the low-order part of the periodic label carried in the packet). In the first device of the first network, the sending time of each packet is recorded according to the forwarding cycle and forwarding sub-cycle. The packet carries the forwarding cycle and forwarding sub-cycle. Other nodes in the first network forward packets according to the forwarding cycle. When there is only one customer service flow in the first network and it is forwarded at full capacity, the actual forwarding position of the packet in each forwarding cycle basically matches the actual position of the forwarding sub-cycle. When a packet is forwarded from the first network to the second network, the jitter factor of the third network is not considered (assuming the jitter value is 0). When the customer packet crosses the third network to reach the second network, it is also at full capacity and continuous. The cycle label carried by the packet represents the forwarding cycle of the first network. The first device of the second network receives packets according to the first node of the second network. There is a relative slippage problem between the cycle label carried by the packet and the forwarding cycle of the second network. Under full traffic conditions and ignoring jitter from the third network, if packets are allowed to slide within the cycle time window of the first device in the second network, although the cycle label carried by the packet slides relative to the start position of the second network's forwarding cycle, the packets still maintain a fixed relative position. This way, the first device in the second network will not introduce additional transmission delays or jitter. Packets only slide within the first device of the second network. After sliding within the first device, the packet is synchronized with the start time of the second network's forwarding cycle. Other devices in the second network (except the first device) only need to forward according to the CSQF method. In practical applications, intermediate devices in the second network (except the first and last devices) only need to forward according to the CSQF forwarding cycle, and devices other than the last device in the second network only need to forward according to the CSQF forwarding sub-cycle sequence value. This satisfies the jitter requirements for end-to-end customer service transmission, with the maximum jitter value not exceeding twice the smaller cycle value.
[0103] Example 2
[0104] When a phase difference is detected between the change time of the periodic label carried in the packet and the start time of the second network forwarding cycle, a sliding mapping is performed based on this phase difference. This allows the customer's service flow to be evenly mapped to the first device in the second network. The first device in the second network will not experience additional delays or jitter due to the phase difference when forwarding packets. After the customer is mapped to the first device in the second network, the second network operates as a clock-frequency synchronized network. Intermediate devices in the second network forward packets according to the forwarding cycle and the CSQF mechanism until the final destination device. The final device in the second network forwards the output packet according to the forwarding sub-cycle, and the maximum jitter value of the output packet does not exceed twice the value of the forwarding sub-cycle.
[0105] Example 3
[0106] Within the first network, packets carrying the same forwarding cycle are forwarded within the same forwarding cycle. That is, packets carrying cycle tags {0.0, 0.1, 0.2, ..., 0.6, 0.7} are forwarded within one forwarding cycle in the first network; packets carrying {1.0, 1.1, 1.2, ..., 1.6, 1.7} are forwarded in the next forwarding cycle; packets carrying {2.0, 2.1, 2.2, ..., 2.6, 2.7} are forwarded in the next forwarding cycle, and so on. Because the clock frequencies of the first and second networks are different, packets within the same forwarding cycle in the first network cannot be forwarded within the same forwarding cycle in the second network for an extended period. Client packets from each forwarding cycle in the first network need to be mapped to the corresponding forwarding cycle in the second network using a sliding method.
[0107] The sliding mapping method is as follows: When the system starts working, the start time of each forwarding cycle in the first network and the second network is at the same time position, and the phase difference between the start times of the two forwarding cycles is 0. In the first network, packets carrying period labels {0.0, 0.1, 0.2, ..., 0.6, 0.7} are located in the same forwarding cycle with period label 0. All of these packets are mapped to the corresponding forwarding cycle with period label 0 in the second network, as shown in Scenario 1 of Figure 14. When the clock frequency of the first network is greater than that of the second network, the first network is faster than the second network. As time progresses, the start time of the forwarding cycle of the second network begins to lag behind that of the first network. The phase difference at the start time of the forwarding cycle increases from 0. When the start time of the second network's forwarding cycle lags behind that of the first network by more than one (but less than two) forwarding sub-cycles (as shown in Scenario 2 of Figure 14), instead of mapping all client packets of a large cycle in the first network to a corresponding forwarding cycle in the second network, a sliding, staggered mapping is used. The packets carrying the start of the forwarding sub-cycle in a forwarding cycle in the first network, along with the packets carrying the first forwarding sub-cycle of the next forwarding cycle, are combined and mapped to the corresponding forwarding cycle in the second network. That is, the packets carrying the cycle label in the first network are mapped to the corresponding forwarding cycle in the second network. Packets with the periodic labels {0.1, 0.2, 0.3, ..., 0.6, 0.7} and {1.0} are combined and mapped to a forwarding cycle of the second network with a periodic label of 0. That is, packets with the periodic labels {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0} are mapped to the corresponding forwarding cycle of the second network with a periodic label of 0. Packets with the periodic labels {1.1, 1.2, 1.3, ..., 1.6, 1.7, 2.0} are mapped to the corresponding forwarding cycle of the second network with a periodic label of 1, and so on. Packets with the periodic labels {2.1, 2.2, 2.3, ..., 2.6, 2.7, 3.0} and {3.1, 3.2, 3.3, ..., 3.6, 3.7, 0.0} are mapped to the next adjacent forwarding cycles of the second network.As time continues, when the phase at the start of the forwarding cycle of the first and second networks accumulates to more than 2 (but less than 3) forwarding sub-cycles, as shown in scenario 3 of Figure 14, the sliding range will continue to increase. Packets carrying period tags {0.2, 0.3, ..., 0.6, 0.7} and packets carrying period tags {1.0, 1.1} in the first network will be combined and mapped to the corresponding forwarding cycle of the second network with a period tag of 0, i.e., packets carrying period tags {0.2, 0.3, ..., 0.6, 0.7}. Packets with period tags {7, 1.0, 1.1} are mapped to a forwarding cycle in the second network with a corresponding period tag of 0. Packets with period tags {1.2, 1.3, ..., 1.6, 1.7, 2.0, 2.1} are mapped to a forwarding cycle in the second network, and so on. Packets with period tags {2.2, 2.3, ..., 2.6, 2.7, 3.0, 3.1} and {3.2, 3.3, ..., 3.6, 3.7, 0.0, 0.1} are mapped to the next adjacent forwarding cycles in the second network. The sliding mapping method is based on the phase difference between the start times of the forwarding cycles of the first and second networks. When the phase difference at the start times of the forwarding cycle reaches more than 3 (but less than 4) forwarding sub-cycles, packets from the first network carrying period labels {0.3, ... 0.6, 0.7, 1.0, 1.1, 1.2} are mapped to a forwarding cycle of the second network with a period label of 0. Packets carrying other period labels are mapped in the same way: {1.3, ... 1.6, 1.7, 2.0, 2.1, 2.2}, {2.3, ... 2.6, 2.7, 3.0, 3.1, 3.2}, {3.3, ... 3.6, 3.7, 0.0, 0.1, 0.2} are mapped to the corresponding forwarding cycles. When the phase difference at the start of a forwarding cycle accumulates to more than 4 (but less than 5) forwarding sub-cycles, packets from the first network carrying cycle labels {0.4, 0.5, 0.6, 0.7, 1.0, 1.1, 1.2, 1.3} are mapped to a forwarding cycle in the second network with a corresponding cycle label of 0. Packets carrying other cycle labels are mapped in the same manner: {1.4, ..., 1.6, 1.7, 2.0, 2.1, 2.3}, {2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3}, {3.4, 3.5, 3.6, 3.7, 0.0, 0.1, 0.2, 0.3} are mapped to their corresponding forwarding cycles. This process is repeated for other forwarding cycle start phase differences.
[0108] As time progresses, the phase difference at the start of the forwarding cycle continues to increase. When the phase difference reaches more than 7 (but less than 8) forwarding sub-cycles, packets from the first network carrying period labels {0.7, 1.0, 1.1, ..., 1.5, 1.6} are mapped to a forwarding cycle in the second network with the corresponding period label 0. Packets carrying period labels {1.7, 2.0, 2.2, ..., 2.5, 2.6} are mapped to the next forwarding cycle in the second network, and so on. The phase difference at the start of other forwarding cycles is also mapped in a similar sliding manner.
[0109] As time progresses, the phase difference at the start of the forwarding cycle continues to increase. When the phase difference reaches more than 8 (but less than 9) forwarding sub-cycles, packets from the first network carrying period tags {1.0, 1.1, ..., 1.5, 1.6, 1.7} are mapped to a forwarding cycle in the second network with the corresponding period tag of 0. Client packets carrying period tags {2.0, 2.1, ..., 2.5, 2.6, 2.7} are mapped to the next forwarding cycle in the second network, and so on. The phase difference at the start of other forwarding cycles also slides and maps in a similar way. At this time, packets from the first network in one forwarding cycle are delayed as a whole and mapped to a forwarding cycle in the second network after sliding for one forwarding cycle.
[0110] As time progresses, the phase difference at the start of the forwarding cycle continues to increase. When the phase difference reaches more than 9 (but less than 10) forwarding sub-cycles, packets from the first network carrying period tags {1.1, ..., 1.5, 1.6, 1.7, 2.0} are mapped to a forwarding cycle in the second network with the corresponding period tag of 0. Client packets carrying period tags {2.1, ..., 2.5, 2.6, 2.7, 3.0} are mapped to the next forwarding cycle in the second network, and so on. The phase difference at the start of other forwarding cycles also slides and maps in a similar way. At this time, packets from the first network slide one forwarding cycle and one forwarding sub-cycle before being mapped to one forwarding cycle in the second network. As time progresses, the phase difference at the start of the forwarding cycle continues to increase, and the sliding and lag positions of packets from the first network become larger and larger. When the phase difference at the start of the forwarding cycle reaches 8 forwarding cycles, packets carrying the period sequence values {0.0, 0.1, 0.2, ..., 0.6, 0.7} in the same forwarding cycle of the first network are mapped to the corresponding forwarding cycle in the second network. This is the situation at the initial forwarding stage. The sliding mapping lags behind by 8 forwarding cycles, which is the cycle of the forwarding cycle. From this moment on, the initial state begins to repeat, and a new round of sliding mapping process begins.
[0111] Example 4
[0112] When the clock frequency of the first network is lower than that of the second network, the start time of the forwarding cycle of the second network is gradually advanced. When the network starts working, the start time of each forwarding cycle in the first and second networks is at the same position, and the phase difference between the start times of their forwarding cycles is 0. In the first network, packets carrying period tags {0.0, 0.1, 0.2, ..., 0.6, 0.7} are located in the same forwarding cycle. All of these packets are mapped to a forwarding cycle in the second network with the corresponding period tag of 0, as shown in Scenario 1 of Figure 15. When the clock frequency of the first network is lower than that of the second network, the speed of the first network is slower than that of the second network. As time progresses, the start time of the forwarding cycle of the second network begins to lead the start time of the forwarding cycle of the first network. The phase of the start time of the forwarding cycle increases from 0. When the start time of the forwarding cycle of the second network begins to lead the start time of the forwarding cycle of the first network by more than one (but less than two) forwarding sub-cycles, as shown in Scenario 2 of Figure 15, instead of mapping all client packets in one forwarding cycle of the first network to a corresponding forwarding cycle in the second network, a sliding, staggered mapping is used. The packets of the last forwarding sub-cycle of the previous forwarding cycle in the first network and the other packets in the next forwarding cycle, except for the last forwarding sub-cycle, are combined and mapped to a corresponding forwarding cycle in the second network. That is, the packets carrying the cycle in the first network are mapped to a corresponding forwarding cycle in the second network. A message with tag {3.7} and a message carrying period tags {0.0, 0.1, 0.2, 0.3, ... 0.6} are combined and mapped to one forwarding cycle of the corresponding period tag 0 in the second network. That is, a message carrying period tags {3.7, 0.0, 0.1, 0.2, 0.3, ... 0.6} is mapped to one forwarding cycle of the corresponding period tag 0 in the second network. A message carrying period tags {0.7, 1.0, 1.1, 1.2, 1.3, ... 1.6} is mapped to the next forwarding cycle of the second network, and so on. {1.7, 2.0, 2.1, 2.2, 2.3, ... 2.6} and {2.7, 3.0, 3.1, 3.2, 3.3, ... 3.6} are mapped to the next adjacent forwarding cycles of the second network.As time continues, when the phase at the start of the forwarding cycle of the first and second networks reaches more than two (but less than three) forwarding cycles, as shown in Scenario 3 of Figure 15, the range of the sliding mapping will continue to increase. Packets carrying period tags {3.6, 3.7} and packets carrying period tags {0.0, 0.1, 0.2, 0.3, 0.4, 0.5} from the first network will be combined and mapped to the corresponding forwarding cycle of the second network, i.e., packets carrying period tags {3.6, 3.7, 0.0, 0.1, 0.2, 0.5}. Packets with period tags {0.3, 0.4, 0.5} are mapped to the corresponding forwarding cycle of the second network. Packets with period tags {0.6, 0.7, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5} are mapped to the next forwarding cycle of the second network, and so on. Packets with period tags {1.6, 1.7, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5} and {2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5} are mapped to the next adjacent forwarding cycles of the second network.
[0113] When the phase difference at the start of a forwarding cycle reaches more than 3 (but less than 4) forwarding sub-cycles, a customer packet from the first network carrying cycle labels {3.5, 3.6, 3.7, 0.0, 0.1, 0.2, 0.3, 0.4} is mapped to a forwarding cycle in the second network with the corresponding cycle label of 0. The other cycle labels are mapped in the same way. {0.5, 0.6, 0.7, 1.0, 1.1, 1.2, 1.3, 1.4}, {1.5, 1.6, 1.7, 2.0, 2.1, 2.2, 2.3, 2.4}, and {2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3, 3.4} are respectively mapped to the next adjacent forwarding cycle in the second network.
[0114] When the phase difference at the start of a forwarding cycle reaches more than 4 (but less than 5) forwarding sub-cycles, a customer packet from the first network carrying the period label {3.4, 3.5, 3.6, 3.7, 0.0, 0.1, 0.2, 0.3} is mapped to a forwarding cycle in the second network with the corresponding period label of 0. The other period labels are mapped in the same way: {0.4, 0.5, 0.6, 0.7, 1.0, 1.1, 1.2, 1.3}, {1.4, 1.5, 1.6, 1.7, 2.0, 2.1, 2.2, 2.3}, {2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3}, {3.4, 3.5, 3.6, 3.7, 0.0, 0.1, 0.2, 0.3}. Similarly, the phase difference at the start of other forwarding cycles is also mapped in a similar way.
[0115] When the phase difference at the start of a forwarding cycle reaches more than 7 (but less than 8) forwarding sub-cycles, a customer packet from the first network carrying cycle labels {3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 0.0} is mapped to a forwarding cycle in the second network with the corresponding cycle label of 0. Packets carrying other cycle labels are mapped sequentially: {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0}, {1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.0}. This process is repeated for other forwarding cycle start phase differences.
[0116] As time progresses, the phase difference at the start of the forwarding cycle continues to increase. When the phase difference reaches more than 8 (but less than 9) forwarding sub-cycles, packets from the first network carrying period tags {3.0, 3.1, ..., 3.5, 3.6, 3.7} are mapped to a forwarding cycle of the second network with a period tag of 0. Packets carrying period tags {0.0, 0.1, ..., 0.5, 0.6, 0.7} are mapped to the next forwarding cycle of the second network, and so on. The phase difference at the start of other forwarding cycles also slides and maps in a similar way. At this point, packets from a forwarding cycle of the first network are all advanced, slide one forwarding cycle, and then are mapped to a forwarding cycle of the second network.
[0117] As time progresses, the phase difference at the start of the forwarding cycle continues to increase. When the phase difference reaches more than 9 (but less than 10) forwarding sub-cycles, packets from the first network carrying period tags {2.7, 3.0, 3.1, ..., 3.5, 3.6} are mapped to a forwarding cycle of the second network with a period tag of 0. Packets carrying period tags {3.7, 0.0, 0.1, ..., 0.5, 0.6} are mapped to the next forwarding cycle of the second network, and so on. The phase difference at the start of other forwarding cycles is also mapped in a similar sliding manner.
[0118] Example 5
[0119] Packets from the first network undergo sliding mapping on the first device in the second network to achieve speed adaptation between the packet speed from the first network and the forwarding speed of the second network, ensuring uniform and rapid packet forwarding and meeting jitter requirements. There are many sliding mapping methods. Besides the previously mentioned method of recombining and mapping packets from multiple forwarding sub-cycles within adjacent forwarding cycles, other methods can be used, such as modifying the periodic labels. As shown in Figure 6, the periodic sequence value carried by the packet consists of two parts: the first part is the forwarding cycle, and the second part is the forwarding sub-cycle. When it is necessary to map packets from the first network carrying periodic labels {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0} to a forwarding cycle in the second network, the periodic labels carried in the packets can be revised first, changing them to new periodic labels, and then the mapping can be performed based on the new periodic labels. The forwarding cycle labels {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0} are revised to {0.0, 0.1, 0.2, ..., 0.5, 0.6, 0.7}. After the modification, all these forwarding cycle values are the same, which facilitates mapping to the forwarding cycle of the same second network. When revising the cycle labels, the forwarding cycle and forwarding sub-cycles can be revised separately, or all cycle labels can be treated as a whole and revised uniformly. The periodic label {0.1, 0.2, 0.3, ..., 0.6, 0.7, 1.0} is considered as the overall data value {1, 2, 3, ..., 6, 7, 8}. When mapping one forwarding sub-cycle with a lag, the overall periodic label carried by each packet is reduced by 1, resulting in the sequence value {0, 1, 2, ..., 5, 6, 7}. The forwarding cycle and forwarding sub-cycle representation of this overall periodic label are {0.0, 0.1, 0.2, ..., 0.5, 0.6, 0.7}. The forwarding cycles after subtracting 1 from the overall periodic label are the same, and can be mapped to the same forwarding cycle in the first device of the second network. When implementing sliding mapping, a simple way to perform sliding mapping with a lag of 1 forwarding sub-cycle is to revise the overall cycle label by subtracting 1, and then map based on the revised forwarding cycle; a simple way to perform sliding mapping with a lag of 2 forwarding sub-cycles is to revise the overall cycle label by subtracting 2, and then map based on the revised forwarding cycle, and so on. A simple way to perform sliding mapping with a lag of 8 forwarding sub-cycles is to revise the overall cycle label by subtracting 8, and then map based on the revised forwarding cycle; a simple way to perform sliding mapping with a lag of 9 forwarding sub-cycles is to revise the overall cycle label by subtracting 9, and then map based on the revised forwarding cycle sequence value.Similarly, a simple way to perform a sliding mapping with a forwarding sub-cycle ahead of time is to add 1 to the overall cycle label to revise it, and then map it according to the revised forwarding cycle; a simple way to perform a sliding mapping with a forwarding sub-cycle ahead of time is to add 2 to the overall cycle label to revise it, and then map it according to the revised forwarding cycle, and so on. A simple way to perform a sliding mapping with a forwarding sub-cycle ahead of time is to add 8 to the overall cycle label to revise it, and then map it according to the revised forwarding cycle; a simple way to perform a sliding mapping with a forwarding sub-cycle ahead of time is to add 9 to the overall cycle label to revise it, and then map it according to the revised forwarding label.
[0120] Example 6
[0121] When a packet from the first network is slide-mapped on the first device in the second network, the first device in the second network needs to measure the phase relationship between the periodic label carried by the packet and the periodic label forwarded by the second network, as well as the phase relationship between the moment when the periodic label carried by the packet changes and the moment when the periodic label forwarded by the second network changes. When the frequencies of the two networks are inconsistent, the phase difference between them gradually increases over time. When the phase difference reaches one forwarding sub-cycle, a slide mapping of one forwarding sub-cycle is initiated. If the frequency of the first network is greater than that of the second network, the mapping is delayed by one forwarding sub-cycle, and the periodic label carried by the packet from the first network is reduced by 1 for revision. The revised packet carries the same forwarding period and is then mapped to one forwarding cycle of the second network. When the phase difference reaches two forwarding sub-cycles, a slide mapping of two forwarding sub-cycles is initiated, and so on. If the frequency of the first network is less than that of the second network, the mapping is advanced by one forwarding sub-cycle, and the periodic label carried by the client packet from the first network is increased by 1 for revision. The revised packet carries the same forwarding period and is then mapped to one forwarding cycle of the second network. When the phase difference reaches two forwarding cycles, a sliding mapping process of two forwarding cycles is initiated, and so on. The first device in the second network measures the phase difference between the periodic label carried by the packet and the periodic label forwarded by the second network in real time. The number of forwarding sub-cycles to slide during sliding mapping is determined based on the phase difference, and the direction of sliding mapping is determined based on the polarity of the phase difference. When the frequency of the first network is greater than that of the second network, delayed mapping is performed, with packets from the first network appearing earlier and carrying periodic labels. The periodic labels are reduced and revised to achieve delayed mapping. When the frequency of the first network is less than that of the second network, early mapping is performed, with packets from the first network appearing later and carrying periodic labels. The periodic labels are increased and revised to achieve early mapping.
[0122] Example 7
[0123] When a third network separates the first and second networks, the latency and jitter introduced by the third network need to be considered. Packets from the first network reach the first device in the second network after experiencing the latency and jitter from the third network. The first device in the second network needs to consider the latency and jitter from the third network before performing sliding mapping. For the jitter introduced by the third network, the receive buffer of the first device in the second network is set according to the maximum jitter value introduced by the third network. The first device in the second network will only initiate sliding mapping after receiving and buffering the packets, thus eliminating the jitter factor introduced by the third network through buffering. The total latency, including the latency introduced by the third network and the latency introduced by the receive buffer of the first device in the second network, is used to plan the forwarding cycle position of the packet corresponding to the mapping on the first device in the second network.
[0124] This application also provides an electronic device, as shown in FIG16. The electronic device 1400 includes: one or more processors 1410; and a memory 1420 storing one or more programs. When the one or more programs are executed by the one or more processors 1410, the one or more processors 1410 implement a message processing method, such as that applied to the first node of a second network.
[0125] Memory 1420, as a non-transitory network system, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory 1420 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1420 may optionally include remotely located memories 1420 relative to processor 1410, which can be connected to processor 1410 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0126] The memory 1420 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1420 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1420 and is called and executed by the processor 1410.
[0127] The processor 1410 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0128] In some embodiments, the electronic device further includes:
[0129] The input / output interface is configured to implement information input and output;
[0130] The communication interface is configured to enable communication and interaction between this device and other devices. Communication can be achieved via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0131] The bus transmits information between various components of the device (e.g., processor 1410, memory 1420, input / output interface, and communication interface);
[0132] The processor 1410, memory 1420, input / output interface, and communication interface can communicate with each other within the device via a bus.
[0133] One embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions for performing the following:
[0134] Such as message processing methods applied to the first node of the second network.
[0135] One embodiment of this application also provides a computer program product, including a computer program or computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the computer device to perform the following:
[0136] Such as message processing methods applied to the first node of the second network.
[0137] The system architecture and application scenarios described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. Those skilled in the art will understand that as system architectures evolve and new application scenarios emerge, the technical solutions provided in this application are also applicable to similar technical problems.
[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0139] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0140] The above description, with reference to the accompanying drawings, illustrates some embodiments of this application, but does not limit the scope of this application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of this application shall be within the scope of this application.
Claims
1. A message processing method, comprising: Receive a message from a first network, wherein the message carries a period tag, the period tag being configured to indicate the forwarding period and forwarding sub-period corresponding to the message, the forwarding sub-period being located within the forwarding period; The target period corresponding to the packet is determined based on the forwarding sub-period offset of the second network relative to the first network, the forwarding period corresponding to the packet, and the forwarding sub-period. The message is sent during the target period.
2. The method according to claim 1, wherein, Based on the forwarding sub-cycle offset of the second network relative to the first network, the forwarding cycle corresponding to the packet, and the forwarding sub-cycle, the target cycle corresponding to the packet is determined, including: Based on the forwarding sub-cycle offset N1, determine the forwarding sub-cycle adjustment amount N2; The forwarding sub-period corresponding to the message is extended by N2 sub-periods to obtain a new forwarding period and a new forwarding sub-period corresponding to the message. The target period is determined based on the new forwarding period.
3. The method according to claim 2, wherein, The step of extending the forwarding sub-period corresponding to the message by N2 sub-periods includes one of the following: If the second network lags behind the first network, the forwarding sub-period corresponding to the message will be postponed by N2 sub-periods. or, If the second network is ahead of the first network, the forwarding sub-cycle corresponding to the message is delayed by N2 sub-cycles.
4. The method according to claim 2, wherein, Determining the target period based on the new forwarding period includes: A new cycle label is determined based on the new forwarding cycle and the new forwarding sub-cycle; Based on a preset period mapping relationship, the target period corresponding to the new period label is determined, wherein the period mapping relationship represents the mapping relationship between the period label and the target period.
5. The method according to claim 4, wherein, Before sending the message in the target period, the method further includes: Replace the period label in the message with the new period label.
6. The method according to claim 4, wherein, The message arrives at the second network via the first network and the third network, and the periodic mapping relationship is determined based on at least one of the delay parameter and jitter parameter of the third network.
7. The method according to claim 2, wherein, The step of determining the forwarding sub-cycle adjustment amount N2 based on the forwarding sub-cycle offset N1 includes: Accumulate the forwarding sub-cycle offset N1 of the second network relative to the first network; The forwarding sub-cycle adjustment amount N2 is determined based on the forwarding sub-cycle offset N1.
8. The method according to claim 7, wherein, The absolute value of N1 is greater than or equal to 0, and N2 is obtained by rounding down the absolute value of N1.
9. The method according to claim 7, further comprising: In response to the forwarding sub-cycle offset N1 reaching a power of N3, the value of N1 is cleared to zero, where N3 represents the number of forwarding sub-cycles contained in one forwarding cycle.
10. The method according to claim 1, wherein, The periodic label includes a forwarding periodic label and a forwarding sub-period label.
11. An electronic device, comprising: One or more processors; A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to implement the message processing method as described in any one of claims 1-10.
12. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the message processing method as described in any one of claims 1-10.
13. A computer program product comprising a computer program that, when executed by a processor, implements the message processing method as described in any one of claims 1-10.
Citation Information
Patent Citations
Method and device for updating mapping relation
CN112825510A
Data transmission method, electronic equipment and storage medium
CN114679418A
Method, device and system for determining message sending period
CN115695323A
Message processing method, message transmission method, communication equipment, system, medium and product
CN117768387A
Message period determination method and apparatus related thereto
WO2023040650A1