Communication devices and message transmission methods

By synchronizing the timestamps of each interface in the communication device and determining the message sequence number, the problem of message out-of-order delivery in multi-interface communication is solved, and the full utilization of multi-interface bandwidth and correct message processing are achieved.

CN117480768BActive Publication Date: 2026-11-17HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180099253.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2026-11-17
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

As the number of interfaces increases, the out-of-order nature of network packets in communication devices increases. How can we ensure the timing of packets between multiple interfaces to fully utilize bandwidth?

Method used

By synchronizing the timestamps of each interface in the communication device and determining the sequence number of the message based on the timestamp, the timing of messages between multiple interfaces is ensured.

Benefits of technology

It achieves message timing synchronization in multi-interface communication devices, avoiding the situation where only one interface can be used due to the need to preserve order, making full use of the bandwidth of multiple interfaces, and ensuring the correct processing of subsequent messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117480768B_ABST
    Figure CN117480768B_ABST
Patent Text Reader

Abstract

This disclosure provides a communication device and a message transmission method. The communication device includes a first interface and a second interface, wherein the first interface is configured to: acquire a first message from within the communication device, the first message having a first timestamp; acquire a second timestamp of a second message from the second interface; determine a sequence number of the first message based at least on the first and second timestamps; and send the first message based on the sequence number. In this manner, the first interface of the communication device can determine the global sequence number of the acquired message and send the message based on the sequence number, thus ensuring the timing of messages from multiple interfaces. Furthermore, multiple interfaces can synchronize their timestamps, avoiding the limitation of using only one interface's state due to message ordering requirements. This ensures message timing while fully utilizing the bandwidth of multiple interfaces, thereby guaranteeing correct subsequent message processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed herein primarily relate to the field of chips, and more specifically, to a communication device and a message transmission method. Background Technology

[0002] With the development of artificial intelligence, cloud computing, and other technologies, communication devices can no longer meet the demands of computing power and large data transmission by relying on a single interface. Therefore, it is an inevitable trend to set up multiple interfaces on communication devices and utilize the message rate of multiple interfaces simultaneously.

[0003] However, as the number of interfaces increases, the out-of-order nature of network packets transmitted by the communication device also increases. Ensuring the timing of packets transmitted across multiple interfaces is one of the problems that needs to be solved. Summary of the Invention

[0004] Embodiments of this disclosure provide a communication device capable of ensuring the timing of messages between multiple interfaces.

[0005] In a first aspect of this disclosure, a communication device is provided, including a first interface and a second interface, wherein the first interface is configured to: acquire a first message from within the communication device, the first message having a first timestamp; acquire a second timestamp of a second message from the second interface; determine a sequence number of the first message based at least on the first timestamp and the second timestamp; and send the first message based on the sequence number of the first message.

[0006] In this way, the first interface of the communication device can obtain the second timestamp of the message from the second interface, determine the sequence number of the message based on the first and second timestamps, and send the message based on the sequence number. This ensures the timing of messages from multiple interfaces. In this manner, multiple interfaces in the embodiments of this disclosure can synchronize their timestamps, avoiding the limitation of using only one interface's state due to message ordering requirements. Therefore, the embodiments of this disclosure, while fully utilizing the bandwidth of multiple interfaces, ensure the timing of messages and thus guarantee the correct processing of subsequent messages.

[0007] In some embodiments of the first aspect, the first interface is configured to: acquire a first message having a first timestamp during a first time period; acquire a second timestamp of a second message from a second interface during a second time period, the second message being acquired by the second interface during the first time period; and determine the sequence number of the first message based at least on the first timestamp and the second timestamp during a third time period.

[0008] Optionally, the first interface may acquire a first message with a first timestamp in a first time period; acquire a second message with a second timestamp from the second interface in a second time period, and determine the sequence number of the first message based at least on the first and second timestamps, wherein the second message is acquired by the second interface in the first time period; and send the first message in a third time period.

[0009] In some embodiments of the first aspect, the second time period immediately follows the first time period, and the third time period immediately follows the second time period.

[0010] In some embodiments of the first aspect, the length of the second time period is less than or equal to the length of the first time period, and the length of the third time period is less than or equal to the length of the first time period.

[0011] Thus, since the amount of data when the interface obtains the message is large, while the amount of data for obtaining the timestamp is small and the time for determining the sequence number is short, the first time period in this embodiment of the disclosure is the longest, thereby ensuring sufficient acquisition of the message and avoiding waste of time resources.

[0012] In some embodiments of the first aspect, the first time period, the second time period, and the third time period have equal durations. The first interface can periodically process messages.

[0013] In some embodiments of the first aspect, the first interface may perform three operations on a message within a time period. Specifically, within a certain time period, the first interface acquires a first message having a first timestamp; acquires a second timestamp of a second message from a second interface, and determines the sequence number of a message acquired in the previous time period based at least on the timestamp and the second timestamp of a message acquired by the first interface in the previous time period, wherein the second message was acquired by the second interface in the previous time period of the specific time period; and sends a third message based on the sequence number of a third message determined in the previous time period, wherein the third message was acquired by the first interface in the time period preceding the previous time period.

[0014] In this way, the first interface can perform pipelined processing on the messages. That is, it can perform segmented operations within a time period: performing an acquisition operation on the first part of the message (e.g., obtaining the timestamp of the message to be sent), performing a synchronization operation on the second part of the message (e.g., obtaining timestamps from other interfaces and determining the sequence number), and performing a sending operation on the third part of the message (e.g., sending based on the determined sequence number). This enables full utilization of the interface, thereby improving the efficiency of interface processing.

[0015] In some embodiments of the first aspect, the first interface is further configured to provide a first timestamp of the first message to the second interface.

