Method and device for keeping forwarding period at constant time
By receiving and calculating the message boundary information and phase difference value, the problem of message delay time jump after device failure is solved, and stable transmission delay in the network is achieved.
Patent Information
- Application Number
- CN202410009821.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
After a device failure or a single board failure, the faulty device re-establishes a phase relationship with its upstream equipment, resulting in a jump in the message delay time, and the stability of the message delivery delay in the network cannot be guaranteed.
By receiving boundary information in the message sent by the second device, the forwarding period start time of the second device is determined, and combined with the preset phase difference value of the forwarding period between devices, the forwarding period start time of the first device is calculated to keep the phase relationship between devices constant.
After the equipment is restored to normal, the original forwarding cycle phase relationship between the equipment is restored to ensure stable transmission delay of customer services in the network.
Smart Images

Figure CN120263750A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and more specifically, to a method and apparatus for maintaining a constant moment of the forwarding cycle. Background Art
[0002] Communication networks are the highways of the information age. Customer demands drive changes in communication networks. Traditional Ethernet technology delivers customer information in a best-effort manner, unable to guarantee the transmission delay and jitter of customer information. With the widespread use of Ethernet technology in industries and vehicles, high requirements are put forward for the quality of information transmission, and the transmission delay and jitter need to meet certain specified parameters.
[0003] The Deterministic Networking working group of the IETF (IETF: The Internet Engineering Task Force), by means of the Cycle Specified Queuing and Forwarding (CSQF) mechanism with a specified cycle, extends the principle of Cyclic Queuing and Forwarding (CQF) in the TSN standard to wide-area deterministic networks, to meet the transmission requirements of deterministic services in long-distance physical wide-area network scenarios. For the CSQF technology of deterministic networks applied to wide-area networks, frequency synchronization needs to be maintained among all intermediate devices in the network. In the scenario where the working clock frequencies of all devices are synchronized, the transmission cycles of all devices and the transmission cycle frequency of the upstream device are the same. Although there is a phase difference between the starting moments of the forwarding cycles, the phase difference remains constant, thereby realizing the stability of the transmission delay of packets in the network.
[0004] However, when a device fails or a single board fails, the original constant phase relationship between the forwarding cycle of the faulty device and the forwarding cycle of the upstream device of the faulty device is disrupted. When re-establishing the phase relationship, the delay time of the packet jumps, and the stability of the transmission delay of the packet in the network cannot be guaranteed. Summary of the Invention
[0005] The embodiments of the present application provide a method and apparatus for maintaining a constant moment of the forwarding cycle, to at least solve the problem that after a device failure or a single board failure in the related art, when the faulty device re-establishes a phase relationship with its upstream device, the delay time of the packet jumps.
[0006] According to an embodiment of the present application, there is provided a method for maintaining a constant moment of the forwarding cycle, which is applied to a first device, and the method includes:
[0007] Receive a message sent by a second device, where the message carries boundary information of the forwarding cycle in which the message is located;
[0008] Determine the start time of the forwarding cycle of the second device according to the boundary information;
[0009] Obtain a preset phase difference between the forwarding cycles of devices, and determine the start time of the forwarding cycle of the first device according to the preset phase difference and the start time of the forwarding cycle of the second device.
[0010] According to another embodiment of the present application, there is provided a method for maintaining a constant moment of the forwarding cycle, which is applied to a second device. The method includes:
[0011] Send a message to a first device, where the message carries boundary information of the forwarding cycle in which the message is located.
[0012] According to still another embodiment of the present application, there is provided a device for maintaining a constant moment of the forwarding cycle, which is applied to a first device. The device includes:
[0013] A receiving module, configured to receive a message sent by a second device, where the message carries boundary information of the forwarding cycle;
[0014] A first determining module, configured to determine the start time of the forwarding cycle of the second device according to the boundary information;
[0015] A second determining module, configured to obtain a preset phase difference between the forwarding cycles of devices, and determine the start time of the forwarding cycle of the first device according to the preset phase difference and the start time of the forwarding cycle of the second device.
[0016] According to still another embodiment of the present application, there is provided a device for maintaining a constant moment of the forwarding cycle, which is applied to a second device. The device includes:
[0017] A sending module, configured to send a message to a first device, where the message carries boundary information of the forwarding cycle in which the message is located.
[0018] According to still another embodiment of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0019] According to still another embodiment of the present application, there is also provided an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0020] By determining the starting moment of the forwarding period of the second device and determining the starting moment of the forwarding period of the first device according to the preset phase difference of the forwarding periods between devices and the starting moment of the forwarding period of the second device, the present application solves the problem that after a device failure or a single-board failure in the related art, the faulty device re-establishes a phase relationship with its upstream device, and the delay time of the message jumps. Thus, after the first device returns to normal, it can send messages based on the determined starting moment of the forwarding period of the first device, restore the original phase relationship of the forwarding periods between devices, and achieve stable transmission delay of customer services in the network. Description of the Drawings
[0021] Figure 1 is a schematic diagram of a traditional Ethernet device processing messages in a store-and-forward mode;
[0022] Figure 2 is a hardware structure block diagram of a mobile terminal for a method of maintaining a constant moment of the forwarding period according to an embodiment of the present application;
[0023] Figure 3 is a flowchart of a method of maintaining a constant moment of the forwarding period according to an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of a message forwarding process based on the CSQF technology according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of inserting a flag code block at the starting moment of the forwarding period according to an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of forwarding a message carrying a flag code block according to an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of the code block composition of a message according to an embodiment of the present application;
[0028] Figure 8 is a schematic diagram of an O code block according to an embodiment of the present application;
[0029] Figure 9 is a schematic diagram of the flag code block being an S code block + a T code block according to an embodiment of the present application;
[0030] Figure 10 is a schematic diagram of the time difference between the starting moment of a message carrying a second device message and the starting moment of the forwarding period where the message is located according to an embodiment of the present application;
[0031] Figure 11 is a schematic diagram of the composition of an S code block according to an embodiment of the present application;
[0032] Figure 12Schematic diagram of the time difference α carried by the extended field of the message according to an embodiment of the present application;
[0033] Figure 13 Schematic diagram of determining the starting moment of the forwarding cycle of the first device based on the flag code block according to an embodiment of the present application;
[0034] Figure 14 Schematic diagram of determining the starting moment of the forwarding cycle of the first device based on the time difference α according to an embodiment of the present application;
[0035] Figure 15 Schematic diagram of the position of the forwarding cycle value in the message according to an embodiment of the present application;
[0036] Figure 16 Timing diagram of message forwarding before and after modifying the forwarding cycle value according to an embodiment of the present application;
[0037] Figure 17 Schematic diagram of message forwarding before and after modifying the forwarding cycle value according to an embodiment of the present application;
[0038] Figure 18 Flowchart of a method for keeping the forwarding cycle constant at a certain moment according to another embodiment of the present application;
[0039] Figure 19 Structural block diagram of a device for keeping the forwarding cycle constant at a certain moment according to an embodiment of the present application;
[0040] Figure 20 Structural block diagram of a device for keeping the forwarding cycle constant at a certain moment according to another embodiment of the present application. Detailed implementation manner
[0041] In the following, embodiments of the present application will be described in detail with reference to the drawings and in conjunction with the embodiments.
[0042] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0043] Figure 1 Schematic diagram of a traditional Ethernet device processing messages in a store-and-forward mode, as Figure 1 shown, the message needs to go through multiple functional modules such as table lookup, parsing, rate limiting, queuing, caching, and scheduling in the device. The messages of all physical ports in the device share these functional modules. Therefore, the service time obtained by the messages of each physical port for these functional modules is uncertain. Whether the service time is long or short will result in an uncertain delay time of the message inside each device.
[0044] With the extensive use of Ethernet technology in industrial production lines and vehicles, higher requirements are placed on the transmission quality of customer messages. The transmission delay and jitter of messages need to meet certain parameter indicator requirements.
[0045] In some network systems, such as automated production line networks in industrial parks and on-board communication networks in vehicles, Ethernet technology is replacing some proprietary fieldbus technologies to achieve information transmission because it supports higher data rates, lower costs, and is easier to integrate with existing Ethernet device systems. However, traditional Ethernet technology forwards messages based on the best-effort concept and cannot guarantee the end-to-end bounded delay, jitter, and zero packet loss requirements in specific application scenarios.
[0046] In order to solve the problem that the delay jitter of Ethernet network transmission of customer messages cannot meet the requirements, the IETF DetNet Deterministic Network Working Group has proposed a cyclic queuing forwarding (CSQF) mechanism with a specified period. The CSQF technology is suitable for metropolitan and wide area networks. It does not require time synchronization between all devices on the network. It only requires the clock frequency between all devices and does not limit the optical fiber distance between devices. Under frequency synchronization, all devices have the same forwarding frequency. Although the starting time of the forwarding cycle T of each device is different and the sending start time of all devices is inconsistent, the forwarding cycle time between each device is the same and the frequency of the cycle change is the same. In this way, the phase relationship between the sending start time of each device is always stable and constant, ensuring that the message transmission time in the network is stable, etc., to achieve the stability of the transmission delay.
[0047] However, when a device fails or a single board fails, although the sending port of the device still forwards according to a fixed period T, the starting time of the forwarding period is randomly generated. If a random, arbitrary time is used as the starting time of the period T, the new forwarding period starting time is inconsistent with the forwarding period starting time before the failure, which destroys the phase relationship between the new forwarding start time of the device sending port and the sending start time of the upstream device. A new phase relationship appears between the forwarding cycles of the upstream and downstream devices. The delay time of the message in the network before the failure is inconsistent with the delay time of the message in the network after the failure, resulting in a large jump in the delay time, and the delay time of the message in the network is not constant.
[0048] like Figure 1As shown in the figure, if Device 2 resumes operation after a device failure, the starting moment of the forwarding cycle randomly started by Device 2 causes a phase jump in the phase relationship between the starting moments of the forwarding cycles of Device 2 and Device 1, and the delay of the message on Device 2 shows a jump. Similarly, when the starting moment of the forwarding cycle of Device 2 jumps and is updated, the phase of the starting moments of the forwarding cycles between Device 2 and Device 3 detected on Device 3 also shows a jump, the delay time of the message on Device 3 shows a jump, and the forwarding of the message on Device 2 and Device 3 shows a jump phenomenon, resulting in a jump in the total delay time of the message from Device 1 to Device 4, and the performance index of the transmission delay changes.
[0049] Based on the problems existing in the above related technologies, an embodiment of the present application proposes a method for maintaining a constant moment of the forwarding cycle. The technical concept lies in that by determining the starting moment of the forwarding cycle of the second device, the starting moment of the forwarding cycle of the first device can be calculated according to the starting moment of the forwarding cycle of the second device and the phase difference of the forwarding cycles between devices pre-stored in the first device, so that the phase relationship between the forwarding cycles of the first device and the second device before and after the failure remains constant, thereby maintaining the starting moment of the forwarding cycle of the first device before and after the failure unchanged, and realizing a stable transmission delay of the customer service in the network.
[0050] The method embodiment provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 2 is a hardware structure block diagram of a mobile terminal for a method of maintaining a constant moment of the forwarding cycle according to an embodiment of the present application. As Figure 2 shown, the mobile terminal may include one or more ( Figure 2 only one is shown in the figure) processors 102 (the processor 202 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 204 for storing data. Among them, the above mobile terminal may further include a transmission device 206 for communication functions and an input / output device 208. Those of ordinary skill in the art can understand that Figure 2 the structure shown is only schematic and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 2 shown in the figure, or have a different configuration from Figure 2 shown in the figure.
[0051] The memory 204 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method of keeping the forwarding cycle constant in the embodiments of the present application. The processor 202 executes various functional applications and data processing by running the computer programs stored in the memory 204, that is, implements the above-mentioned method. The memory 204 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 204 may further include a memory remotely disposed relative to the processor 202, and these remote memories can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0052] The transmission device 206 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 206 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 206 may be a radio frequency (Radio Frequency, abbreviated as RF) module, which is used to communicate with the Internet wirelessly.
[0053] In this embodiment, a method for keeping the forwarding cycle constant in the above-mentioned mobile terminal is provided. Figure 3 It is a flowchart of a method for keeping the forwarding cycle constant according to an embodiment of the present application, as Figure 3 shown, and the process includes the following steps:
[0054] Step S301, receive a message sent by a second device, where the message carries boundary information of the forwarding cycle where the message is located.
[0055] In the embodiments of the present invention, the first device may be a downstream device, and the second device may be an upstream device.
[0056] Exemplarily, the first device may receive a message sent by the second device within the forwarding cycle of the second device.
[0057] Exemplarily, when the message is forwarded, it may carry boundary information of the forwarding cycle, and the boundary information can be used to indicate the cycle boundary of the forwarding cycle. For example, the start time of the forwarding cycle, the end time of the forwarding cycle, the forwarding cycle value, etc.
[0058] Taking the case where the forwarding period value is carried in the message as an example, exemplarily, there is a periodic mapping relationship between the respective queues of devices. When the message is forwarded in the device, the forwarding period value can be carried, and the message is sent according to the forwarding period value. For example, after the first device receives the message sent by the second device, it can receive and forward the messages with the same forwarding period value within the same period T based on the forwarding period value carried in the message.
[0059] The following further illustrates the forwarding process of the message through an example.
[0060] Example 1:
[0061] Figure 4 is a schematic diagram of the message forwarding process based on the CSQF technology according to an embodiment of the present application. As Figure 4 shown, only clock frequency synchronization is required between devices, and time synchronization is not required. Each device can switch the working state of the queue according to a fixed-size period T, and the period sizes of all devices are the same. The time periods of each device work independently, and the switching moments of the time periods of each device are inconsistent (the switching moments of all device periods are different), but in the case of the same clock frequency, the switching frequency of each device period is the same, the number of times of switching the forwarding period within the same time is the same, and the switching frequency is the same.
[0062] As Figure 4 shown, multiple buffer queues can be set in each device, and each buffer queue can correspond to a label, that is, the forwarding period value. The message sender can determine which queue the message enters for caching according to the label carried by the message, and the messages with the same label can enter the same queue.
[0063] All queues can be in different states in each forwarding period, and all queues can take turns to change the working state. Among them, within any one-time forwarding period, only one queue is in the sending state, and the queue in the sending state only sends messages and does not receive messages. Other queues are in the receiving state, and the receiving queue only receives messages and does not send messages.
[0064] For example, the message sender can generate a forwarding period sequence order: T0, T1, T2.... All queues can cyclically change their respective working states according to the current queue forwarding period value. Within any one-time period, when the current queue corresponding to the forwarding period order is in the sending state, the remaining queues are in the receiving state.
[0065] Step S302, determine the start moment of the forwarding period of the second device according to the boundary information.
[0066] In an exemplary embodiment, the boundary information includes at least one of the following: a flag code block for indicating the start time of the forwarding cycle of the second device, and the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located.
[0067] As an example, when the second device sends a message, it can carry the boundary information of the forwarding cycle in which the message is located. The boundary information can be a flag code block, and the flag code block can be used to indicate the start time of the forwarding cycle in which the message is located; the boundary information can also be the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located. When the first device receives the message, it can parse the message to obtain the time difference between the start time of the message and the start time of the forwarding cycle in which the message is located.
[0068] As an example, the first device can determine the start time of the forwarding cycle of the second device based on the flag code block; it can also determine the start time of the forwarding cycle in which the message is located based on the start time of the message and the time difference between the start time of the message and the start time of the forwarding cycle in which the message is located.
[0069] In an exemplary embodiment, the boundary information is the flag code block, and step S302 includes:
[0070] Determine the start time of the forwarding cycle of the second device according to the reception time of the flag code block.
[0071] In an exemplary embodiment, the flag code block is the flag code block sent by the second device at the start time of the forwarding cycle.
[0072] As an example, when the second device forwards a message, it can forward a flag code block at the start time of the forwarding cycle in which the message is located to indicate the start time of the forwarding cycle. For example, the second device can insert a flag code block at the start time of the forwarding cycle in which the message is located and send the flag code block and the message to the first device together.
[0073] Figure 5 is a schematic diagram of inserting a flag code block according to the start time of the forwarding cycle in an embodiment of the present application. As Figure 5 shown, when the second device encounters the start time of the forwarding cycle when forwarding a message, it can insert and forward a flag code block. The flag code block can provide the start time position information of the forwarding cycle of the second device. The flag code block and the customer message can be sent to the first device together. The first device can record the reception time of the flag code block when receiving or detecting the flag code block.
[0074] As an example, the first device can receive a flag code block and record the reception time of the flag code block, and use the reception time of the flag code block at the ingress port of the first device as the start time of the forwarding cycle of the second device.
[0075] For example, Figure 6 is a schematic diagram of forwarding a message carrying a flag code block according to an embodiment of the present application. As shown in Figure 6 each device can forward a specific flag code block at the start time of each forwarding cycle when forwarding a message. As shown in Figure 6 the black flag code blocks in. The flag code block can be transmitted from device 1 to device 2 together with the message. After the flag block is detected at the ingress port of device 2, device 2 can record the reception time of the received flag code block. The recorded reception time is the start time of the current forwarding cycle of device 1 observed by device 2 at the ingress port. Since device 1 can continuously send flag code blocks, the ingress port of device 2 can continuously receive flag code blocks. The ingress port can use the recorded reception time of the flag code block to represent the start time of the forwarding cycle of device 1, which can also be referred to as the start time of the forwarding cycle of the ingress port of device 2.
[0076] After a failure occurs in device 2 or a single board of device 2, and device 2 resumes operation after the failure, device 2 can continue to receive the messages and flag code blocks forwarded by device 1. The reception time of the flag code block is the start time of the forwarding cycle of device 1.
[0077] In an exemplary embodiment, the types of the flag code blocks include at least one of the following types: a fault maintenance code block, a combined code block of a message start block and a message end block.
[0078] As an example, before the message is sent, it can be first 64 / 66 encoded to form a code block stream with a length of 66 bits. After encoding, the message can be composed of an S code block, several D code blocks, and T code blocks.
[0079] Figure 7 is a schematic diagram of the code block composition of a message according to an embodiment of the present application. As shown in Figure 7 the structures of the S code block, D code block, and T code block (abbreviated as S block, D block, and T block) are shown in Figure 7The content. Among them, the first two bits in the 66-bit code block are sync header bits. If the sync header bits are "01", it indicates a data code block, simply referred to as a D code block. The following 64 bits in the D code block are the content of 8 data bytes of the data code block. If the sync header bits are "10", it indicates a control code block. The 8 bits after the sync header are the type value (type field) of the control code block, indicating what type of control code block it is. The last 56 bits in the code block are the content of the control code block. Control code blocks include S code blocks (indicating the first block of a message), T code blocks (indicating the last block of a message), idle code blocks (simply referred to as I blocks, indicating idle code blocks), and O code blocks (simply referred to as O blocks, indicating fault maintenance code blocks). T code blocks can include 8 different types: T0, T1, T2, T3, T4, T5, T6, T7. Among them, the T0 block does not carry any message content, the T1 block carries 1 byte of message content, the T2 block carries 2 bytes of message content, and so on. The T7 block can carry 7 bytes of message content.
[0080] Figure 8 is a schematic diagram of the O code block according to an embodiment of the present application, as Figure 8 shown. The O code block can use the sync header bits "10" and the code block type value "0x4B" as flags. The O0 value in the code block is the sequence value of the O code block, which is used to represent various different types of O code blocks. The O0 value can include five content values such as 0x0, 0x1, 0x2, 0xC, 0xF and other reserved values, and the reserved values can be used as flag code blocks.
[0081] As Figure 8 shown, the O code block with the O0 value of 0x9 can be used as a flag code block. The sync header bits "10" + the code block type value "0x4B" + the sequence value 0x9 can be used as an identification flag because they have specific flag information. As Figure 8 shown, the O code block can also carry a forwarding cycle value.
[0082] As an example, in addition to using the O code block as a flag code block, other custom code blocks with specific flags can also be used as flag code blocks. For example, Figure 9 is a schematic diagram of the flag code block being an S code block + a T code block according to an embodiment of the present application. The S code block + the T code block can be combined to be used as a flag code block, that is, a combined code block of the first block of a message and the last block of a message.
[0083] As an example, after encoding a 64-byte message, it can be composed of an S code block + 8 D code blocks and a T code block. There are at least several D code blocks between the S code block and the T code block in the code block stream, and the situation of the combination of the S code block + the T code block will not appear in the message. Therefore, the combination of the S code block + the T code block can be used as a flag code block. As Figure 9 shown, a cycle value can also be carried in the combined code block.
[0084] As an example, when the second device forwards a message, at the start moment of the forwarding cycle, it can forward the combined flag block of the S block + T block to indicate the start moment of the current forwarding cycle of the second device. When the first device detects the combined flag block of the S block + T block, it can record the moment of receiving the combined flag block of the S block + T block, and determine the start moment of the forwarding cycle of the second device according to the moment of receiving the combined flag block of the S block + T block.
[0085] Inserting a specific flag block can provide the first device with the moment position for detecting the start moment of the second device's forwarding cycle. However, the method of inserting a specific flag block requires that no message is being sent at the start moment position. If a message is being sent at the start moment of a forwarding cycle and the message has not been sent completely, the flag block cannot be inserted. For example Figure 5 in, at the start moment position of the T3 cycle, message 3 has not been sent completely, and a specific flag block cannot be inserted at this moment. In some specific scenarios such as when the customer service is at full flow, with specific message lengths and specific cycle sizes T, the opportunity to insert a flag block is less, which brings difficulties for the first device to determine the start moment of the second device's forwarding cycle. Moreover, the flag block is an additional inserted block, occupying transmission bandwidth resources.
[0086] In addition to inserting a flag block to convey the start moment of the forwarding cycle, the embodiments of the present application also provide a method of conveying the start moment of the forwarding cycle by carrying the time difference between the start moment of the second device's message and the start moment of the forwarding cycle where the message is located in the message.
[0087] In an exemplary embodiment, the boundary information is the time difference between the start moment of the second device's message and the start moment of the forwarding cycle where the message is located, and step S302 may include:
[0088] Obtain the start moment of the message; determine the start moment of the forwarding cycle of the second device according to the time difference between the start moment of the second device's message and the start moment of the forwarding cycle where the message is located, and the start moment of the message.
[0089] In an exemplary embodiment, the start moment of the message is the receiving moment when the first device receives the message.
[0090] For example, Figure 10 is a schematic diagram of a message carrying the time difference between the start moment of the second device's message and the start moment of the forwarding cycle where the message is located according to the embodiments of the present application. As Figure 10As shown, when the second device forwards a message, the transmission time of the message can occur at any time, and the transmission time of the message does not necessarily fall at the start time of the current forwarding cycle. If the second device carries, in the message, the time difference α between the start time of the message and the start time of the forwarding cycle in which the message is located when forwarding the message, as Figure 10 shown in, message 1 carries the difference α1 between the start time of message 1 and the start time of the forwarding cycle in which message 1 is located, message 2 carries the difference α2 between the start time of message 2 and the start time of the forwarding cycle in which message 2 is located, message 3 carries the difference α3 between the start time of message 3 and the start time of the forwarding cycle in which message 3 is located, and so on.
[0091] When the second device receives a message at the receiving port, it can record the reception time of the message, extract the time difference α between the start time of the message carried in the message and the start time of the forwarding cycle in which the message is located, and calculate the start time of the current forwarding cycle of the second device based on the time difference α.
[0092] In an exemplary embodiment, the carrying positions of the time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located include at least one of the following positions: the first block of the message, the extended field of the message.
[0093] As an example, after the message is encoded with 64 / 66, the message structure can consist of an S code block + several D code blocks + a T code block, where the S code block is the first code block.
[0094] Figure 11 is a schematic diagram of the composition of the S code block according to an embodiment of the present application, as Figure 11 shown, the first 2 bits in the S code block are synchronization header bits, which are "10", byte byte1 is the control word, and the content is "0x78"; the content of bytes byte2 - byte8 is "0x55", which is the content of the time frame preamble bytes; the content of byte byte8 is "0xD5", which is the content of the frame delimiter byte.
[0095] Among them, the content of bytes byte2 - byte8 in the S code block can be any data content, and the preamble and frame delimiter content can be placed at the positions of byte2 - byte8 in the message, and the content is a fixed value.
[0096] As an example, some byte positions of byte2 - byte8 can carry other special information content, such as Figure 11 shown in, the time difference α between the start time of the message and the start time of the forwarding cycle can be carried at byte7.
[0097] Figure 12It is a schematic diagram of carrying the time difference α in the extended field of the message according to the embodiment of the present application. In addition to the way of carrying the time difference α on the S code block, the time difference α can also be carried in the extended field of the message. As Figure 12 , the extended field can also carry the forwarding cycle value where the message is located.
[0098] Step S303, obtain the phase difference of the preset forwarding cycle between devices, and determine the starting moment of the forwarding cycle of the first device according to the preset phase difference and the starting moment of the forwarding cycle of the second device.
[0099] As an example, all devices in the network with a cyclic queuing forwarding mechanism of a specified cycle maintain frequency synchronization. In the case of frequency synchronization, all devices can forward messages according to the same forwarding cycle T time size, and the phase relationship between the starting moments of the forwarding cycles of each device is always stable and constant, that is, the phase relationship between the forwarding cycle of the first device and the forwarding cycle of the second device is also constant.
[0100] As an example, the constant phase difference between the starting moments of the forwarding cycles between devices can be pre-saved in the device. After the device or single board fails and works again, the phase difference of the forwarding cycle between devices can be directly obtained for calculating the starting moment of the forwarding cycle of the downstream device.
[0101] Exemplarily, the first device loads out the preset phase difference of the forwarding cycle between devices, and can determine the starting moment of the forwarding cycle of the first device based on the preset phase difference of the forwarding cycle between devices and the starting moment of the forwarding cycle of the second device. In this way, the phase relationship between the starting moment of the forwarding cycle after the first device fails and the starting moment of the forwarding cycle of the second device can still remain stable, that is, the phase difference of the forwarding cycle before and after the failure is always constant and is not affected by the failure of the device or single board, so as to achieve a stable transmission delay of the customer service in the network.
[0102] In an exemplary embodiment, the phase difference is the phase difference between the starting moment of the forwarding cycle of the first device and the starting moment of the forwarding cycle of the second device.
[0103] For example, as Figure 6 shown, the starting moment of the forwarding cycle T0 of the upstream device 1 can be detected, the starting moment of the forwarding cycle T0 of the downstream device 2 can be detected, and according to the starting moment of the forwarding cycle T0 of the upstream device 1 and the starting moment of the forwarding cycle T0 of the downstream device 2, the phase difference between the starting moment of the forwarding cycle T0 of the upstream device 1 and the starting moment of the forwarding cycle T0 of the downstream device 2 is calculated, and this phase difference is the phase deviation value β of the starting moments of the same forwarding cycle of the upstream device and the downstream device.
[0104] After a failure occurs in the downstream device 2 or a single board of the downstream device 2, after the downstream device 2 resumes operation after the failure, the starting moment of the forwarding cycle of the downstream device 2 can be calculated based on the starting moment of the forwarding cycle of the upstream device 1 and the phase deviation value β between the starting moments of the forwarding cycles of the upstream device 1 and the downstream device 2. The downstream device 2 operates at the calculated starting moment of the forwarding cycle, generates continuous forwarding cycles, and forwards packets according to the forwarding cycles. In this way, the phase relationship between the starting moment of the forwarding cycle of the downstream device 2 and the starting moment of the forwarding cycle of the upstream device 1 after the failure remains a constant value, which is exactly the same as the phase difference before the failure and is not affected by the failure, thereby realizing a stable and unchanged forwarding delay of packets in the downstream device 2.
[0105] As an example, when the first device is operating normally, it can pre-record the starting moment of the forwarding cycle of the second device and the starting moment of the forwarding cycle of the first device, that is, the starting moment of the forwarding cycle of the receiving port of the first device and the starting moment of the forwarding cycle of the sending port of the first device, and measure and calculate the phase difference β between the starting moment of the forwarding cycle of the second device and the starting moment of the forwarding cycle of the first device according to the pre-recorded starting moment of the forwarding cycle of the second device and the starting moment of the forwarding cycle of the first device, that is, the phase difference β between the starting moment of the forwarding cycle of the receiving port of the first device and the starting moment of the forwarding cycle of the sending port of the first device. The first device can record and save the phase difference β.
[0106] Figure 13 It is a schematic diagram for determining the starting moment of the forwarding cycle of the first device based on the flag code block according to an embodiment of the present application. As Figure 13 shown, the starting moment of the forwarding cycle of the first device can be calculated based on the receiving moment of the flag code block and the saved phase deviation value β of the starting moment of the forwarding cycle. A forwarding cycle sequence can be generated according to the calculated starting moment of the forwarding cycle, and packets can be forwarded according to the generated forwarding cycle sequence.
[0107] Figure 14 It is a schematic diagram for determining the starting moment of the forwarding cycle of the first device based on the time difference α according to an embodiment of the present application. As Figure 14 shown, the time difference α between the starting moment of the packet carried in the packet and the starting moment of the forwarding cycle where the packet is located can be extracted. The starting moment of the current forwarding cycle of the second device can be calculated based on the time difference α, and then the starting moment of the forwarding cycle of the first device can be calculated according to the calculated starting moment of the current forwarding cycle of the second device and the saved phase deviation value β of the starting moment of the forwarding cycle. A forwarding cycle sequence can be generated according to the calculated starting moment of the forwarding cycle, and packets can be forwarded according to the generated forwarding cycle sequence.
[0108] In an exemplary embodiment, the message or the flag code block further carries the forwarding cycle value of the forwarding cycle; the step S303 may include:
[0109] Determine the start time of the forwarding cycle of the first device according to the forwarding cycle value, the preset phase difference, and the start time of the forwarding cycle of the second device.
[0110] As an example, when the second device sends a message, it can carry the forwarding cycle value in the flag code block or in the message, and can send it according to the forwarding cycle value within the corresponding forwarding cycle. Among them, the forwarding cycle value can be in any position in the message, and the embodiments of the present application do not limit this here.
[0111] For example, Figure 15 is a schematic diagram of the position of the forwarding cycle value in the message according to the embodiment of the present application. As shown in Figure 15 it can carry the forwarding cycle value in the three-layer extended domain of the message.
[0112] As an example, before forwarding a message to other devices, the device can modify the time forwarding cycle value of the message and uniformly forward the message according to the modified forwarding cycle value. For example, the forwarding cycle value of the message before modification is T1, and the forwarding cycle value after modification is T2. However, the forwarding cycle values carried by each message in the same cycle before modification are the same, and the forwarding cycle values carried by each message after modification are also the same. For example, the first device receives message 1, message 2, and message 3 within the same forwarding cycle, and message 1, message 2, and message 3 respectively carry the same forwarding cycle value T1. Before forwarding message 1, message 2, and message 3 to other devices, the first device modifies the forwarding cycle value to T2. Then, when sending message 1, message 2, and message 3, message 1, message 2, and message 3 respectively carry the same forwarding cycle value T2.
[0113] Exemplarily, the forwarding cycle value can mark the specified receiving queue in the first device. The first device can modify the forwarding cycle value carried by the received message, can put the message into the corresponding receiving queue according to the modified forwarding cycle value, and when the receiving queue is converted into a sending queue, forward the message carrying the modified forwarding cycle value to the next-hop device.
[0114] The messages in the embodiments of the present application are forwarded within a preset fixed forwarding cycle in each device, so that a fixed delay can be achieved when the customer message is forwarded end to end.
[0115] The following further illustrates the forwarding process after modifying the forwarding cycle value of the message through an example.
[0116] Example 2:
[0117] Figure 16 is the timing diagram of packet forwarding before and after modifying the forwarding cycle value according to the embodiment of the present application. As Figure 16 shown, all packets that device 1 can send in the forwarding cycle T0 carry the cycle value T0. These packets are received at the ingress port of device 2. After being processed and delayed inside device 2, the forwarding cycle value carried by the packets is modified to T6, and can be forwarded to device 3 within the T6 cycle in device 2.
[0118] All packets that device 1 can send in the forwarding cycle T1 carry the forwarding cycle value T1. These packets are received at the ingress port of device 2. After being processed and delayed inside device 2, the forwarding cycle value carried by the packets is modified to T7, and are forwarded to device 3 within the T7 cycle in device 2.
[0119] In device 2, there is a one-to-one correspondence between the forwarding cycle value carried by the packets received at the receiving port and the forwarding cycle value sent by the sending port. The receiving port of device 2 can receive the packets with the forwarding cycle value T0 sent by device 1, and send the packets out within the forwarding cycle T6 of device 2. Among them, there is a one-to-one correspondence between cycle T0 and cycle T6; the receiving port of device 2 receives the packets with the forwarding cycle value T1 sent by device 1, and sends the packets out within the forwarding cycle T7 of device 2. There is a correspondence between upstream T1 and downstream T7, maintaining a constant correspondence relationship.
[0120] As an example, the relationship between the forwarding cycle of the upstream device carried by the packets and the forwarding cycle of the downstream device can be set as a forwarding correspondence table entry in advance. When the device forwards the packets, the above-mentioned forwarding correspondence table entry can be configured in each device. The downstream device can modify the packet forwarding label value according to the content of the table entry, and then forward the packets within the corresponding forwarding cycle.
[0121] For example, Figure 17 is the schematic diagram of packet forwarding before and after modifying the forwarding cycle value according to the embodiment of the present application. As Figure 17 shown, the forwarding cycle label value of the packets of device 1 being T0 and the forwarding cycle value of device 2 being T6 are in one-to-one correspondence; the forwarding cycle value of the packets of device 1 being T1 and the forwarding cycle value of device 2 being T7 are in one-to-one correspondence, the forwarding cycle value of the packets of device 1 being T2 and the forwarding cycle value of device 2 being T0 are in one-to-one correspondence, and the forwarding cycle value of the packets of device 1 being T3 and the forwarding cycle value of device 2 being T1 are in one-to-one correspondence.
[0122] Based on the above correspondence relationship, device 1 can carry the forwarding cycle value T0 in the packets, and forward the packets on device 1 according to the T0 cycle.
[0123] When a message on device 1 is sent to device 2, device 2 can modify the forwarding cycle value T0 carried in the message to T6 according to the above corresponding relationship and send it out in the T6 cycle of device 2. The forwarding of the same message in the T0 cycle of the upstream device and the T6 cycle of the downstream device is one-to-one. In this way, the message carrying the cycle T0 value received by the receiving port on device 2 can be directly sent to device 3 according to the T6 cycle in device 2.
[0124] As an example, if the boundary information carried in the message is the time difference α between the starting moment of the message and the start of the forwarding cycle where the message is located, the time difference α and the forwarding cycle value of the forwarding cycle where the message is located can be carried in the extended field of the message; if the boundary information carried in the message is a flag code block, the forwarding cycle value of the forwarding cycle where the message is located can be carried in the flag code block.
[0125] As an example, the first device can calculate the starting moment of the forwarding cycle of the first device based on the forwarding cycle value, the preset phase difference, and the starting moment of the forwarding cycle of the second device.
[0126] Through the above steps, the problem that after a device failure or a board failure in the related art, the faulty device re - establishes a phase relationship with its upstream device, and the delay time of the message jumps is solved. Thus, after the first device returns to normal, it can send messages based on the determined starting moment of the forwarding cycle of the first device, restore the original forwarding cycle phase relationship between devices, and achieve a stable transmission delay of customer services in the network.
[0127] In this embodiment, a method for keeping the forwarding cycle at a constant moment running on the above - mentioned mobile terminal is provided. Figure 18 It is a flowchart of a method for keeping the forwarding cycle at a constant moment according to another embodiment of the present application, as Figure 18 shown. The process includes the following steps:
[0128] Step 1801, send a message to the first device, where the message carries the boundary information of the forwarding cycle where the message is located.
[0129] Exemplarily, the second device deliberately sends the message to the first device within the forwarding cycle of the second device. Among them, the second device can be an upstream device, and the first device can be a downstream device.
[0130] As an example, the message can carry the boundary information of the forwarding cycle where the message is located, and the boundary information can be used to indicate the cycle boundary of the forwarding cycle. For example, the starting moment of the forwarding cycle, the ending moment of the forwarding cycle, the forwarding cycle value, etc.
[0131] In an exemplary embodiment, the boundary information includes at least one of the following information: a flag code block for indicating the start time of the forwarding cycle of the second device, and a time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located.
[0132] In an exemplary embodiment, the boundary information is the flag code block, and step 1801 may include:
[0133] Insert the flag code block at the start time position of the forwarding cycle, and send the flag code block and the message to the first device.
[0134] In an exemplary embodiment, the boundary information is the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located, and step 1801 may include:
[0135] Send a message carrying the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located to the first device.
[0136] In an exemplary embodiment, the carrying positions of the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located include at least one of the following positions: the first block of the message, the extended field of the message.
[0137] In an exemplary embodiment, the types of the flag code block include at least one of the following types: a fault maintenance code block, a combined code block of the first block and the last block of the message.
[0138] In an exemplary embodiment, before sending a message to the first device, it further includes:
[0139] Carry the forwarding cycle value of the forwarding cycle in the message or the flag code block.
[0140] As an example, when the second device sends a message, it may insert the forwarding cycle value in the flag code block or in the message. The second device may send according to the forwarding cycle value within the corresponding forwarding cycle. Among them, the forwarding cycle value may be at any position in the message, and the embodiments of the present application do not limit this here.
[0141] Through the above steps, the first device can obtain the initial moment of the forwarding cycle of the second device based on the boundary information. Thus, after the first device resumes normal operation, it can send packets based on the determined starting moment of its own forwarding cycle, restoring the original phase relationship of the forwarding cycle between devices, solving the problem in related technologies that after a device failure or a single-board failure, the faulty device re-establishes the phase relationship with its upstream device, and the delay time of the packets shows a jump, and realizing stable transmission delay of customer services in the network.
[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.
[0143] In this embodiment, a device for maintaining a constant moment of the forwarding cycle is also provided. This device is used to implement the above embodiments and exemplary embodiments, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0144] Figure 19 is a structural block diagram of a device for maintaining a constant moment of the forwarding cycle according to an embodiment of the present application, applied to a first device, as Figure 19 shown, the device includes:
[0145] A receiving module 1901, configured to receive a packet sent by a second device, where the packet carries boundary information of the forwarding cycle where the packet is located;
[0146] A first determination module 1902, configured to determine the starting moment of the forwarding cycle of the second device according to the boundary information;
[0147] A second determination module 1903, configured to obtain a preset phase difference of the forwarding cycle between devices, and determine the starting moment of the forwarding cycle of the first device according to the preset phase difference and the starting moment of the forwarding cycle of the second device.
[0148] In an exemplary embodiment, the phase difference is the phase difference between the start time of the forwarding cycle of the first device and the start time of the forwarding cycle of the second device.
[0149] In an exemplary embodiment, the boundary information includes at least one of the following information: a flag code block for indicating the start time of the forwarding cycle of the second device, and a time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located.
[0150] In an exemplary embodiment, the boundary information is the time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located, and the first determination module 1902 includes:
[0151] An acquisition sub-module, configured to acquire the start time of the message;
[0152] A first determination sub-module, configured to determine the start time of the forwarding cycle of the second device according to the time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located, and the start time of the message.
[0153] In an exemplary embodiment, the start time of the message is the reception time when the first device receives the message.
[0154] In an exemplary embodiment, the boundary information is the flag code block, and the first determination module 1902 includes:
[0155] A second determination sub-module, configured to determine the start time of the forwarding cycle of the second device according to the reception time of the flag code block.
[0156] In an exemplary embodiment, the flag code block is the flag code block sent by the second device at the start time of the forwarding cycle.
[0157] In an exemplary embodiment, the carrying position of the time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located includes at least one of the following positions: the first block of the message, the extended field of the message.
[0158] In an exemplary embodiment, the types of the flag code block include at least one of the following types: a fault maintenance code block, a combined code block of the first block and the last block of the message.
[0159] In an exemplary embodiment, the message or the flag code block also carries the forwarding cycle value of the forwarding cycle; the second determination module 1903 includes:
[0160] A third determination sub-module, configured to determine the start time of the forwarding cycle of the first device according to the forwarding cycle value, the preset phase difference, and the start time of the forwarding cycle of the second device.
[0161] Figure 20 FIG. 4 is a structural block diagram of a device for maintaining a constant moment of a forwarding cycle according to another embodiment of the present application, which is applied to a second device. As Figure 20 shown, the device includes:
[0162] A sending module 2001, configured to send a message to a first device, where the message carries boundary information of the forwarding cycle where the message is located.
[0163] In an exemplary embodiment, the boundary information includes at least one of the following information: a flag code block for indicating the start time of the forwarding cycle of the second device, and a time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located.
[0164] In an exemplary embodiment, the boundary information is the flag code block, and the sending module 2001 includes:
[0165] A first sending sub-module, configured to insert the flag code block at the start time position of the forwarding cycle, and send the flag code block and the message to the first device.
[0166] In an exemplary embodiment, the boundary information is a time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located, and the sending module 2001 includes:
[0167] A second sending sub-module, configured to send a message carrying a time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located to the first device.
[0168] In an exemplary embodiment, the carrying position of the time difference between the start time of the message of the second device and the start time of the forwarding cycle where the message is located includes at least one of the following positions: the first block of the message, and the extended field of the message.
[0169] In an exemplary embodiment, the types of the flag code block include at least one of the following types: a fault maintenance code block, and a combined code block of the first block and the last block of the message.
[0170] In an exemplary embodiment, it further includes:
[0171] A carrying module, configured to carry the forwarding cycle value of the forwarding cycle in the message or the flag code block before sending the message to the first device.
[0172] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0173] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0174] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical disks that can store computer programs.
[0175] An embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0176] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0177] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.
[0178] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented by a general-purpose computing device. They can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.
[0179] The above are only exemplary embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for maintaining a constant moment of the forwarding period, characterized in that Applied to a first device, the method includes: Receiving a message sent by a second device, the message carrying boundary information of the forwarding cycle in which the message is located; Determining the start time of the forwarding cycle of the second device according to the boundary information; Obtaining a preset phase difference between the forwarding cycles of the devices, and determining the start time of the forwarding cycle of the first device according to the preset phase difference and the start time of the forwarding cycle of the second device.
2. The method according to claim 1, wherein The phase difference is the phase difference between the start time of the forwarding cycle of the first device and the start time of the forwarding cycle of the second device.
3. The method according to claim 1, wherein The boundary information includes at least one of the following: a flag code block for indicating the start time of the forwarding cycle of the second device, a time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located.
4. The method according to claim 3, wherein The boundary information is the time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located. The determining the start time of the forwarding cycle of the second device according to the boundary information includes: Obtaining the start time of the message; Determining the start time of the forwarding cycle of the second device according to the time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located and the start time of the message.
5. The method according to claim 4, wherein The start time of the message is the reception time when the first device receives the message.
6. The method according to claim 3, characterized in that, The boundary information is the flag code block. The first device determining the start time of the forwarding cycle of the second device according to the boundary information includes: Determining the start time of the forwarding cycle of the second device according to the reception time of the flag code block.
7. The method according to claim 6, wherein The flag code block is the flag code block sent by the second device at the start time of the forwarding cycle.
8. The method according to claim 3, characterized in that The carrying position of the time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located includes at least one of the following positions: the first block of the message, the extended field of the message.
9. The method according to claim 3, wherein The types of the flag code block include at least one of the following types: a fault maintenance code block, a combined code block of the first block and the last block of the message.
10. The method according to any one of claims 1-9, characterized in that, The message or the flag code block also carries the forwarding cycle value of the forwarding cycle. The determining the start time of the forwarding cycle of the first device according to the preset phase difference and the start time of the forwarding cycle of the second device includes: Determining the start time of the forwarding cycle of the first device according to the forwarding cycle value, the preset phase difference, and the start time of the forwarding cycle of the second device.
11. A method for keeping a constant moment of a forwarding cycle, characterized in that, Applied to a second device, the method includes: Sending a message to a first device, the message carrying boundary information of the forwarding cycle in which the message is located.
12. The method according to claim 11, wherein The boundary information includes at least one of the following: a flag code block for indicating the start time of the forwarding cycle of the second device, a time difference between the start time of the message of the second device and the start time of the forwarding cycle in which the message is located.
13. The method according to claim 12, wherein The boundary information is the flag code block. The sending a message to the first device includes: Inserting the flag code block at the start time position of the forwarding cycle, and sending the flag code block and the message to the first device.
14. The method according to claim 12, wherein The boundary information is the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located. Sending the message to the first device includes: Sending a message carrying the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located to the first device.
15. The method according to claim 12, characterized in that, The carrying positions of the time difference between the start time of the second device message and the start time of the forwarding cycle in which the message is located include at least one of the following positions: the first block of the message, the extended field of the message.
16. The method according to claim 12, wherein The types of the flag code blocks include at least one of the following types: the fault maintenance code block, the combined code block of the first block and the last block of the message.
17. The method according to any one of claims 11-16, characterized in that, Before sending the message to the first device, it further includes: Carrying the forwarding cycle value of the forwarding cycle in the message or the flag code block.
18. A device for maintaining a constant moment of the forwarding cycle, characterized in that, Applied to the first device, the device includes: A receiving module, configured to receive a message sent by the second device, where the message carries the boundary information of the forwarding cycle; A first determination module, configured to determine the start time of the forwarding cycle of the second device according to the boundary information; A second determination module, configured to obtain a preset phase difference between the forwarding cycles of the devices, and determine the start time of the forwarding cycle of the first device according to the preset phase difference and the start time of the forwarding cycle of the second device.
19. A device for maintaining a constant moment of the forwarding cycle, characterized in that, Applied to the second device, the device includes: A sending module, configured to send a message to the first device, where the message carries the boundary information of the forwarding cycle in which the message is located.
20. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented, or the steps of the method described in any one of claims 11 - 17 are implemented.
21. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method described in any one of claims 1 to 10 are implemented, or the steps of the method described in any one of claims 11 - 17 are implemented.