Message transmission method and system, electronic equipment, storage medium and program product
By dividing the sending port of the Ethernet device into multiple time slots and determining the time slots for client message forwarding based on specially defined messages or code blocks, the problems of uncertain delay and jitter in traditional Ethernet devices are solved, and deterministic client message delivery is achieved.
Patent Information
- Application Number
- CN202410489302.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-10-24
AI Technical Summary
When traditional Ethernet devices forward customer messages, the uncertain processing time leads to uncertain transmission delay and jitter, which cannot meet the transmission delay and jitter requirements of customer messages in industrial production lines and vehicle communications.
The sending port is divided into multiple time slots according to time. The receiving port determines the corresponding time slot for transmission based on the time slot information carried by the specially defined message, code block or customer message, ensuring that the customer message is forwarded at a certain time and limiting the delay time fluctuation to within a time slice.
It achieves fixed delay time and jitter range limits for customer messages, meeting the transmission delay and jitter requirements in industrial production lines and vehicle communications.
Smart Images

Figure CN120834902A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Ethernet technology, and in particular to a message transmission method, system, electronic device, storage medium and program product. Background Art
[0002] Traditional Ethernet devices must perform relevant processing on client messages when forwarding them, such as table lookup, parsing, rate limiting, queuing, caching, and scheduling. Because client messages from all physical ports on an Ethernet device share the device's processing resources, the processing time required for each client message is uncertain, leading to uncertainty in the latency and jitter of client message transmission within the device. The widespread use of Ethernet technology in industrial production lines and vehicles has placed higher demands on the quality of client message transmission, requiring that client message transmission latency and jitter meet certain expectations. However, current Ethernet device solutions for client message transmission clearly cannot meet these latency and jitter requirements. Summary of the Invention
[0003] The present application provides a message transmission method, system, electronic device, storage medium and program product, which are used to solve the problem that when transmitting customer messages based on current Ethernet technology, the transmission delay and jitter requirements cannot be met.
[0004] To solve the above technical problems, this application is implemented as follows:
[0005] In a first aspect, a message delivery method is provided, which is applied to a second device, wherein a sending port of the second device and a sending port of the first device are both divided into a plurality of time slots according to time, including:
[0006] receiving a client message sent by the first device;
[0007] Determining a first time slot used by the first device to send the client message;
[0008] determining a second time slot corresponding to the first time slot from a plurality of time slots of a transmitting port of the second device;
[0009] The client message is sent in the second time slot.
[0010] In a second aspect, a message delivery system is provided, the system including at least a first device and a second device, wherein a sending port of the first device and a sending port of the second device are both divided into a plurality of time slots according to time, wherein:
[0011] The first device sends a client message to the second device;
[0012] The second device receives the customer message, determines a first time slot used by the first device when sending the customer message, determines a second time slot corresponding to the first time slot from a plurality of time slots of a sending port of the second device, and sends the customer message on the second time slot.
[0013] In a third aspect, an electronic device is provided, comprising:
[0014] a processor;
[0015] a memory for storing instructions executable by the processor;
[0016] The processor is configured to execute the instructions to implement the method of the first aspect.
[0017] In a fourth aspect, a computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method of the first aspect.
[0018] In a fifth aspect, a computer program product is provided, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of the method of the first aspect.
[0019] In the embodiments of the present application, the first device and the second device can divide the sending port into a plurality of time slots according to time. After receiving the customer message sent by the first device, the second device can determine a first time slot used by the first device when sending the customer message, then determine a second time slot corresponding to the first time slot from a plurality of time slots of a sending port of the second device, and send the customer message on the second time slot. In this way, for the customer message received on a certain time slot, since it can be sent on the corresponding time slot, the customer message can be forwarded at a determined time, ensuring that the delay time of the customer message is always fixed, and the fluctuation range of the delay time is always limited within a time slice, so that the transmission delay and jitter requirements of the customer message can be met. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0021] Figure 1 is a schematic diagram of the processing process of the customer message when the Ethernet device forwards the customer message in the related art;
[0022] Figure 2 is a flowchart of a packet delivery method according to an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of dividing the sending ports into time slots by the first device and the second device according to an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of sending customer packets by the first device in time slots and forwarding customer packets by the second device in corresponding time slots according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of sending special definition packets at the start boundary position and the end boundary position of a time slot according to an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of sending special definition packets at the start boundary position of a time slot according to an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of sending special definition packets at the end boundary position of a time slot according to an embodiment of the present application;
[0028] Figure 8 is a schematic diagram of the structure of a Pause packet in the related art;
[0029] Figure 9 is a schematic diagram of the structure of a Pause packet according to an embodiment of the present application;
[0030] Figure 10 is a schematic diagram of each code block included in an Ethernet packet in the related art;
[0031] Figure 11 is a schematic diagram of carrying a time slot number in an S code block according to an embodiment of the present application;
[0032] Figure 12 is a schematic diagram of carrying a time slot number in a T code block according to an embodiment of the present application;
[0033] Figure 13 is a schematic diagram of carrying a time slot number in an O code block according to an embodiment of the present application;
[0034] Figure 14 is a schematic diagram of carrying a time slot number in an S code block of a customer packet according to an embodiment of the present application;
[0035] Figure 15 is a schematic diagram of measuring the correspondence between the time slot number of a receiving port and the time slot number of a sending port at the same time by the second device according to an embodiment of the present application;
[0036] Figure 16 This is a schematic diagram of a device in an Ethernet network sending a client message in a time slot according to an embodiment of the present application;
[0037] Figure 17 This is a schematic structural diagram of an electronic device according to an embodiment of the present application;
[0038] Figure 18 It is a structural diagram of a message delivery device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] Traditional Ethernet technology uses a best-effort approach when forwarding client messages, which results in uncertainty in transmission delay and jitter. Figure 1 As shown, Figure 1 This is a schematic diagram of the process of processing a client message when forwarding a client message by an Ethernet device in the related art. Figure 1 In the example, when devices 1 to 4 forward customer messages, taking device 2 as an example, after receiving the customer message from device 1, device 2 can perform table lookup, parsing, rate limiting, queuing, caching, and scheduling on the customer message before forwarding it to device 3. Because device 2 typically has multiple physical ports, and customer messages from these multiple physical ports share processing resources within device 2, the processing time for each physical port on device 2 is uncertain, as is the time to complete processing. This results in uncertain transmission delay and jitter for customer messages within device 2.
[0040] With the widespread use of Ethernet technology in network systems (such as automated production line networks in industrial parks and onboard communication networks in vehicles), some scenarios have placed higher demands on the delivery quality of customer messages, requiring them to meet certain expectations for delivery latency and jitter. For example, these requirements require that customer message delivery latency and jitter meet certain specified parameters. However, as mentioned earlier, traditional Ethernet technology forwards customer messages based on a best-effort approach. This results in uncertain delivery times, and therefore uncertain delivery latency and jitter. Therefore, it cannot meet these requirements.
[0041] The embodiments of the present application provide a message transmission method, system, storage medium, and product program. When transmitting a client message based on traditional Ethernet technology, a first device and a second device can divide the sending port into multiple time slots according to time. After receiving the client message sent by the first device, the second device can determine the first time slot used by the first device to send the client message, and then determine the second time slot corresponding to the first time slot from the multiple time slots of the sending port of the second device, and send the client message in the second time slot. In this way, for a client message received in a certain time slot, since it can be sent out in the corresponding time slot, the client message can be forwarded at a certain time, ensuring that the delay time of the client message is always fixed and the delay time fluctuation range is always limited to a time slice, thereby meeting the transmission delay and jitter requirements for the client message.
[0042] In order to help those skilled in the art better understand the technical solutions of this application, the following will clearly and completely describe the technical solutions of this application in conjunction with the drawings of one or more embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0043] The terms "first," "second," and the like in this application and the claims are used to distinguish similar objects and are not used to describe a particular order or precedence. It should be understood that such terms are interchangeable where appropriate so that this application can be implemented in sequences other than those illustrated or described herein. In addition, the term "and / or" in this application and the claims refers to at least one of the connected objects, and the character " / " generally indicates that the connected objects are in an "or" relationship.
[0044] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0045] Figure 2 It is a flowchart of a message delivery method according to an embodiment of the present application. Figure 2 The message transmission method shown can be applied to the second device, and the sending port of the second device and the sending port of the first device are both divided into multiple time slots (i.e., multiple time slices) according to time. Among them, the first device and the second device are both devices that forward messages based on Ethernet technology, and the first device can be Figure 1 For any of the upstream devices shown, the second device may be a downstream device immediately adjacent to the first device. Figure 2 The message delivery method shown may include the following steps.
[0046] S202: receiving a client message sent by the first device.
[0047] S204: determining a first time slot used by the first device when sending the client message.
[0048] S206: determining a second time slot corresponding to the first time slot from a plurality of time slots of a sending port of the second device.
[0049] S208: sending the client message on the second time slot.
[0050] In the case that the first device and the second device divide the sending port into a plurality of time slots in time, the first device can select one or more time slots to send the client message when sending the client message to the second device. After receiving the client message, the second device can determine the time slot used by the first device when sending the client message, which is represented as the first time slot for convenience of distinction, and the number of the first time slot can be one or more. After determining the first time slot, the second device can determine the time slot corresponding to the first time slot from the sending port, which is represented as the second time slot for convenience of distinction, and the number of the second time slot can be one or more. After determining the second time slot, the second device can send the client message on the second time slot.
[0051] The first device and the second device can divide their respective sending ports into a plurality of time slots in time as shown in Figure 3 . Figure 3 In the embodiment, the Ethernet sending port of the first device is divided into n1+1 time slots in time, which are represented by 0, 1, 2, 3, 4, …, n1 respectively, and each time slot has the same time length, which is T1 (the time unit can be microsecond, millisecond, etc.). The sequence of the time slots can appear periodically with a cycle period of (n1+1)*T1. Similarly, the Ethernet sending port of the second device is divided into n2+1 time slots in time, which are represented by 0, 1, 2, 3, 4, …, n2 respectively, and each time slot has the same time length, which is T2 (the time unit can be microsecond, millisecond, etc.). The sequence of the time slots can appear periodically with a cycle period of (n2+1)*T2. Wherein, T1 and T2 can be the same or different, and n1 and n2 can be the same or different.
[0052] After the first device and the second device divide the sending port into a plurality of time slots in time, for a client, one or more time slots can be selected to send the client message when sending the client message, as shown in Figure 4 . Figure 4In the specific implementation, the first device can select the time slot numbered 0 to send the customer message after dividing the Ethernet sending port into multiple time slots in time. After the first device sends the customer message, the customer message is transmitted to the second device downstream after being delayed by the optical fiber or cable. The second device also divides the Ethernet sending port into multiple time slots in time. After the second device receives the customer message, it is determined that the time slot numbered 0 is used by the first device to send the customer message. When forwarding the customer message, the second device selects the time slot numbered 10 (corresponding to the time slot numbered 0) from the multiple time slots of the sending port to send the customer message. That is, the time slot numbered 0 of the first device sends the customer message in the time slot numbered 10 of the second device. The time slot numbered 0 received by the receiving port of the second device and the time slot numbered 10 sent by the sending port are one-to-one corresponding.
[0053] In this way, since the second device can send the customer message in the corresponding second time slot after receiving the customer message sent by the first device in the first time slot, the customer message can be forwarded at a certain time, the delay time of the customer message is always fixed, the fluctuation range of the delay time is always limited within a time slice, and thus the transmission delay and jitter requirements of the customer message can be met.
[0054] In the above S204, when determining the first time slot used by the first device to send the customer message, the second device can first determine the boundary position and / or time slot identifier (such as time slot number) of the first time slot, and then determine the first time slot according to the boundary position and / or time slot identifier. How the second device determines the first time slot used by the first device to send the customer message will be described in detail below. Since the first device can use one or more time slots to send the customer message of a certain customer when sending the customer message, the number of first time slots can be one or more. For the convenience of understanding and description, the following will take an example of one time slot in the first time slot.
[0055] Optionally, in some embodiments, the second device determining the first time slot used by the first device to send the customer message can include at least one of the following:
[0056] Determining the first time slot used by the first device to send the customer message according to a special definition message;
[0057] Determining the first time slot used by the first device to send the customer message according to the customer message;
[0058] Determining the first time slot used by the first device to send the customer message according to a special definition code block or a special definition code block group.
[0059] That is, the second device can determine the first time slot used by the first device to send the client message according to at least one of the following three: a special definition message, a client message, a special definition code block, or a special definition code block group. The following will be described respectively.
[0060] The special definition message is a non-client message agreed by the first device and the second device and can be used to indicate the first time slot. The special definition message can carry time slot information of the first time slot. When the first device sends a client message to the second device, the first device can send the special definition message to the second device at the same time. In this way, the second device can determine the first time slot according to the special definition message after receiving the special definition message.
[0061] In some embodiments, the special definition message can carry a time slot identifier of the first time slot. When the first device sends the special definition message, the first device can send the special definition message at the boundary position of the first time slot (at this time, the special definition message also carries the boundary position information of the first time slot). In this way, when the second device determines the first time slot used by the first device to send the client message according to the special definition message, the second device can include the following steps:
[0062] determining the occurrence position of the special definition message;
[0063] extracting the time slot identifier carried in the special definition message;
[0064] determining the occurrence position of the special definition message as the boundary position of the first time slot, and determining the time slot identifier carried in the special definition message as the time slot identifier of the first time slot.
[0065] Since the first device sends the special definition message at the boundary position of the first time slot, the occurrence position of the special definition message is the boundary position of the first time slot. After detecting the special definition message, the second device can determine the occurrence position of the detected special definition message as the boundary position of the first time slot. At the same time, after detecting the special definition message, the second device can also extract the time slot identifier carried in the special definition message and determine the time slot identifier as the time slot identifier of the first time slot. In this way, after determining the boundary position and the time slot identifier of the first time slot, the first time slot used by the first device to send the client message can be determined.
[0066] The boundary position can be a start boundary position, or an end boundary position, or a start boundary position and an end boundary position. That is, when the first device sends the special definition packet at the boundary position of the first time slot, the first device can send the special definition packet at the start boundary position of the first time slot, or at the end boundary position of the first time slot, or at the start boundary position and the end boundary position of the first time slot. For the case of sending the special definition packet at the start boundary position and the end boundary position of the first time slot, the second device can directly determine the two boundary positions of the first time slot according to the occurrence position of the special definition packet. For the case of sending the special definition packet at the start boundary position or the end boundary position of the first time slot, since the time slots are continuous, the end boundary position of the previous time slot is the start boundary position of the next time slot, so after detecting the occurrence position of the special definition packet, the occurrence position and the position of the last detected special definition packet can be determined as the two boundary positions of the first time slot (corresponding to the case of sending the special definition packet at the end boundary position of the first time slot by the first device), or the occurrence position and the position of the next detected special definition packet can be determined as the two boundary positions of the first time slot (corresponding to the case of sending the special definition packet at the start boundary position of the first time slot by the first device).
[0067] Please refer to Figures 5 to 7 . Figure 5 In the above embodiment, the sending port can generate the start boundary position information and the end boundary position information of each time slot, the sending port can send the special definition packet at the start boundary position and the end boundary position of the time slot when sending the special definition packet, and the sending port and the receiving port negotiate to determine both the start position information of the time slot and the end position information of the time slot. In this way, after detecting the special definition packet, the receiving port can determine the start position and the end position of each time slot according to the occurrence position of the special definition packet, all the packets between the start position and the end position belong to the same time slot, and the time slot in which the packets are located can be determined according to the time slot identifier carried in the special definition packet at the start position and / or the end position.
[0068] Figure 6In the embodiment, the sending port can only generate the start boundary position information of each time slot, and the sending port can only send the special definition packet at the start boundary position of the time slot when sending the special definition packet. The sending port and the receiving port negotiate to determine that only the start position information of the time slot is determined. In this way, after the receiving port detects the special definition packet, the receiving port can continue to detect the next special definition packet, and the occurrence positions of the two special definition packets are determined as the start boundary position and the end boundary position of the time slot. All the packets between the two special definition packets belong to the same time slot, and the time slot number carried in the special definition packet at the start position of the time slot gives the specific time slot number to which the packets belong. The time slot in which the packets are located can be determined according to the time slot number.
[0069] Figure 7 In the embodiment, the sending port can only generate the end boundary position information of each time slot, and the sending port can only send the special definition packet at the end boundary position of the time slot when sending the special definition packet. The sending port and the receiving port negotiate to determine that only the end position information of the time slot is determined. In this way, after the receiving port detects the special definition packet, the occurrence position of the special definition packet and the position of the last detected special definition packet are determined as the start boundary position and the end boundary position of the time slot. All the packets between the two special definition packets belong to the same time slot, and the time slot number carried in the special definition packet at the end position of the time slot gives the specific time slot number to which the packets belong. The time slot in which the packets are located can be determined according to the time slot number.
[0070] The special definition packet is a special definition non-client packet. In some embodiments, the special definition packet can include at least one of the following:
[0071] The special definition packet is a self-defined packet carrying a special flag.
[0072] The special definition packet is obtained by extending the function of an Ethernet protocol packet.
[0073] The special flag can be previously agreed by the first device and the second device. After receiving the packet, the second device can determine that the packet is a special definition packet if the special flag is detected in the packet. The special definition packet can be an Ethernet packet carrying a special flag. The special definition packet can be obtained by carrying a special flag and a time slot identifier in a normal Ethernet packet. The special flag can include various forms, for example, the feature value of the type field in the Ethernet packet is 0xffff, or the destination address field value in the Ethernet packet is a special destination address value (such as 0xff-ff-ff-ff-ff-ff), which is not limited here.
[0074] The special definition packet can be a packet obtained by extending an Ethernet protocol packet. The Ethernet protocol packet can be a Pause packet, for example, which is used to carry a time window value. In an Ethernet physical interface, a Pause frame can be used to inform a peer device to pause sending packets, so as to limit the sending speed of customer traffic. After receiving the Pause frame, the receiving end starts a flow control operation, and then discards the Pause frame packet. The format of the Pause frame is as shown in Figure 8 Figure 8 In the Pause frame, the destination address field is a fixed value (0x01-80-C2-00-00-01), the type value is 0x8808, and the operation code is 0x0001. The operation parameter is a time length requested by the Pause sender to the receiver to stop sending data frames. The time measurement unit is the time for transmitting 512 bits of data at the current transmission rate. The actual pause time of the receiver is the product of the operation parameter field content and the time for transmitting 512 bits of data at the current transmission rate. In the related art, the operation parameter is usually 0xFFFF, and the pause time is the maximum value. In this embodiment, the operation parameter can be 0x0000 (or other operation values) as a special flag (the Pause frame with the operation parameter of 0x0000 indicates no flow control when flow control is performed), and the Pause packet with the operation parameter of 0x0000 is used as a special definition packet, as shown in Figure 9 The time slot number value (i.e., time slot identifier) can be carried in the reserved field of the Pause packet and sent to the receiver. After receiving the Pause packet with the operation code of 0x0000, the receiver can extract the time slot number in the reserved field, and determine the time slot used by the sender to send customer packets according to the time slot number and the position of the Pause packet.
[0075] The above examples illustrate the form of the special definition packet. In other possible implementation manners, the special definition packet can also be other forms of non-customer packets, as long as the boundary position information of the time slot and the time slot identifier can be transmitted. The form of the special definition packet is not limited herein.
[0076] It should be noted that, since the special definition packet is a non-customer packet used to transmit the boundary position information of the time slot and the time slot identifier, the special definition packet loses its significance after the transmission of the boundary position information of the time slot and the time slot identifier is completed. Therefore, in some embodiments, the second device can discard the special definition packet after determining the first time slot used by the first device to send customer packets according to the special definition packet.
[0077] The special definition code block (may be referred to as a specific code block for short) can be a code block obtained after special definition of the code block. The special definition code block group (may be referred to as a specific code block group for short) is a sequence group composed of a plurality of special definition code blocks. The special definition code block or the special definition code block group can carry the time slot information of the first time slot, and the first device can send the special definition code block or the special definition code block group to the second device at the same time when sending the client message to the second device. In this way, the second device can determine the first time slot used by the first device when sending the client message according to the special definition code block or the special definition code block group after receiving the special definition code block or the special definition code block group.
[0078] In some implementations, the special definition code block or the special definition code block group can carry the time slot identifier of the first time slot, and the first device can send the special definition code block or the special definition code block group at the boundary position of the first time slot when sending the special definition code block or the special definition code block group (the special definition code block or the special definition code block group at this time also carries the boundary position information of the first time slot). In this way, when determining the first time slot used by the first device when sending the client message according to the special definition code block or the special definition code block group, the second device can include:
[0079] determining the occurrence position of the special definition code block or the special definition code block group;
[0080] extracting the time slot identifier carried in the special definition code block or the special definition code block group;
[0081] determining the occurrence position of the special definition code block or the special definition code block group as the boundary position of the first time slot, and determining the time slot identifier carried in the special definition code block or the special definition code block group as the time slot identifier of the first time slot.
[0082] Since the first device sends the special definition code block or the special definition code block group at the boundary position of the first time slot, the occurrence position of the special definition code block or the special definition code block group is the boundary position of the first time slot. The second device can determine the occurrence position of the detected special definition code block or the special definition code block group as the boundary position of the first time slot after detecting the special definition code block or the special definition code block group. At the same time, the second device can also extract the time slot identifier carried in the special definition code block or the special definition code block group after detecting the special definition code block or the special definition code block group, and determine the time slot identifier as the time slot identifier of the first time slot. In this way, the first time slot used by the first device when sending the client message can be determined in the case of determining the boundary position and the time slot identifier of the first time slot.
[0083] The boundary position can be a start boundary position, or an end boundary position, or both the start boundary position and the end boundary position. That is, when the first device transmits the special definition code block or the special definition code block group at the boundary position of the first time slot, the first device can transmit the special definition code block or the special definition code block group at the start boundary position of the first time slot, or at the end boundary position of the first time slot, or at both the start boundary position and the end boundary position of the first time slot. For the case of transmitting the special definition code block or the special definition code block group at both the start boundary position and the end boundary position of the first time slot, the second device can directly determine the two boundary positions of the first time slot according to the occurrence position of the special definition code block or the special definition code block group. For the case of transmitting the special definition code block or the special definition code block group at the start boundary position or the end boundary position of the first time slot, since the time slots are continuous, the end boundary position of the previous time slot is the start boundary position of the next time slot, and thus, after detecting the occurrence position of the special definition code block or the special definition code block group, the occurrence position and the position of the special definition code block or the special definition code block group detected last time can be determined as the two boundary positions of the first time slot (corresponding to the case of transmitting the special definition code block or the special definition code block group at the end boundary position of the first time slot by the first device), or the occurrence position and the position of the special definition code block or the special definition code block group detected next time can be determined as the two boundary positions of the first time slot (corresponding to the case of transmitting the special definition code block or the special definition code block group at the start boundary position of the first time slot by the first device). For details, refer to Figures 5 to 7 The details are not described herein.
[0084] The special definition code block can be a special definition S code block, a D code block, a T code block, or other control code blocks, etc. In the Ethernet standard, 10G rate and higher speed Ethernet messages are first encoded by 64 / 66 before being transmitted, Figure 10 The 64 / 66 encoding rule is stipulated in the Ethernet IEEE 8.2.3 standard. The first two bits in the 66 code block are the sync head bits. If the sync head bits are “01”, it indicates that the code block is a data code block, i.e., a D code block. If the sync head bits are “10”, it indicates that the code block is a control code block. The control code block has many types, and the specific type of the control code block is determined by the content of the first byte position in the control code block (the control code block has S code block, T code block, o code block, and ilde code block). After encoding, the Ethernet message forms a 66-bit length code block stream. Each Ethernet message is composed of one S code block, a plurality of D code blocks, and one T code block after encoding. The structures of the S code block, the D code block, and the T code block (which can be referred to as S block, D block, and T block) can be referred to Figure 10. Wherein, S code block is the first code block of the message, D code block is the middle code block of the message, is a data code block, and is used to carry customer information, and T code block is the last code block of the message. In the 802.3 standard, T code block has 8 different types: T0, T1, T2, T3, T4, T5, T6, T7, wherein, T0 code block does not carry any customer content, T1 code block carries 1 byte of customer content, T2 code block carries 2 bytes of customer content, and so on, T7 code block carries 7 bytes of customer content. Control code block also has ilde code block (abbreviated as I code block, I block, i.e. idle code block), O code block (abbreviated as O block, is a fault maintenance management block).
[0085] Since the shortest message length defined by the Ethernet standard is 64 bytes, the number of D code blocks in the code block sequence stream of an ordinary Ethernet message after encoding should be no less than 4, and if it is less than 4 D code blocks, it is an illegal message code block, which will be discarded by the receiving end after receiving. In this way, the code block stream sequence of 1 S code block + n D code blocks (n is any one of 0, 1, 2, 3) + 1 T code block can be defined as a special definition code block group. For example, the S+T code block stream sequence, or the S+D+T code block stream sequence, or the S+D+D+T code block stream sequence, or the S+D+D+D+T code block stream sequence can be defined as a special definition code block group. The sending port can send a special definition code block group at the boundary position of a time slot when sending a customer message, and carry the time slot identifier of the time slot in the special definition code block group. The receiving port can determine the boundary position of the time slot as the position of the special definition code block group after detecting the special definition code block group, and determine the time slot number carried in the special definition code block group as the time slot number of the time slot.
[0086] As shown in Figure 11 , the S+T code block stream sequence group can be defined as a special definition code block group, and the S code block in the code block group carries the time slot number. The sending port generates a special definition code block group at the boundary position of the first time slot, and the receiving port determines the boundary position of the time slot according to the position of the special definition code block group after detecting the special definition code block group, and extracts the time slot number carried in the S code block, and finally determines the time slot used by the sending port to send the customer message. Wherein, in the case of S+T code block stream sequence group as a special definition code block group, in addition to carrying the time slot number in the S code block of the code block group, the time slot number can also be carried in the T code block, as shown in Figure 12 . The T code block in the S+T code block stream sequence group adopts T1 code block type, and the time slot number can be carried in the T1 code block.
[0087] In some embodiments, in order to reduce the number of code blocks carrying the time slot number, a specially defined single code block can be used to transfer the time slot number. For example, in the 802.3 standard, the O code block is used to transfer fault information, and the structure of the O code block is as followsFigure 13 shown in the upper part of . Figure 13 In the O code block, the first two bits are "10" (indicating a control code block type), the control word in byte 1 is 0x4B (indicating an O code block type), and bytes 2-4 contain three bytes of data: D1, D2, and D3. The first half byte (4 bits) of byte 5 contains the code block sequence value O0, which indicates the code block application type, or subtype. The second half byte of byte 5 and bytes 6-8 in the O code block are all reserved values 0. The four bits of O0 can represent 16 different values, representing 16 subtypes. The current standard already uses 0x0, 0x1, 0x2, 0x5, 0xC, and 0xF. Other values are unused. Therefore, other values can be defined as special definition code block identifiers. For example, an O code block with an O0 sequence value of 0xE can be used to identify a special definition code block. This special definition code block carries slot boundary position information and slot number information. The time slot number is transmitted in the byte position of D1-D3 in the specially defined O code block, such as Figure 13 The time slot number is conveyed in the partial byte position of D3 in the O code block.
[0088] The above examples illustrate the forms of special definition code blocks and special definition code block groups. In other possible implementations, special definition code blocks or special definition code block groups may also be in other forms, as long as they can convey the boundary position information and time slot identifier of the time slot. There is no specific limitation on the form of special definition code blocks or special definition code block groups.
[0089] It should be noted that since the special definition code block or special definition code block group is used to transmit the boundary position information and time slot identifier of the time slot, it loses its meaning after the transmission of the time slot boundary position information and time slot identifier is completed. Therefore, in some embodiments, the second device can discard the special definition code block or special definition code block group after determining the first time slot used by the first device to send the client message based on the special definition code block or special definition code block group.
[0090] In some possible implementation manners, in the case that the first device transmits the special definition packet or the special definition code block or the special definition code block group at the boundary position (the start boundary position, or the end boundary position, or the start and end boundary positions) of the time slot, if there is a client packet to be sent at the boundary position, the first device will not be able to insert and send the special definition packet or the special definition code block or the special definition code block group at the boundary position, and thus the time slot information cannot be transmitted through the special definition packet or the special definition code block or the special definition code block group. In this case, in order to transmit the time slot information, the first device can carry the time slot information of the first time slot in the client packet, that is, the first time slot information is transmitted through the client packet, and the second device can determine the first time slot used by the first device to send the client packet according to the time slot information carried in the client packet.
[0091] In this embodiment, the first device can send multiple client packets in the first time slot, and the first device can carry the time slot information in multiple ways. Alternatively, in some implementation manners, the first device can carry the time slot information in the client packet in the following way: the time slot identifier of the first time slot is carried in each client packet in the first time slot. That is, the first device selects which client packets to send in the first time slot, and carries the time slot identifier of the first time slot in the selected client packets. In this way, when the second device determines the first time slot used by the first device to send the client packet according to the client packet, the second device can include the following steps:
[0092] determining the first time slot used by the first device to send the client packet according to the time slot identifier carried in the client packet.
[0093] Since the first device carries the time slot identifier of the first time slot in all the client packets sent in the first time slot, that is, the client packet directly indicates which time slot the client packet belongs to, the second device can determine which time slot the client packet belongs to according to the time slot identifier carried in the client packet after receiving the client packet and extracting the time slot identifier carried in the client packet. The client packet carrying the time slot identifier of the first time slot is a client packet in the first time slot, and the time slot identifier carried in the client packet is the time slot identifier of the first time slot.
[0094] For example, the first device sends the packet 1 to the packet 10 to the second device in sequence, the packet 1 and the packet 2 carry the time slot number 1, and the packet 3 to the packet 10 carry the time slot number 2. Then, the second device can determine that the first time slot used by the first device to send the packet 1 and the packet 2 is the time slot with the time slot number 1, and the first time slot used by the first device to send the packet 3 to the packet 10 is the time slot with the time slot number 2.
[0095] Optionally, in some embodiments, the manner in which the first device carries the time slot information in the customer message can also be that the first device carries the time slot identifier of the first time slot in the first message of the customer message, the first message being the customer message located at the boundary position of the first time slot in the customer message, that is, the first device can carry the time slot identifier in the customer message sent at the boundary position of the time slot when sending the customer message. In this way, when determining the first time slot used by the first device to send the customer message according to the customer message, the second device can include:
[0096] determining the position at which the first message appears as the boundary position of the first time slot, and determining the time slot identifier carried in the first message as the time slot identifier of the first time slot.
[0097] Since the first device sends the first message at the boundary position of the first time slot, the first message carries the time slot identifier of the first time slot, that is, the position at which the first message appears is the boundary position of the first time slot, and the time slot identifier carried in the first message is the time slot identifier of the first time slot, therefore, after detecting the first message carrying the time slot identifier, the second device can determine the position at which the detected first message appears as the boundary position of the first time slot when determining the first time slot. Meanwhile, the second device can also extract the time slot identifier carried in the first message and determine the time slot identifier as the time slot identifier of the first time slot. In this way, after determining the boundary position and the time slot identifier of the first time slot, the first time slot used by the first device to send the customer message can be determined.
[0098] The boundary position can be a start boundary position, or an end boundary position, or both the start boundary position and the end boundary position. That is, when the first device sends the client message, it can carry the time slot identifier of the first time slot in the client message sent at the start boundary position of the first time slot, or in the client message sent at the end boundary position of the first time slot, or in the client message sent at both the start boundary position and the end boundary position of the first time slot, that is, the first device can send the client message (i.e., the first message) carrying the time slot identifier at the start boundary position and / or the end boundary position of the first time slot. For the case of sending the first message at both the start boundary position and the end boundary position of the first time slot, the second device can directly determine the two boundary positions of the first time slot according to the occurrence position of the first message. For the case of sending the first message at the start boundary position or the end boundary position of the first time slot, since the time slots are continuous, the end boundary position of the previous time slot is the start boundary position of the next time slot, so after detecting the occurrence position of the first message, the occurrence position and the position of the last time when the first message is detected can be determined as the two boundary positions of the first time slot (corresponding to the case of sending the first message at the end boundary position of the first time slot by the first device), or the occurrence position and the position of the next time when the first message is detected can be determined as the two boundary positions of the first time slot (corresponding to the case of sending the first message at the start boundary position of the first time slot by the first device). For details, see Figures 5 to 7 The details are not described here again.
[0099] As described above, the client message of the Ethernet is composed of one S code block, several D code blocks and one T code block. Thus, when the time slot identifier is carried in the client message, optionally, in some embodiments, the time slot identifier can be carried in the S code block of the client message. Specifically, in the Ethernet standard definition, the S code block is composed of 66 bits, and its structure is: "0b10" + "0x78" + 6 "0x55" + 1 "0xD5". The "0b10" + "0x78" field is used to identify the code block as an S code block, and the following 6 "0x55" and 1 "0xD5" content can be used as defined. In the present embodiment, part of the fields in the 6 "0x55" can be used to carry the time slot identifier. For example, the first "0x55" can be used to carry the time slot number, such as Figure 14The time slot identifier can be carried in the S code block of the packet at the time slot boundary position, or can be carried in the S code block of all packets in the time slot. In the case of carrying the time slot identifier by the S code block, the S code block can not only deliver the time slot identifier information, but also deliver the time slot boundary position information, or the time slot identifier can be carried in the S code block of all packets in the time slot. In this case, the S code block directly indicates which time slot each client packet belongs to, and it is no longer necessary to determine which time slot each packet belongs to according to the boundary position information (start position and / or end position) of the time slot, and the boundary position information of the time slot loses its existence significance. For the sending port, it can no longer be necessary to generate and deliver the boundary position information of the time slot, and for the receiving port, it is no longer necessary to detect the boundary position information of the time slot.
[0100] It should be noted that for the above three ways of transmitting the time slot information of the first time slot (i.e., the three ways of transmitting the time slot information of the first time slot through the special definition packet, transmitting the time slot information of the first time slot through the customer packet, and transmitting the time slot information of the first time slot through the special definition code block or the special definition code block group), in actual application, the first device and the second device can agree on which way to transmit the time slot information of the first time slot, so that the first device can transmit the time slot information of the first time slot to the second device in the agreed manner when sending the customer packet to the second device, and the second device can determine the first time slot based on the agreed manner after receiving the customer packet. For example, if the first device and the second device agree to transmit the time slot information of the first time slot through the special definition packet, the first device can send the special definition packet at the boundary position of the first time slot when sending the customer packet on the first time slot (in the case that there is no customer packet to be sent at the boundary position), and the second device can detect the special definition packet and determine the first time slot according to the detected special definition packet when receiving the customer packet. If the first device and the second device agree to transmit the time slot information of the first time slot through the special definition code block or the special definition code block group, the first device can send the special definition code block or the special definition code block group at the boundary position of the first time slot when sending the customer packet on the first time slot (in the case that there is no customer packet to be sent at the boundary position), and the second device can detect the special definition code block or the special definition code block group and determine the first time slot according to the detected special definition code block or the special definition code block group when receiving the customer packet. If the first device and the second device agree to transmit the time slot information of the first time slot through the customer packet, the first device can carry the time slot identifier in the customer packet sent at the time slot boundary position of the first time slot, or carry the time slot identifier in all customer packets within a time slot, and the second device can detect whether the time slot identifier is carried in the customer packet when receiving the customer packet, and determine the first time slot according to the detection result. Of course, the first device and the second device can also not agree on the transmission manner of the time slot information, so that the first device can flexibly transmit the time slot information according to the actual business situation by using the special definition packet and / or the customer packet, and the second device can detect the special definition packet, the special definition code block or the special definition code block group, and the customer packet when receiving the packet, and determine the first time slot according to the detection result. Here, the transmission manner of the time slot information is not limited.
[0101] In the above S206, when the second device determines the second time slot corresponding to the first time slot from the plurality of time slots of the sending port, in some embodiments, it can include:
[0102] According to the first correspondence relationship of the time slot identifier, the target time slot identifier corresponding to the time slot identifier of the first time slot is determined;
[0103] The time slot corresponding to the target time slot identifier in the multiple time slots of the sending port of the second device is determined as the second time slot.
[0104] The first correspondence is a correspondence between the time slot identifier of the sending port of the first device and the time slot identifier of the sending port of the second device. After determining the first time slot used by the first device to send the client message, the second device can obtain the time slot identifier of the first time slot. After obtaining the time slot identifier of the first time slot, when determining the second time slot corresponding to the first time slot, the second device can determine the time slot identifier corresponding to the time slot identifier of the first time slot (i.e., the target time slot identifier) according to the first correspondence, and then determine the time slot corresponding to the target time slot identifier in the multiple time slots of the sending port of the second device as the second time slot. For example, if the time slot identifier of the first time slot is 0, the time slot identifier corresponding to the time slot identifier 0 is determined to be 10 based on the first correspondence, and in the multiple time slots of the sending port of the second device, the time slot with the time slot identifier 10 is time slot 10, then the second device can determine time slot 10 as the second time slot.
[0105] The first correspondence between the time slot identifiers can be determined or configured by the second device. Specifically, the first correspondence can be determined by the second device according to the receiving time slot identifier of the receiving port of the second device, the delay requirement of the client service, the delay time of the client service in the second device, and the second correspondence, which is a correspondence between the receiving time slot identifier of the receiving port of the second device and the sending time slot identifier of the sending port at the same time. The second correspondence is obtained by measurement by the second device. That is, when determining or configuring the first correspondence, the second device can first measure the correspondence between the receiving time slot identifier of the receiving port of the second device and the sending time slot identifier of the sending port at the same time, and then determine the first correspondence between the time slot identifier of the sending port of the first device and the time slot identifier of the sending port of the second device in combination with the receiving time slot identifier of the receiving port of the second device, the delay requirement of the client service, and the delay time of the client service in the second device.
[0106] Alternatively, in some embodiments, the second device can determine or configure the first correspondence by the following method:
[0107] In the process of forwarding the client message, the second device can determine the correspondence (i.e., the second correspondence described above) between the time slot number of the message received by the receiving port at the same time (which can be represented as the time slot number of the receiving port or the receiving time slot number) and the time slot number of the message sent by the sending port (which can be represented as the time slot number of the sending port or the sending time slot number) according to the forwarding situation of the message, such as Figure 15The second device can measure the correspondence between the receiving time slot number of the receiving port and the sending time slot number of the sending port at the same time of the device. At a specific time, the time of the receiving time slot 0 number of the receiving port and the part of the time of the sending time slot 6 number or the part of the time of the sending time slot 7 number of the sending port occur at the same time. The meaning is that when the receiving port of the second device receives the customer message in the receiving time slot 0 number, the sending port is sending the message in the sending time slot 6 number or is sending the message in the sending time slot 7 number at this time. The receiving port receives a plurality of customer messages in the time slot 0 number, and cannot send in the sending time slot 6 number (the message is received in the time segment after time slot 0). For the message received at the last time in the time slot 0 number of the receiving port, although it can be sent in the sending time slot 7 number (without considering the time delay of the message in the device), it will also fall into the last narrow time segment of the sending time slot 7 number. Considering the transmission delay caused by the processing links such as analysis, table lookup and modification of the message in the device, the message may miss the last narrow time segment of the sending time slot 7 number when it reaches the sending port, and can only be arranged to be sent in the sending time slot 8 number (in the case of small internal delay of the device). That is, the receiving port receives the message in the time slot 0 number, and in the case of small internal delay of the device, the safe and reliable sending time slot of the sending port is the time slot 8 number and other time slots after the time slot 8 number. The second device measures the correspondence between the receiving time slot identifier of the receiving port at the current time and the sending time slot identifier of the sending port at the current time, which provides a reference basis for the receiving port to receive the message and select a safe and reliable sending time slot number of the sending port. Figure 15 The correspondence (i.e., the second correspondence) measured by the second device can be as shown in Table 1 below.
[0108] Table 1
[0109]
[0110]
[0111] As can be seen from Table 1, the receiving time slot 0 number of the receiving port in the second device corresponds to the sending time slot 6 number and the sending time slot 7 number of the sending port. Similarly, the receiving time slot 1 number of the receiving port corresponds to the sending time slot 7 number and the sending time slot 8 number of the sending port, the receiving time slot 2 number of the receiving port corresponds to the sending time slot 8 number and the sending time slot 9 number of the sending port, and so on.
[0112] The above table 1 is a correspondence table of the time slot number of the receiving port and the sending time slot number of the sending port at the same time, taking the time slot of the receiving port as the reference. In other embodiments, the correspondence table of the time slot number of the receiving port and the sending time slot number of the sending port at the same time can also be given, taking the time slot of the sending port as the reference, as shown in table 2.
[0113] Table 2
[0114] Slot number of the receive port Slot number of the transmit port 0、1 7 1、2 8 2、3 9 3、4 10 4、5 11 5、6 12 …… ……
[0115] In addition to giving the correspondence of the time slot number of the receiving port and the sending time slot number of the sending port at the same time in the form of a table, the correspondence can also be given in the form of a formula. For example, the correspondence shown in table 1 can be represented by the following formula:
[0116] (receiving end time slot number + 6) <= sending end time slot number <= (receiving end time slot number + 7).
[0117] After determining the correspondence between the time slot number of the receiving port and the time slot number of the sending port at the same time, the second device can determine the correspondence between the time slot identification of the sending port of the first device and the time slot identification of the sending port of the second device, in combination with the receiving time slot identification of the receiving port of the second device, the delay requirement of the customer service, and the delay time of the customer service in the second device. Specifically, all devices in the Ethernet network can measure and determine the correspondence between the time slot number of the receiving port and the time slot number of the sending port at the same time based on the same method, and then the Ethernet network has the technical basis for deterministic service bearing. For a certain customer, the transmission path for the customer service and the bearing time slot number of each device on the path can be planned on the network according to the customer service requirement (transmission path, delay time requirement, etc.), the bearing time slot of the customer service on which the customer service is carried on the source device is determined, the source device is the first bearing device of the customer, the next device downstream is the second bearing device, and the second bearing device plans and arranges the sending time slot number of the sending port of each device for the customer service according to the receiving time slot number of the customer message, the delay requirement of the customer service, the delay time of the customer service in the device, the correspondence between the time slot number of the receiving port and the time slot number of the sending port at the same time, and other information, thereby obtaining the correspondence between the sending time slot number of the sending port of the upstream device of the device and the sending time slot number of the sending port of the device (i.e., the first correspondence) for each device.
[0118] After each device in the Ethernet determines the correspondence between the time slot number of the sending port of the upstream device and the time slot number of the sending port of the device, after receiving the customer message sent by the upstream device and determining the time slot used by the upstream device, the corresponding time slot can be determined from the sending port of the device based on the correspondence, and the customer message is sent on the corresponding time slot. As shown in Figure 16 The time slot number 0 of the sending port of the device 1 and the time slot number 2 of the sending port of the device 2 have a correspondence, the time slot number 2 and the time slot number 4 of the sending port of the device 3 have a correspondence, and the time slot number 4 and the time slot number n4 of the sending port of the device 4 have a correspondence, so when the device 1, the device 2, the device 3 and the device 4 forward the customer message, the device 1 selects the time slot 0 number to carry the sending, the device 2 selects the time slot 2 number to carry the sending, the device 3 selects the time slot 4 number to carry the sending, and the device 4 selects the time slot n4 number to carry the sending.
[0119] In the above S208, after the second device determines the second time slot, when sending the customer message on the second time slot, in some embodiments, the following at least one can be included:
[0120] generating the second time slot; generating a special definition message; sending the special definition message at the time slot boundary of the second time slot and sending the customer message on the second time slot;
[0121] generating the second time slot; adding the time slot identifier of the second time slot in the customer message; sending the customer message on the second time slot.
[0122] That is, when the second device sends the customer message on the second time slot, the second time slot can be generated first, and then the customer message is sent on the second time slot. In addition, in the case that the second device has a downstream device, in order to facilitate the downstream device to determine the second time slot used by the second device to send the customer message, when the second device sends the customer message on the second time slot, the second device can also pass the time slot information of the second time slot to the downstream device.
[0123] The second device can transmit the time slot information of the second time slot by at least one of a special definition packet and a customer packet. In the case of transmitting the time slot information of the second time slot by the special definition packet, the second device can first generate the special definition packet carrying the time slot identifier of the second time slot, and then transmit the special definition packet at the boundary position (which can be the start boundary position, or the end boundary position, or the start and end boundary positions) of the second time slot when transmitting the customer packet on the second time slot. In the case of transmitting the time slot information of the second time slot by the customer packet, the second device can add the time slot identifier of the second time slot in the customer packet when transmitting the customer packet on the second time slot, and then transmit the customer packet carrying the time slot identifier of the second time slot to the downstream device. When adding the time slot identifier of the second time slot in the customer packet, the time slot identifier can be added in each customer packet transmitted in the second time slot, or the time slot identifier can be added only in the customer packet transmitted at the boundary position (which can be the start boundary position, or the end boundary position, or the start and end boundary positions) of the second time slot. The specific implementation of the second device transmitting the time slot information of the second time slot can refer to the specific implementation of the first device transmitting the time slot information of the first time slot, and the specific implementation of the downstream device of the second device determining the second time slot after receiving the customer packet can refer to the specific implementation of the second device determining the first time slot, which will not be described in detail here.
[0124] In this way, since the second device can determine the first time slot carrying the customer packet after receiving the customer packet, and forward the customer packet on the corresponding second time slot, and transmit the time slot information of the second time slot to the next device, so that the next device can also forward the customer packet on the corresponding time slot, finally, each sending device in the Ethernet network can send the customer packet in the determined time slot, each receiving device can receive in the fixed time slice, and send again in the fixed time slice, even if the delay time of the customer packet inside the device changes (the maximum delay time of the packet needs to be tolerated when configuring the sending time slot), but the customer packet is sent in the fixed time slice (time slot number) at the sending port, therefore, the delay time of the packet is always fixed, the fluctuation range of the delay time is limited within one time slice, and the jitter range is a fixed value, so that the transmission requirement of the deterministic performance index of the packet delay time and delay jitter can be met.
[0125] Based on the technical solution provided in the embodiments of the present application, the first device and the second device can divide the sending ports into multiple time slots according to time, the second device can determine the first time slot used by the first device to send the customer message after receiving the customer message sent by the first device, then determine the second time slot corresponding to the first time slot in the multiple time slots of the sending port of the second device, and send the customer message in the second time slot. In this way, for the customer message received in a certain time slot, since the customer message can be sent in the corresponding time slot, the customer message can be forwarded at a determined time, the delay time of the customer message is always fixed, the fluctuation range of the delay time is always limited within a time slice, so that the transmission delay and jitter requirements of the customer message can be met.
[0126] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than the order in which they are recited and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0127] Figure 17 is a structural schematic diagram of an electronic device according to an embodiment of the present application. Please refer to Figure 17 At the hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The memory can include an internal memory such as a random-access memory (RAM), and can also include a non-volatile memory such as at least one disk memory. Of course, the electronic device can also include other hardware required by the business.
[0128] The processor, the network interface, and the memory can be connected to each other through an internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, Figure 17 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0129] The memory is used to store programs. Specifically, the program may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.
[0130] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, forming a message delivery device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
[0131] receiving a client message sent by the first device;
[0132] Determining a first time slot used by the first device to send the client message;
[0133] Determine a second time slot corresponding to the first time slot from a plurality of time slots of a transmitting port of a second device;
[0134] The client message is sent in the second time slot.
[0135] The above application Figure 17 The methods performed by the message delivery device disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or by software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The methods, steps, and logic block diagrams disclosed in this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0136] The electronic device may also perform Figure 2 Method, and realize the message delivery device in Figure 2 The functions of the illustrated embodiments will not be described in detail in this application.
[0137] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0138] The present application also proposes a computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions that, when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to execute Figure 2 The method of the embodiment shown is specifically used to perform the following operations:
[0139] receiving a client message sent by the first device;
[0140] Determining a first time slot used by the first device to send the client message;
[0141] Determine a second time slot corresponding to the first time slot from a plurality of time slots of a transmitting port of a second device;
[0142] The client message is sent in the second time slot.
[0143] The present application also proposes a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute some or all of the steps in the above-mentioned message delivery method embodiment.
[0144] Figure 18 This is a schematic diagram of the structure of a message delivery device 180 according to an embodiment of the present application. Figure 18 In a software implementation, the message delivery device 180 may include: a receiving module 181, a first determination module 182, a second determination module 183, and a sending module 184, wherein:
[0145] Receiving module 181, receiving a client message sent by the first device;
[0146] A first determining module 182 determines a first time slot used by the first device to send the client message;
[0147] A second determining module 183 determines a second time slot corresponding to the first time slot from a plurality of time slots of a transmitting port of a second device;
[0148] The sending module 184 sends the client message on the second time slot.
[0149] In some embodiments, the first determining module 182 determines the first time slot used by the first device to send the client message, including at least one of the following:
[0150] determining the first time slot used by the first device to send the client message according to a special definition message;
[0151] determining the first time slot used by the first device to send the client message according to the client message;
[0152] determining the first time slot used by the first device to send the client message according to a special definition code block or a special definition code block group.
[0153] In some embodiments, the special definition message is sent by the first device at a boundary position of the first time slot, and the special definition message carries the time slot identification of the first time slot; the first determining module 182 determines the first time slot used by the first device to send the client message according to a special definition message, including:
[0154] determining the occurrence position of the special definition message;
[0155] extracting the time slot identification carried in the special definition message;
[0156] determining the occurrence position of the special definition message as the boundary position of the first time slot, and determining the time slot identification carried in the special definition message as the time slot identification of the first time slot.
[0157] In some embodiments, the special definition message includes at least one of the following:
[0158] the special definition message is a self-defined message carrying a special flag;
[0159] the special definition message is obtained by functionally extending an Ethernet protocol message.
[0160] In some embodiments, the special definition code block or the special definition code block group is sent by the first device at a boundary position of the first time slot, and the special definition code block or the special definition code block group carries the time slot identification of the first time slot; the first determining module 182 determines the first time slot used by the first device to send the client message according to a special definition code block or a special definition code block group, including:
[0161] determining the occurrence position of the special definition code block or the special definition code block group;
[0162] extracting the time slot identifier carried in the special definition code block or the special definition code block group;
[0163] determining the occurrence position of the special definition code block or the special definition code block group as the boundary position of the first time slot, and determining the time slot identifier carried in the special definition code block or the special definition code block group as the time slot identifier of the first time slot.
[0164] In some embodiments, the time slot identifier of the first time slot is carried in each of the customer messages in the first time slot; the first determining module 182 determines the first time slot used by the first device to send the customer messages according to the customer messages, including:
[0165] determining the first time slot used by the first device to send the customer messages according to the time slot identifier carried in the customer messages.
[0166] In some embodiments, the time slot identifier of the first time slot is carried in the first message of the customer messages, and the first message is located at the boundary position of the first time slot; the first determining module 182 determines the first time slot used by the first device to send the customer messages according to the customer messages, including:
[0167] determining the occurrence position of the first message as the boundary position of the first time slot, and determining the time slot identifier carried in the first message as the time slot identifier of the first time slot.
[0168] In some embodiments, the customer messages include S code blocks, D code blocks and T code blocks, and the time slot identifier of the first time slot is carried in the S code block.
[0169] In some embodiments, the second determining module 183 determines the second time slot corresponding to the first time slot from a plurality of time slots of a sending port of the second device, including:
[0170] determining a target time slot identifier corresponding to the time slot identifier of the first time slot according to a first correspondence relationship of time slot identifiers;
[0171] determining, as the second time slot, the time slot corresponding to the target time slot identifier from a plurality of time slots of a sending port of the second device.
[0172] In some embodiments, the first correspondence relationship is determined according to the receiving time slot identifier of a receiving port of the second device, the delay requirement of customer services, the delay time of customer services in the second device and a second correspondence relationship, and the second correspondence relationship is the correspondence relationship between the receiving time slot identifier of the receiving port of the second device and the sending time slot identifier of the sending port of the second device at the same time.
[0173] In some embodiments, the sending module 184 sends the customer message on the second time slot, including at least one of:
[0174] generating the second time slot; generating a special definition message; sending the special definition message at a time slot boundary of the second time slot and sending the customer message on the second time slot;
[0175] generating the second time slot; adding a time slot identifier of the second time slot in the customer message; and sending the customer message on the second time slot.
[0176] In some embodiments, the boundary position includes at least one of a start boundary position and an end boundary position.
[0177] The message delivery device 180 provided in the present application can also execute the method of Figure 2 , and realize the functions of the message delivery device 180 in the embodiments shown in Figure 2 , which will not be repeated here.
[0178] The present application also provides a message delivery system, which includes at least a first device and a second device, and the sending port of the first device and the sending port of the second device are both divided into multiple time slots according to time, wherein:
[0179] The first device sends a customer message to the second device;
[0180] The second device receives the customer message; determines a first time slot used by the first device to send the customer message; determines a second time slot corresponding to the first time slot from the multiple time slots of the sending port of the second device; and sends the customer message on the second time slot.
[0181] In the present embodiment, the specific implementation of each step performed by the first device and the specific implementation of each step performed by the second device can refer to the specific implementation of the corresponding steps in the embodiments shown in Figure 2 , and can realize the same technical effects, which will not be described in detail here.
[0182] In summary, the above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0183] The systems, apparatuses, modules, or units disclosed in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0184] The computer readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carriers.
[0185] It should also be noted that the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0186] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, the system embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments. The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, the system embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.
Claims
1. A message transmission method applied to a second device, wherein a sending port of the second device and a sending port of a first device are each divided into a plurality of time slots according to time, and the method comprises: receiving a client message sent by the first device; determining a first time slot used by the first device when sending the client message; determining a second time slot corresponding to the first time slot from the plurality of time slots of the sending port of the second device; and sending the client message on the second time slot. 2.The method of claim 1, wherein the determining of the first time slot used by the first device when sending the client message comprises at least one of the following: determining the first time slot used by the first device when sending the client message according to a special definition message; determining the first time slot used by the first device when sending the client message according to the client message; and determining the first time slot used by the first device when sending the client message according to a special definition code block or a special definition code block group. The determining of the first time slot used by the first device when sending the client message according to a special definition message comprises: determining a position of occurrence of the special definition message; extracting a time slot identifier carried in the special definition message; determining the position of occurrence of the special definition message as a boundary position of the first time slot, and determining the time slot identifier carried in the special definition message as a time slot identifier of the first time slot. 4.The method of claim 2 or 3, wherein the special definition message comprises at least one of the following: the special definition message is a self-defined message carrying a special flag; and the special definition message is obtained by function extension on an Ethernet protocol message. The determining of the first time slot used by the first device when sending the client message according to a special definition code block or a special definition code block group comprises: determining a position of occurrence of the special definition code block or the special definition code block group; extracting a time slot identifier carried in the special definition code block or the special definition code block group; determining the position of occurrence of the special definition code block or the special definition code block group as a boundary position of the first time slot, and determining the time slot identifier carried in the special definition code block or the special definition code block group as a time slot identifier of the first time slot. 6.The method of claim 2, wherein a time slot identifier of the first time slot is carried in each of the client messages in the first time slot; and the determining of the first time slot used by the first device when sending the client message according to the client message comprises: determining the first time slot used by the first device when sending the client message according to the time slot identifier carried in the client message. 7.The method of claim 2, wherein a time slot identifier of the first time slot is carried in a first message of the client message, and the first message is located at a boundary position of the first time slot; and the determining of the first time slot used by the first device when sending the client message according to the client message comprises: determining the position of occurrence of the first message as the boundary position of the first time slot, and determining the time slot identifier carried in the first message as the time slot identifier of the first time slot. 3. The method of claim 2, wherein the special definition packet is sent by the first device at a boundary position of the first time slot, and wherein the time slot identification of the first time slot is carried in the special definition packet. 5.The method of claim 2, wherein the special definition code block or the special definition code block group carries a time slot identification of the first time slot, and is transmitted by the first device at a boundary position of the first time slot. 8. The method of claim 6 or 7, wherein the client packet comprises an S code block, a D code block and a T code block, and the S code block carries the time slot identifier of the first time slot.
9. The method of claim 1, wherein determining the second time slot corresponding to the first time slot from the multiple time slots of the sending port of the second device comprises: determining a target time slot identifier corresponding to the time slot identifier of the first time slot according to a first correspondence relationship between time slot identifiers; and determining the second time slot from the multiple time slots of the sending port of the second device corresponding to the target time slot identifier.
10. The method of claim 9, wherein the first correspondence relationship is determined according to a receiving time slot identifier of a receiving port of the second device, a delay requirement of the client service, a delay time of the client service in the second device and a second correspondence relationship between the receiving time slot identifier of the receiving port of the second device and a sending time slot identifier of the sending port of the second device at the same time.
11. The method of claim 1, wherein sending the client packet on the second time slot comprises at least one of: generating the second time slot; generating a special definition packet; sending the special definition packet at a time slot boundary of the second time slot and sending the client packet on the second time slot; adding the time slot identifier of the second time slot in the client packet; and sending the client packet on the second time slot.
12. The method of claim 3, 5, 7 or 11, wherein the boundary position comprises at least one of a start boundary position and an end boundary position.
13. A packet delivery system, the system comprising at least a first device and a second device, a sending port of the first device and a sending port of the second device are each divided into multiple time slots, wherein: the first device sends a client packet to the second device; the second device receives the client packet; determines a first time slot used by the first device to send the client packet; determines a second time slot corresponding to the first time slot from the multiple time slots of the sending port of the second device; and sends the client packet on the second time slot.
14. An electronic device, comprising: a processor; a memory storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 12. generating the second time slot; 15. A computer readable storage medium storing instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of claims 1 to 12.
16. A computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of the method of any one of claims 1 to 12.