[0016] This enables timestamp synchronization between multiple interfaces, making it easier for each interface to determine the sequence number of the message.

[0017] In some embodiments of the first aspect, the first interface is configured to: determine the time order of the first timestamp and the second timestamp; and determine a sequence number based on the position of the first timestamp in the time order.

[0018] In this way, the first interface can determine the sequence number of the message at the first interface based on all the timestamps of multiple interfaces, which can represent the timing of global messages and ensure the correct processing of messages.

[0019] In some embodiments of the first aspect, the second interface is configured to: acquire a second message from inside the communication device, the second message having a second timestamp; acquire a first timestamp of a first message from the first interface; determine a sequence number of the second message based at least on the first timestamp and the second timestamp; and send the second message based on the sequence number of the second message.

[0020] In some embodiments of the first aspect, the first interface and the second interface are located on the same chip, or the first interface and the second interface belong to different chips.

[0021] Thus, the communication device can be applied to multiple different scenarios. In one example, multiple interfaces can be integrated into the same chip as the processor, and each interface can be implemented as a module within the chip, such as a built-in network card. In another example, multiple interfaces can be implemented as independent chips, such as external network cards.

[0022] In a second aspect of this disclosure, a communication apparatus is provided, including a first interface and a processor, wherein the first interface is configured to: receive a first message, the first message including a first serial number; provide a first execution request for the first message to the processor of the communication apparatus, the first execution request including the first serial number of the first message; and operate on the first message based on a first execution license from the processor; the processor is configured to acquire the first execution request from the first interface and provide the first execution license for the first execution request to the first interface.

[0023] In some embodiments of the second aspect, a second interface is further included, configured to: receive a second message including a second sequence number; provide a processor with a second execution request for the second message, the second execution request including the second sequence number of the second message and to operate on the second message based on a second execution license from the processor; and wherein the processor is further configured to acquire the second execution request from the second interface; and determine the order of providing a first execution license to the first interface and providing a second execution license to the second interface based on the size relationship between the first sequence number and the second sequence number.

[0024] In a third aspect of this disclosure, a message transmission method is provided, comprising: a first interface of a communication device acquiring a first message from within the communication device, the first message having a first timestamp; the first interface acquiring a second timestamp of a second message from a second interface; the first interface determining a sequence number of the first message based at least on the first timestamp and the second timestamp; and the first interface sending the first message based on the sequence number of the first message.

[0025] In some embodiments of the third aspect, the first interface acquiring the first message includes: the first interface acquiring the first message with a first timestamp during a first time period; the first interface acquiring the second timestamp includes: the first interface acquiring the second timestamp of the second message from the second interface during a second time period, the second message being acquired by the second interface during the first time period; and the first interface determining the sequence number includes: the first interface determining the sequence number of the first message during a third time period, based at least on the first timestamp and the second timestamp.

[0026] In some embodiments of the third aspect, the second time period immediately follows the first time period, and the third time period immediately follows the second time period.

[0027] In some embodiments of the third aspect, the length of the second time period is less than or equal to the length of the first time period, and the length of the third time period is less than or equal to the length of the first time period.

[0028] In some embodiments of the third aspect, the first interface further includes providing a first timestamp of the first message to the second interface.

[0029] In some embodiments of the third aspect, the first interface determining the sequence number includes: the first interface determining the time order of the first timestamp and the second timestamp; and the first interface determining the sequence number based on the position of the first timestamp in the time order.

[0030] In some embodiments of the third aspect, the first interface and the second interface are located on the same chip, or the first interface and the second interface belong to different chips.

[0031] In a fourth aspect of this disclosure, a message transmission method is provided, comprising: a first interface of a communication device receiving a first message, the first message including a first sequence number; the first interface providing a first execution request for the first message to a processor of the communication device, the first execution request including the first sequence number of the first message; the processor providing a first execution license for the first execution request to the first interface; and the first interface operating on the first message based on the first execution license from the processor.

[0032] In some embodiments of the fourth aspect, the method further includes: a second interface of the communication device receiving a second message, the second message including a second sequence number; the second interface providing a second execution request for the second message to a processor, the second execution request including the second sequence number of the second message; and the processor determining, based on the size relationship between the first sequence number and the second sequence number, the order of providing a first execution license to the first interface and providing a second execution license to the second interface.

[0033] In a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a computer or processor, implement the operation of the method according to the third aspect or any embodiment thereof, or implement the operation of the method according to the fourth aspect or any embodiment thereof.

[0034] In a sixth aspect of this disclosure, a computer program or computer program product is provided. The computer program or computer program product is tangibly stored on a computer-readable medium and includes computer-executable instructions that, when executed, implement the operation of the method according to the third aspect or any embodiment thereof, or implement the operation of the method according to the fourth aspect or any embodiment thereof.

[0035] In a seventh aspect of this disclosure, a chip or chip system is provided. The chip or chip system includes processing circuitry configured to perform operations according to the method of the third aspect or any embodiment thereof, or to perform operations according to the method of the fourth aspect or any embodiment thereof.

[0036] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0037] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1The diagram illustrates some embodiments of this disclosure and the scenarios in which they can be applied; Figure 2 A block diagram of an example of a first communication device according to some embodiments of the present disclosure is shown; Figure 3 A schematic flowchart illustrating a message transmission process according to some embodiments of the present disclosure is shown; Figure 4 The diagram illustrates messages processed by the interface during different time periods according to some embodiments of the present disclosure; Figure 5 A schematic diagram illustrating a method for determining the sequence number of a first message according to some embodiments of the present disclosure is shown; Figure 6 A schematic flowchart illustrating a message transmission process according to some embodiments of the present disclosure is shown; Figure 7 A schematic interactive diagram illustrating a message transmission process according to some embodiments of the present disclosure is shown; and Figure 8 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0038] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0039] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "an embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. The term "and / or" indicates at least one of the two items associated therewith. For example, "A and / or B" means A, B, or A and B. Other explicit and implicit definitions may also be included below.

[0040] With the development of artificial intelligence (AI), cloud computing, and other technologies, the computing power of a single chip can no longer meet the actual computing demands. Therefore, more chips are needed to form larger-scale computing networks. However, this also increases the out-of-order frequency of network packets across multiple interfaces. Furthermore, due to the expansion of network scale, a single chip also needs multiple interfaces and multipathing techniques to improve network bandwidth. Therefore, a solution is needed to ensure the timing of packets across multiple interfaces, thereby fully utilizing their bandwidth.

[0041] In view of this, in the embodiments of this disclosure, multiple interfaces of the communication device can synchronize the timestamps of the messages they receive and determine the sequence number of the messages based on the timestamps, thereby ensuring the timing of messages between multiple interfaces. This allows for full utilization of the bandwidth of multiple interfaces and avoids the situation where only one interface can be used due to message ordering requirements.

[0042] Figure 1 A schematic diagram of scenario 100 in which some embodiments of the present disclosure can be applied is shown. Scenario 100 includes a first communication device 110, a second communication device 120, and a third communication device 130.

[0043] The first communication device 110 includes a processor 112, interfaces 114-1, 114-2, and 114-3. The processor 112 can be configured to run an operating system, software protocol stack, etc. For simplicity, interfaces 114-1, 114-2, and 114-3 are collectively referred to as interface 114. The processor 112 and interface 114 can be connected via a bus 116, for example, the system bus. The processor 112 and interface 114 can transmit instructions, data, etc., via the system bus.

[0044] In some embodiments, the processor 112 and the interface 114 can be implemented as multiple interfaces on a single chip. For example, the processor 112 and the interface 114 are integrated on the same chip, such as a single application-specific integrated circuit (ASIC).

[0045] In some embodiments, the processor 112 and interface 114 can be implemented as a single-chip managed multiple external interfaces; for example, the processor 112 is implemented as a processor chip, and the interface 114 is implemented as an external chip. Figure 2 A block diagram of an example 200 of a first communication device 110 according to some embodiments of the present disclosure is shown. Figure 2 It can be understood as... Figure 1 The interface 114 of the first communication device 110 is implemented as an external network card (referred to as a network card in the following embodiments). Figure 2 In this embodiment, processor 112 is connected to network cards 214-1, 214-2, and 214-3 (collectively referred to as network cards 214) via bus 116 and peripheral interfaces. It is understood that the embodiments of this disclosure do not limit the specific form of network card 214; for example, it may be fixed to the processor chip, or it may be pluggable, etc. Furthermore, it is understood that... Figure 2 The network card 214 shown is only one way of externally implementing interface 114. In practical applications, it can also be implemented in other forms, and this disclosure does not limit it.

[0046] In some embodiments, some interfaces 114 (such as interface 114-1) and processor 112 are implemented on the same chip, while the remaining interfaces (such as interfaces 114-1 and 114-3) are implemented on external chips.

[0047] For example, the first communication device 110 may also include a memory 118.

[0048] It should be noted that, although in Figure 1 The diagram shows that the first communication device 110 has three interfaces 114, but this disclosure is not limited to this; for example, it may have two or more. That is, the first communication device 110 includes multiple interfaces, and the first communication device 110 may be referred to as a multi-interface communication device, and the multiple interfaces are interconnected to enable communication.

[0049] The second communication device 120 includes a processor 122 and an interface 124, wherein the processor 122 can be configured to run an operating system, software protocol stack, etc. The processor 122 and the interface 124 can be connected via a bus 126, for example, the bus 126 being a system bus. The processor 122 and the interface 124 can transmit instructions, data, etc., via the system bus. Exemplarily, the second communication device 120 may also include a memory 128. As shown, the second communication device 120 includes a single interface and can be accordingly referred to as a single-interface communication device.

[0050] The third communication device 130 includes a processor 132, an interface 134-1, an interface 134-2, and an interface 134-3. The processor 132 can be configured to run an operating system, software protocol stack, etc. For simplicity, interfaces 134-1, 134-2, and 134-3 are collectively referred to as interface 134. The processor 132 and interface 134 can be connected via a bus 136, for example, a system bus. The processor 132 and interface 134 can transmit instructions, data, etc., via the system bus. Exemplarily, the third communication device 130 may also include a memory 138.

[0051] Understandable Figure 1The number of interfaces 134 shown for the third communication device 130 is merely illustrative. In actual scenarios, the number of interfaces 134 can be two or more, and correspondingly, the third communication device 130 can be referred to as a multi-interface communication device. For the specific implementation of interfaces 134, please refer to the embodiment of interface 114 described above in conjunction with the first communication device 110; for the sake of brevity, it will not be repeated here.

[0052] In scenario 100, the first communication device 110, the second communication device 120, and the third communication device 130 can communicate with each other. For example, the first communication device 110 can send messages to the second communication device 120 and / or the third communication device 130 via interface 114. It should be noted that the embodiments of this disclosure do not limit the message transmission method between the first communication device 110 and the second communication device 120 and / or the third communication device 130; for example, it can be implemented through a switch.

[0053] The following will combine Figures 3 to 5 Describe the process of the first communication device 110 sending messages. Figure 3 A schematic flowchart of a message transmission process 300 according to some embodiments of the present disclosure is shown. Process 300 can be performed by, for example... Figure 1 The first communication device 110 shown is used.

[0054] In box 310, the first interface acquires a first message from inside the first communication device 110, the first message having a first timestamp.

[0055] In box 320, the first interface obtains the second timestamp of the second message from the second interface of the first communication device 110.

[0056] In box 330, the first interface determines the sequence number of the first message based at least on the first timestamp and the second timestamp.

[0057] In box 340, the first interface sends the first message based on the sequence number of the first message.

[0058] In process 300, the first interface can be any interface of the first communication device 110; that is, each interface of the first communication device 110 can be configured to perform, for example... Figure 3 The process shown is 300. Combined with... Figure 1 The processor 112 of the first communication device 110 can send message requests to each interface 114 based on actual service needs. Specifically, the processor 112 can send message requests destined for the same destination to interfaces 114-1, 114-2, and 114-3 respectively. Furthermore, each interface 114 can obtain messages with different timestamps based on the message requests from the processor 112.

[0059] In process 300, the second interface can be any of the interfaces of the first communication device 110 other than the first interface. (Combined with...) Figure 1 For example, the first interface can be interface 114-1, and the second interface includes interface 114-2 and interface 114-3.

[0060] In some embodiments, the first interface may perform pipelined operations for the messages it intends to transmit. Specifically, the first interface may acquire a first message with a first timestamp during a first time period. Subsequently, the first interface may acquire a second timestamp of a second message from the second interface during a second time period, wherein the second message was acquired by the second interface during the first time period. After this, the first interface may determine the sequence number of the first message during a third time period, based at least on the first and second timestamps. Optionally, the second time period immediately follows the first time period, and the third time period immediately follows the second time period.

[0061] During the first time period, a first interface (e.g., interface 114-1) can acquire messages from the internal storage of the first communication device 110 (e.g., processor 112 or memory 118) and record the absolute timestamp of the acquired messages. It is understood that during the first time period, the first interface can acquire multiple messages and record the timestamp of each message. Similarly, during the first time period, a second interface (e.g., interfaces 114-2 and 114-3) can also acquire messages from the internal storage of the first communication device 110 (e.g., processor 112 or memory 118) and record the absolute timestamp of the acquired messages. It is understood that during the first time period, the second interface can acquire multiple messages and record the timestamp of each message. Optionally, the first time period can be referred to as the reception period or the message acquisition period.

[0062] Optionally, each interface can store multiple acquired packets into a packet queue based on the recorded timestamps.

[0063] Figure 4 A schematic diagram illustrates messages 400 processed by the interface during different time periods according to some embodiments of the present disclosure. Figure 4 Within time period T1, interface 114-1 receives 5 first packets and records the 5 first timestamps corresponding to these 5 packets, assuming they are t11 to t15. Within time period T1, interface 114-2 receives 4 second packets and records the 4 second timestamps corresponding to these 4 packets, assuming they are t21 to t24. Within time period T1, interface 114-3 receives 4 third packets and records the 4 third timestamps corresponding to these 4 third packets, assuming they are t31 to t34. This is understandable. Figure 4The number of first, second, and third messages shown is for illustrative purposes only. It is also understood that for... Figure 4 For messages represented by slashes, time period T1 is the reception period.

[0064] During the second time period, each interface provides the timestamps of the packets it acquired during the first time period to the other interfaces. A second timestamp from the second interface can be obtained. That is, the first interface (e.g., interface 114-1) can obtain the timestamps of the packets acquired by the second interfaces (e.g., interfaces 114-2 and 114-3) during the first time period, and the first interface can also provide the timestamps of the packets acquired by the first interface during the first time period to the second interface. Optionally, the second time period can be referred to as the synchronization period or the timestamp synchronization period.

[0065] Optionally, each interface can broadcast the timestamps it recorded in the previous time period to the other interfaces.

[0066] Combination Figure 4 During time period T2, interface 114-1 provides t11 to t15 to interfaces 114-2 and 114-3, and interface 114-1 can obtain t21 to t24 and t31 to t34. It is understandable that for... Figure 4 For messages represented by slashes, time period T2 is the synchronization period.

[0067] However, it should be noted that within time period T2, interface 114-1 continues to acquire subsequent packets following the five first packets with timestamps t11 to t15, for example, the four first packets with timestamps t16 to t19. Similarly, interfaces 114-2 and 114-3 also continue to acquire subsequent second and third packets, etc. This is understandable. Figure 4 For messages represented by horizontal lines, time period T2 is the reception period.

[0068] During the third time period, each interface determines the sequence number of the packets it acquired during the first time period. Taking the first interface as an example, the first interface can determine the time order of all timestamps (including timestamps recorded during the first time period and timestamps acquired during the second time period), and thus can determine the sequence number of the first packet based on the position of the first timestamp in the time order.

[0069] Combination Figure 4, taking the interface 114-1 as an example, the interface 114-1 may determine the time sequence of a total of 13 timestamps from t11 to t15, t21 to t24, and t31 to t34, then determine the sequence number of the first packet with the timestamp t11 according to the position of t11 in this time sequence, determine the sequence number of the first packet with the timestamp t12 according to the position of t12 in this time sequence, determine the sequence number of the first packet with the timestamp t13 according to the position of t13 in this time sequence, determine the sequence number of the first packet with the timestamp t14 according to the position of t14 in this time sequence, and determine the sequence number of the first packet with the timestamp t15 according to the position of t15 in this time sequence. For example, if t11 is at the first position in the time sequence, the sequence number of the first packet with the timestamp t11 may be determined as a predefined minimum sequence number (such as 0 or 1 or other values). For example, if t15 is at the Nth position in the time sequence, the sequence number of the first packet with the timestamp t15 may be determined as the predefined minimum sequence number (such as 0 or 1 or other values) + N.

[0070] Figure 5 shows a schematic diagram of a manner 500 for determining the sequence number of a first packet according to some embodiments of the present disclosure. Specifically, Figure 5 shows how the interface 114-1 determines the sequence number of the first packet with the timestamp t11. The interface 114-1 may represent the first timestamps of the first packets acquired by the interface 114-1 during the first time period as a first queue 510, and the first timestamps in the first queue 510 are sorted in ascending order, that is, t11<t12<t13<t14<t15, where a smaller timestamp indicates an earlier acquisition time, and a larger timestamp indicates a later acquisition time. The interface 114-1 may also represent the second timestamps of the interface 114-2 acquired during the second time period as a second queue 520, and the second timestamps in the second queue 520 are sorted in ascending order, that is, t21<t22<t23<t24. The interface 114-1 may also represent the third timestamps of the interface 114-3 acquired during the second time period as a third queue 530, and the third timestamps in the third queue 530 are sorted in ascending order, that is, t31<t32<t33<t34.

[0071] The interface 114-1 may sequentially determine the sequence numbers of the corresponding first packets according to the order of the timestamps in the first queue 510. For example, for a packet whose sequence number is to be determined (such as a packet with the timestamp t11), the interface 114-1 may determine the number of timestamps smaller than the timestamp t11, and determine the sequence number according to this number.

[0072] refer to Figure 5, three timestamps in the three queues located on the dashed line 512 may be compared. If t11>t21, t21 may be popped out, and then t11 is compared with t22; if t11>t31, t31 may be popped out, and then t11 is compared with t32. In this manner, the process continues until t11 is the smallest among the three timestamps in the three queues on the dashed line, as shown in Figure 5 as indicated by the dashed line 514, where t11<t13 and t11<t32. Then, the sequence number of the first packet corresponding to t11 may be further determined based on the number of the popped timestamps, in Figure 5 , the popped timestamps include t21, t22, and t31, totaling 3, so it may be determined that the sequence number of the first packet corresponding to t11 may be 4. In the same manner, the interface 114-1 may determine the sequence numbers of the first packets corresponding to the timestamps t11 to t15, which will not be repeated here for brevity.

[0073] It can be understood that although the above describes in conjunction with Figure 5 the embodiment in which the interface 114-1 determines the sequence number, the manners in which the interface 114-2 and the interface 114-3 determine the sequence number are similar, which will not be elaborated in detail in the present disclosure.

[0074] During the third time period, each interface may further send packets based on the determined sequence numbers. Taking the first interface (e.g., the interface 114-1) as an example, the packets obtained during the first time period may be sequentially sent in ascending order of the sequence numbers. For example, for the Figure 4 five first packets where t11<t12<t13<t14<t15, the first packet with the timestamp t11 may be sent first, then the second packet with the timestamp t12, and so on. However, the sent first packets may not carry the first timestamps t11 to t15; instead, the first packets carry the corresponding sequence numbers, for example, the first packet with the timestamp t11 carries the sequence number 4. In this manner, the amount of transmitted information can be reduced, channel occupation is reduced, and transmission efficiency is improved. Optionally, the third time period may be referred to as a sending period or a packet transmission period.

[0075] Referring to Figure 4 , the interface 114-2 and the interface 114-3 may perform operations similar to those of the interface 114-1. And it can be understood that for the Figure 4 packets represented by oblique lines, the time period T3 is the sending period.

[0076] However, it should be noted that within time period T3, interface 114-1 will provide timestamps t16 to t19 obtained within time period T2 to interfaces 114-2 and 114-3. Similarly, interface 114-1 also obtains the timestamps obtained by interfaces 114-2 and 114-3 within time period T2. This is understandable for... Figure 4 For messages represented by horizontal lines, time period T3 is the synchronization period.

[0077] Furthermore, within time period T3, interface 114-1 continues to acquire the first messages following the four first messages with timestamps t16 to t19, for example... Figure 4 The message indicated by the vertical line. Similarly, interfaces 114-2 and 114-3 continue to acquire subsequent second and third messages, etc. It is understandable that for... Figure 4 For messages represented by vertical lines, time period T3 is the reception period.

[0078] It should be noted that, although the above combination Figures 4 to 5 The document describes a first time period, a second time period, and a third time period; however, it is understood that the above process is merely illustrative. For example, in a real-world scenario, timestamp synchronization between various interfaces can be achieved during the second time period, and sequence numbers can be determined based on the synchronized timestamps. Messages can then be sent during the third time period based on the sequence numbers determined during the second time period. In other words, the process of determining the sequence number of a message can be performed during either the second or third time period; this disclosure does not limit this.

[0079] In some embodiments, the length of the second time period is less than or equal to the length of the first time period, and the length of the third time period is less than or equal to the length of the first time period. That is, among the first, second, and third time periods, the first time period is the longest.

[0080] In some embodiments, the first time period, the second time period, and the third time period are of equal length. That is, during the message sending process by each interface, the various periods are of equal duration. Figure 4 T1=T2=T3. For example, they are all equal to 1000 clock cycles.

[0081] Thus, in the embodiments of this disclosure, each interface can be segmented according to time periods, and different messages can be received, synchronized, and sent separately, thereby processing them in a pipeline manner. This enables message order preservation between multiple interfaces, and the processing efficiency is high.

[0082] Combination Figure 1 In the scenario 100 shown, the first communication device 110 can send a message to the second communication device 120 or the third communication device 130.

[0083] Assuming the first communication device 110 sends a message to the second communication device 120, since the second communication device 120 is a single-interface communication device, its interface 124 can receive messages from multiple interfaces 114 of the first communication device 110. Furthermore, interface 124 can perform subsequent operations based on the sequence number carried in the received message, such as writing the message to memory 128 according to the sequence number.

[0084] Suppose that the first communication device 110 sends a message to the third communication device 130. Since the third communication device 130 is a multi-interface communication device, the interfaces 134 of the third communication device 130 need to coordinate to complete the message order preservation processing.

[0085] Figure 6 A schematic flowchart of a message transmission process 600 according to some embodiments of the present disclosure is shown. Process 600 may have the following characteristics: Figure 1 The third communication device 130 shown is executed.

[0086] In frame 610, the first interface of the third communication device 130 receives a first message, the first message including a first sequence number.

[0087] In box 620, the first interface provides a first execution request for a first message to the processor 132 of the third communication device 130, the first execution request including a first sequence number.

[0088] In box 630, processor 132 provides a first execution license to the first interface for the first execution request.

[0089] In box 640, the first interface operates on the first message based on a first execution license from processor 132.

[0090] In process 600, the first interface can be any interface of the third communication device 130; that is, each interface of the third communication device 130 can be configured to perform, for example... Figure 6 The process 600 shown includes operations in blocks 610, 620, and 640. Accordingly, it is understood that processor 132 can obtain execution requests from various interfaces, and thus processor 132 can grant execution licenses to each interface.

[0091] In some embodiments, the second interface of the third communication device 130 receives a second message, the second message including a second sequence number; the second interface provides a second execution request for the second message to the processor 132, the second execution request including the second sequence number of the second message. The processor 132 can determine the order of providing a first execution license to the first interface and a second execution license to the second interface based on the relationship between the first sequence number and the second sequence number.

[0092] Specifically, after receiving a message from the first communication device 110, each interface of the third communication device 130 can provide an execution request for the message to the processor 132. After receiving execution requests from multiple interfaces (such as interfaces 134-1, 134-2, and 134-3), the processor 132 can sequentially provide execution permissions to the corresponding interfaces in ascending order of sequence number. Furthermore, the interface receiving the execution permission can operate on the corresponding message, such as writing the message to the memory 138.

[0093] Alternatively, the execution request can be handled by a specific module (e.g., a sequence-preserving module) within the processor 132.

[0094] It should be noted that, although Figure 6 The embodiments shown depict the processor 132 processing the execution request from the interface, but this disclosure is not limited thereto. For example, the execution request may also be handled by a sequence-keeping module or the like, independent of the processor 132 (i.e., outside the processor 132).

[0095] In this way, the timing of message processing can be ensured based on the sequence number in the received message, thus ensuring that errors do not occur during message processing due to out-of-order delivery.

[0096] Figure 7 A schematic interactive diagram of a message transmission process 700 according to some embodiments of the present disclosure is shown. Process 700 relates to a first communication device 110 and a third communication device 130.

[0097] Processor 112 provides message a to interface 114-1 at 701, message b to interface 114-2 at 702, and message c to interface 114-3 at 703.

[0098] Interface 114-1 records 711 to obtain the timestamp t1 of message a, interface 114-2 records 712 to obtain the timestamp t2 of message b, and interface 114-3 records 713 to obtain the timestamp t3 of message c.

[0099] Interface 114-1 returns a 721 ACK response to processor 112, interface 114-2 returns a 722 ACK response to processor 112, and interface 114-3 returns a 723 ACK response to processor 113.

[0100] Optionally, for Figure 7 From 701 to 723, assume the following portion of code is executed at processor 112:

[0101] Suppose that after the above-mentioned code, processor 112 also executes the following code:

[0102] The instruction "Barrier" is a memory barrier instruction, meaning that data processing following this instruction can only continue after the data processing following this instruction has been completed. Specifically, processor 112 received ACKs from the corresponding interfaces for packets a, b, and c. Figure 7 Following 721, 722, and 723, the message d following the "Barrier" instruction will be provided to a certain interface.

[0103] like Figure 7 The processor 112 provides message d to interface 114-1 via 731. Interface 114-1 records the timestamp t4 of message d obtained by 732 and returns an ACK response to the processor 112 via 733.

[0104] Understandably, interfaces 114-1, 114-2, and 114-3 synchronize their timestamps and determine the sequence number of the acquired packets, as described above. Figures 3 to 5 As described, in Figure 7 It is shown in box 740 and will not be described again.

[0105] For the purposes of this description, assume that interface 114-1 determines the sequence number of message a as 0 and the sequence number of message d as 3. Interface 114-2 determines the sequence number of message b as 1. Interface 114-3 determines the sequence number of message c as 2.

[0106] like Figure 7 As shown, interface 114-1 sends message 741a, interface 114-2 sends message 742d, interface 114-3 sends message 743b, and interface 114-3 sends message 744c.

[0107] It is understandable that the process of sending messages between different interfaces is independent of each other. However, for interface 114-1, it first sends message a with sequence number 0, and then sends message d with sequence number 3.

[0108] To facilitate the description of the processing of the third communication device 130, it is assumed that interface 134-1 receives message d, interface 134-2 receives messages a and b, and interface 134-3 receives message c.

[0109] Interface 134-1 provides processor 132 with a first execution request (751), which includes sequence number 3 of message d. Interface 134-2 provides processor 132 with a second execution request (752), which includes sequence number 0 of message a. Interface 134-2 provides processor 132 with a third execution request (753), which includes sequence number 1 of message b. Interface 134-3 provides processor 132 with a fourth execution request (754), which includes sequence number 2 of message c.

[0110] It is understandable that messages may be transmitted out of order in the network. That is, the order in which interface 134 receives messages may not be the same as the order in which interface 114 sends messages. Accordingly, the order in which processor 132 obtains execution requests may also be out of order. In this case, processor 132 issues execution licenses sequentially according to the sequence number in the execution request.

[0111] Processor 132 provides interface 134-2 with execution license 1 for the second execution request (761). After receiving a response (771) from interface 134-2, it provides interface 134-2 with execution license 2 for the third execution request (762). After receiving a response (772) from interface 134-2, it provides interface 134-3 with execution license 3 for the fourth execution request (763). After receiving a response (773) from interface 134-3, it provides interface 134-1 with execution license 4 for the first execution request (764) and receives a response (774) from interface 134-1.

[0112] Understandably, after obtaining execution permission from processor 132, interface 134 can write the corresponding message ( Figure 7 (Not shown in the image) memory 138, and returns a response associated with the execution license to processor 132 so that processor 132 can process the execution request for the next serial number.

[0113] Thus, the embodiments of this disclosure provide an end-to-end message timing processing mechanism in multi-interface scenarios. The multi-interface communication device sending messages can determine the sequence number of the message at each interface based on the timestamp, thereby marking the timing of the messages by the sequence number, ensuring that the communication device receiving the messages processes the messages correctly, and avoiding message processing errors caused by out-of-order delivery.

[0114] It should be understood that although the above embodiments are described using three interfaces 114 and three interfaces 134 as examples, this disclosure is not limited thereto. For example, although the first communication device 110 includes three interfaces 114, the first communication device 110 may also transmit messages through only two of them (such as interface 114-1 and interface 114-2). Similarly, although the third communication device 130 includes three interfaces 134, the third communication device 130 may also receive messages through only two of them (such as interface 134-1 and interface 134-2).

[0115] It should be understood that in the embodiments of this disclosure, terms such as "first," "second," and "third" are merely used to indicate that multiple objects may be different, but do not exclude the possibility that two objects are the same. "First," "second," and "third," etc., should not be construed as any limitation on the embodiments of this disclosure.

[0116] It should also be understood that the manner, situation, category, and division of embodiments in the present disclosure are for the convenience of description only and should not constitute a special limitation. Various manners, categories, situations, and features in the embodiments can be combined with each other where logically consistent.

[0117] It should also be understood that the foregoing is merely to help those skilled in the art better understand the embodiments of this disclosure, and is not intended to limit the scope of the embodiments of this disclosure. Those skilled in the art can make various modifications, variations, or combinations based on the foregoing. Such modifications, variations, or combinations are also within the scope of the embodiments of this disclosure.

[0118] It should also be understood that the above description focuses on highlighting the differences between the various embodiments. Similarities or commonalities can be referenced or learned from each other, and for the sake of brevity, they will not be repeated here.

[0119] Figure 8 A schematic block diagram of an example device 800 that can be used to implement embodiments of the present disclosure is shown. Device 800 can be implemented as including... Figure 1 The first communication device 110, the second communication device 120, or the third communication device 130 shown.

[0120] As shown in the figure, device 800 includes a Central Processing Unit (CPU) 801, a Read-Only Memory (ROM) 802, and a Random Access Memory (RAM) 803. The CPU 801 can perform various appropriate actions and processes based on computer program instructions stored in RAM 802 and / or RAM 803, or computer program instructions loaded from storage unit 808 into ROM 802 and / or RAM 803. Various programs and data required for the operation of device 800 can also be stored in ROM 802 and / or RAM 803. The CPU 801 and ROM 802 and / or RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804. It is understood that I / O interface 805 is implemented to include multiple interfaces; accordingly, device 800 is a multi-interface device.

[0121] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0122] CPU 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Examples of implementations include, but are not limited to, a Graphics Processing Unit (GPU), various special-purpose Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc., which may be referred to accordingly as a computing unit. In some examples, CPU 801 can be implemented as a data processing device as described above.

[0123] For example, Figure 8The device 800 can be implemented as an electronic device, such as a mobile phone, desktop computer, laptop computer, notebook computer, tablet computer, personal communication system device, personal navigation device, personal digital assistant (PDA), e-book device, gaming device, Internet of Things (IoT) device, in-vehicle device, aircraft, virtual reality (VR) device, augmented reality (AR) device, wearable device, television set, cloud server, data center, etc. The embodiments disclosed herein are not limited in this respect.

[0124] Embodiments of this disclosure also provide a chip, such as Figure 1 The processor 112 and interface 114 shown can be integrated into the chip.

[0125] Embodiments of this disclosure also provide a system-on-a-chip (SoC), which may include an input interface, an output interface, and processing circuitry. In embodiments of this disclosure, the input and output interfaces can be used to perform signaling or data interaction, while the processing circuitry can be used to generate and process the signaling or data information.

[0126] Embodiments of this disclosure also provide a processor for coupling with a memory storing instructions that, when executed by the processor, cause the processor to perform the methods and functions involved in any of the above embodiments.

[0127] Embodiments of this disclosure also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods and functions involved in any of the embodiments described above.

[0128] Embodiments of this disclosure also provide a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods and functions involved in any of the above embodiments.

[0129] Generally, the various embodiments of this disclosure can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software, which can be executed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of this disclosure are shown and described as block diagrams, flowcharts, or represented using some other illustration, it should be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as, as non-limiting examples, in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0130] This disclosure also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which execute in a device on a target real or virtual processor to perform the processes / methods as described above with reference to the accompanying drawings. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided among program modules as needed. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside in both local and remote storage media.

[0131] Computer program code used to implement the methods of this disclosure may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be performed. The program code may be executed entirely on a computer, partially on a computer, as a stand-alone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0132] In the context of this disclosure, computer program code or related data may be carried on any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and so on. Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0133] A computer-readable medium can be any tangible medium that contains or stores a program for or relating to an instruction execution system, apparatus, or device. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of computer-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0134] Furthermore, although the operation of the methods of this disclosure is described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps. It should also be noted that the features and functions of two or more devices according to this disclosure may be embodied in one device. Conversely, the features and functions of one device described above may be further divided and embodied by multiple devices.

[0135] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to well explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A communication device, comprising a first interface and a second interface, wherein the first interface is configured to: Acquire a first message from inside the communication device, the first message having a first timestamp; Obtain the second timestamp of the second message from the second interface; The sequence number of the first message is determined based at least on the first timestamp and the second timestamp; as well as The first message is sent based on the sequence number of the first message.

2. The apparatus of claim 1, wherein the first interface is configured as follows: During the first time period, the first message with the first timestamp is acquired; During the second time period, the second timestamp of the second message from the second interface is obtained, the second message being obtained by the second interface during the first time period; and During the third time period, the sequence number of the first message is determined based at least on the first timestamp and the second timestamp.

3. The apparatus of claim 2, wherein the second time period immediately follows the first time period, and the third time period immediately follows the second time period.

4. The apparatus according to claim 2, wherein the length of the second time period is less than or equal to the length of the first time period, and the length of the third time period is less than or equal to the length of the first time period.

5. The apparatus according to any one of claims 1 to 4, wherein the first interface is further configured to: provide the first timestamp of the first message to the second interface.

6. The apparatus according to any one of claims 1 to 4, wherein the first interface is configured to: Determine the time order of the first timestamp and the second timestamp; and The sequence number is determined based on the position of the first timestamp in the time sorting.

7. The apparatus according to any one of claims 1 to 4, wherein the first interface and the second interface are located on the same chip, or the first interface and the second interface belong to different chips.

8. A communication device, comprising a first interface and a processor, wherein: The first interface is configured as follows: A first message is received, the first message including a first sequence number, the first sequence number being determined by a first interface of a first communication device based on a first timestamp of the first message and a second timestamp of a second message, the first timestamp of the first message being obtained by the first interface of the first communication device, and the second timestamp of the second message being obtained by the second interface of the first communication device; the first message originates from within the first communication device. The processor of the communication device is provided with a first execution request for the first message, the first execution request including a first sequence number of the first message, and The first message is operated on based on a first execution permission from the processor; The processor is configured as follows: Obtain the first execution request from the first interface, and Provide the first execution license for the first execution request to the first interface.

9. The apparatus according to claim 8, further comprising: The second interface is configured as follows: Receive a second message, the second message including a second sequence number. The processor is provided with a second execution request for the second message, the second execution request including a second sequence number of the second message, and The second message is operated on based on a second execution permission from the processor; Furthermore, the processor is configured to: Obtain the second execution request from the second interface; Based on the size relationship between the first serial number and the second serial number, the order in which the first execution license is provided to the first interface and the second execution license is provided to the second interface is determined.

10. A message transmission method, comprising: The first interface of the communication device acquires a first message from inside the communication device, the first message having a first timestamp; The first interface obtains the second timestamp of the second message from the second interface of the communication device; The first interface determines the sequence number of the first message based at least on the first timestamp and the second timestamp; as well as The first interface sends the first message based on the sequence number of the first message.

11. The method according to claim 10, wherein, The first interface obtains the first message by: during a first time period, the first interface obtains the first message with the first timestamp; The first interface obtaining the second timestamp includes: the first interface obtaining the second timestamp of the second message from the second interface during a second time period, wherein the second message is obtained by the second interface during the first time period; and The first interface determines the sequence number by: during a third time period, the first interface determines the sequence number of the first message based at least on the first timestamp and the second timestamp.

12. The method of claim 11, wherein the second time period immediately follows the first time period, and the third time period immediately follows the second time period.

13. The method according to claim 11, wherein the length of the second time period is less than or equal to the length of the first time period, and the length of the third time period is less than or equal to the length of the first time period.

14. The method of any one of claims 10-13, further comprising: The first interface provides the first timestamp of the first message to the second interface.

15. The method according to any one of claims 10 to 13, wherein determining the serial number via the first interface comprises: The first interface determines the time order of the first timestamp and the second timestamp; as well as The first interface determines the sequence number based on the position of the first timestamp in the time sorting.

16. The method according to any one of claims 10 to 13, wherein the first interface and the second interface are located on the same chip, or the first interface and the second interface belong to different chips.

17. A message transmission method, comprising: The first interface of the communication device receives a first message, the first message including a first sequence number, the first sequence number being determined by the first interface of the first communication device based on a first timestamp of the first message and a second timestamp of the second message, the first timestamp of the first message being obtained by the first interface of the first communication device, and the second timestamp of the second message being obtained by the second interface of the first communication device; the first message originates from within the first communication device. The first interface provides the processor of the communication device with a first execution request for the first message, the first execution request including a first sequence number of the first message; The processor provides the first interface with a first execution license for the first execution request; and The first interface operates on the first message based on a first execution license from the processor.

18. The method of claim 17, further comprising: The second interface of the communication device receives a second message, the second message including a second sequence number; The second interface provides the processor with a second execution request for the second message, the second execution request including a second sequence number of the second message; as well as The processor determines the order in which it provides the first execution license to the first interface and the second execution license to the second interface based on the size relationship between the first serial number and the second serial number.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a computer or processor, implement the method according to any one of claims 10 to 18.

20. A computer program product, characterized in that, The computer program product includes computer-executable instructions that, when executed, implement the method according to any one of claims 10 to 18.

Citation Information

Patent Citations

  • Message-serial-number determining method and device

    CN108718282A

  • Multichannel communication time sequence control method and system

    CN111835448A