WO2022247307A1 - Message transmission method and apparatus - Google Patents

Message transmission method and apparatus Download PDF

Info

Publication number
WO2022247307A1
WO2022247307A1 PCT/CN2022/071659 CN2022071659W WO2022247307A1 WO 2022247307 A1 WO2022247307 A1 WO 2022247307A1 CN 2022071659 W CN2022071659 W CN 2022071659W WO 2022247307 A1 WO2022247307 A1 WO 2022247307A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
message
sending
queue
receiving end
Prior art date
Application number
PCT/CN2022/071659
Other languages
French (fr)
Chinese (zh)
Inventor
郑述乾
王伟
姚笛
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022247307A1 publication Critical patent/WO2022247307A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/28Flow control; Congestion control in relation to timing considerations
    • H04L47/283Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]

Definitions

  • the present application relates to the communication field, in particular to a method and device for transmitting messages.
  • data flow A of an edge node (provider edge, PE) 0 can be sent to PE 3 through a label switched path (label switched path, LSP) 101.
  • Data flow B of PE 1 can be sent to PE 3 through LSP 102.
  • Data flow C of PE 2 can be sent to PE 3 through LSP 103, LSP 104 or LSP 105.
  • the bandwidth required by the current data flow D is 6G, and the current available bandwidth of LSP 106 is 2G, the available bandwidth of LSP 107 is 3G, and the available bandwidth of LSP 108 is 1G, then LSP 106, LSP 107 and LSP 108 cannot The bandwidth requirement of data flow D is met, so data flow D cannot be sent until the available bandwidth of at least one LSP among LSP 106, LSP 107, and LSP 108 is greater than or equal to 6G. In this way, the network bearing efficiency and data transmission efficiency will be reduced, and the data transmission delay will be increased.
  • a multipath transmission technology is proposed.
  • multiple packets including the data of the data stream can be sent from the sending end to the receiving end through multiple paths.
  • multiple packets including the data of data flow C can be sent to PE 3 through multiple paths in LSP 103, LSP 104 and LSP 105, so as to reduce the load of choke point A.
  • LSP 106, LSP 107 and LSP 108 can meet the bandwidth requirement of data flow D together, so multiple messages including the data of data flow D can be sent through LSP 106, LSP 107 and LSP 108 to PE 5. In this way, the data flow D does not need to wait for the network load to decrease before sending it.
  • the multi-path transmission technology can improve network bearing efficiency and network transmission efficiency, and reduce data transmission delay.
  • multi-path transmission technology also brings new problems: the transmission delays of different paths are different, so the order in which the receiving end receives packets is different from the order in which the sending end sends packets, that is, the packets received by the receiving end are random. sequential. Therefore, after receiving the packets, the receiving end needs to sort the packets to restore the data flow.
  • the current packet sorting methods either require relatively large computing resources and storage resources, and are relatively complicated to implement, or have high requirements on the network and low reliability.
  • the application provides a method and device for transmitting messages, which can sort the messages, and is simple to implement and highly reliable.
  • a method for transmitting a message is provided, and the communication device executing the method may be a receiving end; it may also be a module applied to the receiving end, such as a chip or a chip system.
  • the following takes the execution subject as the receiving end as an example for description.
  • the method includes: receiving a first packet of a first service sent by a sending end through a first path, the first packet carrying a first sending timestamp, the first sending timestamp corresponding to the time domain of the sending end, The time when the first message is sent, the first path is one of the multiple paths for transmitting the message of the first service to the receiving end; the first delay parameter of the first service is obtained, and the first delay The parameter is determined according to the first maximum transmission delay of the plurality of paths; the first estimated read time is obtained according to the first sending timestamp and the first delay parameter; the read time is read according to the first expected read time The data of the first message.
  • the receiving end can sort the received messages as a whole without distinguishing services, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources. Moreover, for any service, its packets are also in order, which does not affect the function of the service.
  • the receiving end reads the data of the message according to the expected time to read the data of the message.
  • the abnormal time stamp of a certain service does not affect the receiving end to read the data of other service messages, and the reliability is high.
  • the method provided in the first aspect above does not need to introduce aging time, and can reduce delay jitter.
  • the method provided in the first aspect above has no special requirements on the transmission network, and can be deployed at the sending end and the receiving end, which is easy to implement.
  • reading the data of the first message according to the first expected reading time includes: in multiple queues sorted by time, according to the first expected reading time Enqueue the first message at the fetch time; when the first expected read time has been reached or exceeded, and the plurality of queues indicate that it is time to read the data of the first message, read the first The data of the message.
  • the receiving end reads the data of the first message, which can realize Read the data in the message according to the order of the message.
  • the multiple queues include a first queue
  • enqueuing the first message according to the first expected read time includes: according to the first expected read time
  • the difference between the current time and the information of the first message is input into the first queue, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the first queue.
  • the receiving end can put the first message into the queue according to the difference between the first expected reading time and the current time, that is, sorting of the received messages is realized.
  • the receiving end can determine the positions of the first message and the second message in the first queue according to the first expected reading time and the expected reading time of the second message, so as to realize the Document sorting.
  • the second message is other messages of the first service sent by the sending end except the first message, and the messages of other services sent by the sending end message, or other messages sent by the sender.
  • the receiving end can sort the received messages as a whole, without distinguishing between services and sending ends, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources.
  • the method further includes: if the difference between the first expected read time and the current time is smaller than the minimum value of the time difference interval corresponding to the first queue, then The information of the first message is output from the first queue and input to the second queue, the second queue is included in the plurality of queues, and the difference between the first expected reading time and the current time belongs to the second queue The time difference interval corresponding to the queue.
  • multiple queues are connected in series in the time domain. Over time, information in the queues can be output from one queue and input to another. In this way, the receiving end can read the data of the message according to the sequence in the queue.
  • the multiple queues are divided into multiple groups, the first queue is included in the first group of queues, the second queue is included in the second group of queues, the The length of the time difference interval corresponding to the queues in the first group of queues is greater than the length of the time difference interval corresponding to the queues in the second group of queues.
  • different time difference interval lengths can be configured for queues of different groups. In this way, the number of queues can be greatly reduced, and the complexity of maintaining queues at the receiving end can be reduced.
  • obtaining the first expected read time according to the first sending time stamp and the first delay parameter includes: mapping the first sending time stamp to the receiving end In the time domain, the second sending time stamp is obtained; and the first expected reading time is obtained according to the second sending time stamp and the first delay parameter.
  • the receiving end can perform time domain mapping between the sending end and the receiving end to unify the time domains of the receiving end and the sending end, and then The first estimated reading time is obtained in the unified time domain.
  • the method further includes: acquiring a first reference time stamp, a second reference time stamp, and a first clock mapping parameter, where the first reference time stamp is a time stamp at the sending end domain, the time corresponding to the first moment, the second reference timestamp is the time corresponding to the first moment in the time domain of the receiving end; the first sending timestamp is mapped to the time domain of the receiving end to obtain
  • the second sending time stamp includes: obtaining the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter. Based on the above method, the second sending time stamp can be obtained, so that the first expected reading time can be obtained according to the second sending time stamp and the first delay parameter.
  • the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path
  • the method further includes: according to The first transmission delay, the second transmission delay and the adjustment factor adjust the first clock mapping parameter, the first transmission delay is the transmission delay of the first message from the sending end to the receiving end, the second The second transmission delay is the transmission delay of the third packet from the sending end to the receiving end.
  • the first clock mapping parameter can be adjusted, so that the time domain mapping between the sending end and the receiving end is more accurate.
  • the first delay parameter is determined according to the first maximum transmission delay of the multiple paths, including: the first delay parameter is determined according to the first maximum transmission delay of the multiple paths Determined by the first maximum transmission delay and the first margin, the first margin is a positive number.
  • a compensation value that is, the first margin, is used to make the first maximum transmission delay compensated according to the compensation value (ie, the first delay parameter) greater than or equal to the maximum transmission delays of multiple paths. In this way, it is possible to avoid the situation that the estimation of the maximum transmission delay of multiple paths is small, which leads to wrong ordering of packets.
  • the receiving end may adjust the first time delay parameter to avoid unnecessary time delay introduced due to a large first time delay.
  • the method further includes: comparing the stored fourth sending timestamp with the size of the first sending timestamp, where the fourth sending timestamp is carried in the fifth packet
  • the fifth message is the latest message of the first service that was read before the first message
  • the fourth sending time stamp is greater than the first sending time stamp
  • the fourth sending time stamp is adjusted A delay parameter. Based on the above method, if the fourth sending timestamp is greater than the first sending timestamp, it means that the first packet is wrongly sorted. In this case, it means that the current first delay parameter is too small, and therefore the first delay parameter may be adjusted to make the first delay parameter more accurate.
  • the method further includes: receiving a fourth message of the first service sent by the sending end, where the fourth message carries a third sending timestamp, and the third The sending time stamp corresponds to the time when the fourth message is sent in the time domain of the sending end; comparing the size of the first sending time stamp and the third sending time stamp to determine whether the ordering of the first message is correct; If the first packet is wrongly sorted, adjust the first delay parameter. Based on the above method, in the case that the first packet sorting error is detected, it can be determined that the current first delay parameter is too small, so the first delay parameter can be adjusted to make the first delay parameter more accurate.
  • the method further includes: if the sequence of the first packet is wrong, sending an alarm message. Based on the above method, the receiving end can send the alarm information, so that the user or the administrator can perform further processing according to the alarm information.
  • a communication device for implementing the above method.
  • the communication device may be the receiving end in the above first aspect, or a device including the above receiving end.
  • the communication device includes a corresponding module, unit, or means (means) for implementing the above method, and the module, unit, or means may be implemented by hardware, software, or by executing corresponding software on hardware.
  • the hardware or software includes one or more modules or units corresponding to the above functions.
  • the communication device may include a receiving module and a processing module.
  • the receiving module which may also be referred to as a receiving unit, is configured to implement the receiving function in the above first aspect and any possible implementation manner thereof.
  • the receiving module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface.
  • the processing module may be used to implement the processing function in the above first aspect and any possible implementation manner thereof.
  • the processing module may be, for example, a processor.
  • a communication device including: a processor; the processor is configured to be coupled with a memory, and after reading an instruction in the memory, execute the above-mentioned first aspect and any possible implementation thereof according to the instruction method described in .
  • the communication device may be the receiving end in the above first aspect and any possible implementation manner thereof, or a device including the above receiving end.
  • the communications device further includes a memory, where the memory is configured to store necessary program instructions and data.
  • the communication device is a chip or a chip system.
  • the communication device when it is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
  • a communication device including: a processor and an interface circuit; the interface circuit is used to receive computer programs or instructions and transmit them to the processor; the processor is used to execute the computer programs or instructions, so that the communication
  • the device executes the method described in the above first aspect and any possible implementation manner thereof.
  • the communication device is a chip or a chip system.
  • the communication device when it is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
  • a computer-readable storage medium stores instructions, and when it is run on a computer, the computer can execute the above-mentioned first aspect and any possible implementation manners thereof. the method described.
  • a computer program product including instructions is provided, and when it is run on a computer, the computer can execute the method described in the above first aspect and any possible implementation thereof.
  • a method for transmitting a message comprising: inserting a first sending timestamp into a first message of a first service at a sending end; sending the first message to a receiving end through a first path text, wherein the first sending timestamp corresponds to the time domain of the sending end; the time of sending the first message, and the first path is one of the multiple paths for transmitting the message of the first service to the receiving end
  • the receiving end executes the method described in the above first aspect and any possible implementation thereof.
  • a communication system includes: a sending end and a receiving end; the sending end is configured to insert a first sending time stamp into a first packet of a first service through a first path sending the first message to the receiving end, the first sending time stamp corresponds to the time when the first message is sent in the time domain of the sending end, and the first path is to transmit the message of the first service to the One of the multiple paths of the receiving end; the receiving end is configured to execute the method described in the above first aspect and any possible implementation manner thereof.
  • FIG. 1A is a first schematic diagram of a network transmission path
  • FIG. 1B is a second schematic diagram of a network transmission path
  • FIG. 2A is a schematic diagram of a network transmission path provided by an embodiment of the present application.
  • FIG. 2B is a schematic diagram of sorting messages according to timestamps provided by the embodiment of the present application.
  • FIG. 3 is a schematic diagram of message transmission provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a communication system architecture provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a hardware structure of a communication device provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for transmitting a message provided in an embodiment of the present application.
  • FIG. 7A is a first schematic diagram of multiple queues provided by the embodiment of the present application.
  • FIG. 7B is a second schematic diagram of multiple queues provided by the embodiment of the present application.
  • FIG. 8 is a schematic diagram of receiving a message at a receiving end provided in an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the sending end can send packets to the receiving end through various methods, so that the receiving end can sort the received packets to restore data flow.
  • the sender can send a message to the receiver in the following ways:
  • the sender can insert a sequence number (SN) into the message sent to the receiver.
  • the SN is granular by service, that is to say, each service corresponds to a group of SNs. For any service, SN increases gradually with the increase of the number of packets sent. For example, for any service, the SN inserted in the first message sent by the sender is 1, the SN inserted in the second message is 2, the SN inserted in the third message is 3, and so on. These messages can be sent to the receiver through multiple transmission paths. After receiving these packets, the receiving end can sort the packets according to the SN.
  • the receiving end may map the SN carried in the message with a pointer (pointer, PTR) that can indicate a cache address of the receiving end at the granularity of the service (the SN corresponding to different services is mapped PTR is different).
  • PTR pointer
  • the sequencers corresponding to different services need to continuously detect whether the message corresponding to the current PTR of the service is received. If received, read the message in the buffer address corresponding to the current pointer, and then continue to detect the message corresponding to the next pointer. Whether the message is received. If not received, the receiver waits for the message. In this way, the sorter at the receiving end can sort the received packets at the granularity of the service.
  • the sending end can insert a sending timestamp in the message sent to the receiving end.
  • the sending time stamp is a global synchronization time stamp in the network. That is to say, each node in the network, for example, the sending end, the receiving end, and the nodes on each transmission path between the sending end and the receiving end are time-synchronized. After the sending end sends the message, the receiving end and each node in the transmission path sort the message according to the sending timestamp carried in the message.
  • the data flow of PE 0 can be sent from PE 0 to PE 5 through LSP 201, LSP 202 and LSP 203.
  • LSP 201 includes PE 1, PE 4 and PE 5.
  • LSP 202 includes PE 2, PE 4 and PE 5.
  • LSP 203 includes PE 3, PE 4 and PE 5.
  • PE 1, PE 2, PE 3, PE 4, and PE 5 all sort the received packets according to the sending timestamp carried in the packet.
  • PE 4 can sort the received packets according to the sending timestamp, and then send the sorted packets to PE 5 in order .
  • PE 4 can establish queues for packets from PE 1, PE 2, and PE 3 respectively.
  • queue 1 is a queue established by PE 4 for packets from PE 1.
  • Queue 2 is a queue established by PE 4 for packets from PE 2.
  • Queue 3 is a queue established by PE 4 for packets from PE 3. Because PE 1, PE 2, and PE 3 have sorted the received packets before, the packets sent by PE 1, PE 2, and PE 3 are in order. In this case, PE 4 can compare the size of the sending timestamps carried by the packets currently output by each queue, and read the packets with smaller sending timestamps first, so that the packets can be sorted.
  • the sending end may send the first message of the first service to the receiving end through the first path, and the first message carries the first sending timestamp.
  • the receiving end After the receiving end receives the first message through the first path, it can determine the first delay parameter according to the first maximum transmission delay of multiple paths, and obtain the first expected read time according to the first delay parameter and the first sending timestamp. Get the time, and read the data of the first message according to the first estimated read time. This method will be described in detail in the embodiment shown in FIG. 6 below, and will not be repeated here.
  • the transmission delays of packets on different paths are different, so the packets received by the receiver are out of sequence. Then, after receiving the message, the receiving end can obtain the maximum transmission delay in different paths, obtain the estimated reading time of the message according to the sending timestamp and the maximum transmission delay, and then read the message according to this time. In this way, the order in which the receiving end reads the packets is consistent with the order in which the sending end sends the packets, that is, the packets read by the receiving end are in order.
  • PE 0 sends message 1 to PE 5 through LSP 201, and the sending timestamp carried in message 1 is time T1.
  • PE 0 sends message 2 to PE 5 through LSP 202, and the sending time stamp carried in message 2 is time T2.
  • PE 0 sends message 3 to PE 5 through LSP 203, and the sending time stamp carried in message 3 is time T3.
  • T1 2 nanoseconds (ns)
  • T2 4ns
  • T3 6ns.
  • the receiving end can use the sum of the sending timestamp of the message and the maximum transmission delay in multiple paths as the expected reading time of the message.
  • the method shown in Figure 6 does not require packets to be sorted at the granularity of services, but can sort the received packets as a whole without distinguishing services. Therefore, the method shown in Figure 6 does not need to prepare a corresponding sorter for each service, that is, in the method shown in Figure 6, in order to achieve the sorting of packets, there is no need to schedule multiple sorters, which can reduce the reception
  • the complexity of the terminal can also reduce the consumption of computing resources and storage resources.
  • the receiving end only needs to read the message according to the expected reading time of the message, and there is no need to introduce aging time (that is, the time for the receiving end to wait for the message), which can reduce the delay jitter.
  • the method shown in FIG. 6 does not require time synchronization of each node in the network, and does not require all nodes in the transmission path to sort packets.
  • the receiving end only needs to sort the received messages, which has low requirements on the network and is easy to implement.
  • a communication system 40 may include a sending end 401 , a receiving end 402 and a network 403 .
  • the sending end 401 and the receiving end 402 can communicate through the network 403 .
  • a packet sent by the sending end 401 may reach the receiving end 402 through multiple paths in the network 403 .
  • the sending end 401 or the receiving end 402 in FIG. 4 may be a computer, or a device with a sending and receiving function.
  • the sending end 401 or the receiving end 402 may be a portable computer (such as a mobile phone), a notebook computer, a personal computer (personal computer, PC), a wearable electronic device (such as a smart watch), a tablet computer, and the like.
  • the sending end 401 or the receiving end 402 may also be a device capable of providing services such as computing or applications. It can be understood that the sending end 401 or the receiving end 402 may also be called a terminal device, a user end, a client, a user equipment, a mobile station, a mobile station or a server, and the like.
  • the network 403 in FIG. 4 may also be called a transmission network, and may be used to transmit data between the sending end 401 and the receiving end 402 .
  • the network 403 includes multiple paths, any of which may be used to transmit the data sent by the sending end 401 to the receiving end 402 . Any one of the paths may include at least one node, and the node may forward the data sent by the data sending end 401 , so that the data sent by the sending end 401 can reach the receiving end 402 .
  • the communication system 40 shown in FIG. 4 is only used as an example, and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in a specific implementation process, the communication system 40 may also include other devices, and the number of sending ends and receiving ends may also be determined according to specific needs, without limitation.
  • the communication system may further include a sending end 404 .
  • the sending end 404 can communicate with the receiving end 402 through the network 403 .
  • each device (such as the receiving end 402, etc.) in FIG. .
  • each device such as the receiving end 402 in FIG.
  • the functional modules are implemented, which is not specifically limited in this embodiment of the present application. It can be understood that the above-mentioned functions can be network elements in hardware devices, software functions running on dedicated hardware, or a combination of hardware and software, or instantiated virtualization on a platform (for example, a cloud platform) Function.
  • FIG. 5 is a schematic diagram of a hardware structure of a communication device applicable to an embodiment of the present application.
  • the communication device 50 includes at least one processor 501 and at least one communication interface 504, configured to implement the method provided in the embodiment of the present application.
  • the communication device 50 may also include a communication line 502 and a memory 503 .
  • the processor 501 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more for controlling the execution of the application program program integrated circuit.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • Communication line 502 may include a path, such as a bus, for transferring information between the aforementioned components.
  • the communication interface 504 is used for communicating with other devices or a communication network.
  • the communication interface 504 can be any device such as a transceiver, such as an Ethernet interface, a wireless access network (radio access network, RAN) interface, a wireless local area network (wireless local area networks, WLAN) interface, a transceiver, a pin , bus, or transceiver circuits, etc.
  • a transceiver such as an Ethernet interface, a wireless access network (radio access network, RAN) interface, a wireless local area network (wireless local area networks, WLAN) interface, a transceiver, a pin , bus, or transceiver circuits, etc.
  • the memory 503 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types that can store information and instructions It can also be an electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be programmed by a computer Any other medium accessed, but not limited to.
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM compact disc read-only memory
  • optical disc storage including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
  • magnetic disk storage media or other magnetic storage devices or can be used to carry
  • the memory may exist independently and be coupled with the processor 501 through the communication line 502.
  • the memory 503 can also be integrated with the processor 501 .
  • the memory provided by the embodiment of the present application may generally be non-volatile.
  • the memory 503 is used to store computer-executed instructions involved in implementing the solutions provided by the embodiments of the present application, and the execution is controlled by the processor 501 .
  • the processor 501 is configured to execute computer-executed instructions stored in the memory 503, so as to implement the method provided in the embodiment of the present application.
  • the computer-executed instructions in the embodiments of the present application may also be referred to as application program codes, which is not specifically limited in the embodiments of the present application.
  • the coupling in the embodiments of the present application is an indirect coupling or a communication connection between devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
  • the processor 501 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 5 .
  • the communication device 50 may include multiple processors, for example, the processor 501 and the processor 507 in FIG. 5 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the communication device 50 may further include an output device 505 and/or an input device 506 .
  • Output device 505 is coupled to processor 501 and can display information in a variety of ways.
  • the output device 505 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector) Wait.
  • the input device 506 is coupled to the processor 501 and can receive user input in various ways.
  • the input device 506 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
  • composition structure shown in FIG. 5 does not constitute a limitation to the communication device.
  • the communication device may include more or less components than shown in the figure, or combine some components, or a different arrangement of components.
  • FIG. 4 uses the architecture shown in FIG. 4 as an example to describe the method for transmitting a packet provided by the embodiment of the present application.
  • Each device in the following embodiments may have the components shown in FIG. 5 , which will not be described in detail.
  • transmission may be understood as sending and/or receiving according to a specific context.
  • Transfer can be a noun or a verb.
  • Transmission is often used instead of sending and/or receiving when the subject of the action is not emphasized.
  • the phrase transmission message can be understood as sending a message from the perspective of the sender, and can be understood as receiving a message from the perspective of the receiver.
  • words such as “first” and “second” may be used to distinguish technical features with the same or similar functions.
  • the words “first” and “second” do not limit the number and execution order, and the words “first” and “second” do not necessarily mean that they must be different.
  • words such as “exemplary” or “for example” are used to represent examples, illustrations or illustrations, and any embodiment or design described as “exemplary” or “for example” should not be interpreted It is more preferred or more advantageous than other embodiments or design solutions.
  • the use of words such as “exemplary” or “for example” is intended to present related concepts in a specific manner for easy understanding.
  • the receiving end may perform some or all of the steps in the embodiment of the present application, these steps are only examples, and the embodiment of the present application may also perform other steps or variations of various steps.
  • each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all the steps in the embodiment of the present application.
  • the specific structure of the execution subject of the method for transmitting the message is not limited, as long as the method provided in the embodiment of the present application can be realized.
  • the execution subject of the method for transmitting a message provided in the embodiment of the present application may be the receiving end, or a component applied to the receiving end, for example, a chip system, which is not limited in the present application.
  • the system-on-a-chip may be composed of chips, or may include chips and other discrete devices. The following embodiments are described by taking the execution subject of the method for transmitting a message as the receiving end as an example.
  • FIG. 6 it is a method for transmitting a message provided in the embodiment of the present application, and the method for transmitting a message includes S601-S604.
  • S601 The sending end sends the first packet of the first service to the receiving end through the first path.
  • the receiving end receives the first packet of the first service sent by the sending end through the first path.
  • the sending end may be the sending end 401 in FIG. 4 .
  • the receiving end may be the receiving end 402 in FIG. 4 .
  • the first path is one of multiple paths for transmitting the packet of the first service to the receiving end.
  • the first service is one of multiple services of the sending end.
  • the first packet carries the first sending timestamp and data of the first packet.
  • the first sending time stamp corresponds to the time when the first message is sent in the time domain of the sending end, or in other words, the first sending time stamp is used to indicate the time when the first message is sent in the time domain of the sending end.
  • the time when the first packet is generated is used as the first sending timestamp to represent the time when the first packet is sent in the time domain of the sender.
  • the accuracy of the sending time stamp inserted by the sending end into the message of the first service can meet the following requirements: the sending time stamps of two adjacent messages are not repeated, and the time increment relationship is satisfied.
  • the accuracy of the sending time stamp can also satisfy: the maximum bandwidth of the data that does not affect the sending message.
  • the precision of sending the time stamp can be 1/(2 ⁇ n)ns, for example, 1/8ns.
  • the bit width of the sending timestamp can meet the requirement of recording the maximum delay of the network without inversion, for example, the maximum support is 1 second (s) delay.
  • S602 The receiving end obtains a first delay parameter of the first service.
  • the first delay parameter is determined according to a first maximum transmission delay of multiple paths between the sending end and the receiving end.
  • the multiple paths between the sending end and the receiving end may include all paths between the sending end and the receiving end, or may include part of the paths between the sending end and the receiving end. If the multiple paths between the sending end and the receiving end include a partial path between the sending end and the receiving end, the partial path includes multiple paths for transmitting the packet of the first service to the receiving end.
  • path 1-path 5 if all the paths between the sending end and the receiving end include path 1-path 5, wherein, path 1-path 3 are used to transmit packets of the first service, then multiple paths between the sending end and the receiving end
  • the path may include path 1-path 3, or path 1-path 4, or path 1-path 5, or path 1-path 3 and path 5.
  • the first delay parameter is determined according to the first maximum transmission delay and the first margin.
  • the first delay parameter is the sum of the first maximum transmission delay and the first margin; or, the first delay parameter is the product of the first maximum transmission delay and the first margin.
  • the first margin may also be referred to as a safety compensation value, a compensation value, etc., without limitation.
  • the first margin is a positive number.
  • the first margin may be set by the user, or may be a default default value. In a specific application, the user can modify the first margin according to specific conditions.
  • the first maximum transmission delay is an estimated value, which is used to represent the maximum transmission delay of multiple paths between the sending end and the receiving end.
  • the receiving end can obtain the first maximum transmission delay in at least the following two ways.
  • Method 1 The receiving end obtains the first maximum transmission delay according to the transmission delays of multiple paths in history.
  • the receiving end determines a maximum value of transmission delays of multiple paths between the sending end and the receiving end within a period of time as the first maximum transmission delay. For example, the receiving end determines the maximum value of the transmission delays of multiple paths between the sending end and the receiving end within one month as the first maximum transmission delay.
  • the first maximum transmission delay is a fixed value. Unless reset, usually the first maximum transmission delay remains unchanged.
  • Method 2 The receiving end takes the service as the granularity and makes statistics on a periodic basis to obtain the first maximum transmission delay.
  • the receiving end counts the transmission delays of the packets of the first service on multiple paths between the sending end and the receiving end, and calculates the maximum transmission time of the multiple paths currently counted. Delay is determined as the first maximum transmission delay.
  • the first maximum transmission delay is a variable value, which may change according to the statistical results. That is, the receiving end can dynamically adjust the first maximum transmission delay, or in other words, the receiving end can count the first maximum transmission delay in real time.
  • the receiving end determines that the first maximum transmission delay is 2 ns.
  • the receiving end receives packet 2 of the first service, and the transmission delay of packet 2 is 1 ns, so the receiving end determines that the first maximum transmission delay is 2 ns.
  • the receiving end receives packet 3 of the first service, and the transmission delay of packet 3 is 3 ns, so the receiving end determines that the first maximum transmission delay is 3 ns.
  • the pseudo code for the receiving end to obtain the first maximum transmission delay can be as follows:
  • Tr is the time when the receiving end receives the first message
  • Tsr corresponds to the time when the sending end sends the first message in the time domain of the receiving end
  • Td is the transmission delay of the first message
  • Tdamx is the first Maximum transmission delay.
  • the first maximum transmission delay is an estimated value, and the estimation may be inaccurate.
  • a compensation value that is, the first margin
  • the transmission delay (that is, the first delay parameter) is greater than or equal to the maximum transmission delay of multiple paths.
  • the receiving end may adjust the first delay parameter. For example, the receiving end may call back the first delay parameter in small steps multiple times. The value of each callback can be less than the minimum time interval for the sender to send messages to avoid packet disorder caused by callbacks.
  • the receiving end may also detect whether the sequence of the first packet is correct. If the receiving end detects that the ordering of the first packet is wrong, it means that the current first delay parameter is too small. In this case, the receiving end may adjust the first delay parameter. For example, the receiving end may increase the first delay parameter by the second margin. The process for the receiving end to detect whether the sorting of the first packet is correct will be introduced after S604, and will not be repeated here.
  • the pseudocode of the dynamic adjustment of the first delay parameter at the receiving end can be as follows:
  • Tc is the first delay parameter
  • Tgd is the first margin
  • Tfb is the second margin
  • Tb is the value of each callback.
  • the callback condition is if Tc-Tdmax>Tgd, and it lasts for X milliseconds (ms).
  • the first Tc is the first time delay parameter after adjustment
  • the second Tc is the first time delay parameter before adjustment.
  • the first Tc is the first time delay parameter after adjustment
  • the second Tc is the first time delay parameter before adjustment.
  • the above pseudo code describes the following process: if Tc ⁇ (Tdmax+Tgd), then determine Tdmax+Tgd as the first delay parameter; or, if the receiving end detects that the first packet is incorrectly sorted, then determine Tc+Tfb is the first delay parameter; or, if the callback condition is met, Tc-Tb is determined as the first delay parameter.
  • S603 The receiving end obtains a first estimated read time according to the first sending timestamp and the first delay parameter.
  • the first expected reading time may be the time when the receiving end expects to read the first packet.
  • the receiving end and the sending end may or may not be synchronized in the time domain. If the receiving end and the sending end are synchronized in the time domain, the receiving end may add the first sending timestamp and the first delay parameter to obtain the first expected reading time. If the receiving end and the sending end are not synchronized in the time domain, the receiving end can perform time domain mapping between the sending end and the receiving end first, unify the time domains of the receiving end and the sending end, and then map the time domain on the unified time domain Get the first estimated read time. Specifically, the receiving end may map the first sending time stamp to the time domain of the receiving end to obtain the second sending time stamp, and obtain the first expected read time according to the second sending time stamp and the first delay parameter.
  • the second sending time stamp corresponds to the time when the sending end sends the first message in the time domain of the receiving end, or in other words, the second sending time stamp is used to indicate that in the time domain of the receiving end, the time when the sending end sends the first message text time.
  • the specific method of time domain mapping is as follows: the receiving end obtains the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter.
  • the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end.
  • the second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end.
  • T sr1 is the second transmission time stamp
  • T sr0 is the second reference time stamp
  • K sr0 is the first clock mapping parameter
  • T s1 is the first transmission time stamp
  • T s0 is the first reference time stamp
  • C is the adjustment parameter.
  • the receiving end can obtain the first reference time stamp, the second reference time stamp and the first clock mapping parameter, and the receiving end can further obtain the second sending
  • the time stamp is not limited in this application.
  • the first reference time stamp, the second reference time stamp and the first clock mapping parameter may be an initialized value .
  • the initialized value can be configured by the user or the receiving end. For example, if the first message is the first message received by the receiving end from the sending end, the first reference time stamp and the second reference time stamp are 0, and the first clock mapping parameter is 1.
  • the first reference time stamp may correspond to the time stamp of the message sent by the sender before sending the first message in the time domain of the sender
  • the second reference time stamp may be a time stamp obtained by mapping the first reference time stamp to the time domain of the receiving end
  • the first clock mapping parameter may be a parameter after at least one dynamic adjustment of the initialized clock mapping parameter.
  • the receiving end may adjust the first clock mapping parameter to obtain the second clock mapping parameter after obtaining the second sending timestamp. Subsequently, the receiving end may perform time-domain mapping between the sending end and the receiving end according to the second clock mapping parameter.
  • the receiving end adjusts the first clock mapping parameter according to the first transmission delay, the second transmission delay and the adjustment factor, so as to obtain the second clock mapping parameter.
  • the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path.
  • the first transmission delay is the transmission delay of the first packet from the sending end to the receiving end
  • the second transmission delay is the transmission delay of the third packet from the sending end to the receiving end.
  • K sr1 is the second clock mapping parameter
  • K sr0 is the first clock mapping parameter
  • K c is the adjustment factor
  • T r1 is the time when the receiving end receives the first message
  • T sr1 is the second sending time stamp
  • T r0 is the time when the receiving end receives the third message
  • T sr0 is the second reference time stamp.
  • the pseudo code for time-domain mapping between the sender and receiver can be as follows:
  • Tsn is the first reference time stamp
  • Tsrn is the second reference time stamp
  • Krs is the clock mapping parameter
  • Tsr is the second transmission time stamp
  • Ts is the first transmission time stamp
  • Td is the first transmission delay
  • Tdn is The second transmission delay
  • Kc is an adjustment factor.
  • the first Krs is the adjusted clock mapping parameter
  • the second Krs is the clock mapping parameter before adjustment.
  • the first Tsrn is the adjusted second reference time stamp
  • the second Tsrn is the second reference time stamp before adjustment.
  • the receiving end can set the initial value of Krs to 1, and then dynamically adjust Krs through Tdc, so that Krs tends to be stable. For example, make the final limit of Krs within the range of plus or minus 150ppm.
  • Tdc if Krs is accurate, Tdc will approach zero. Therefore, if Tdc gradually increases, it means that Krs is small, and Krs can be increased appropriately; if Tdc gradually decreases, it means that Krs is large, and Krs can be appropriately reduced. By adjusting Krs dynamically, a more accurate Krs can be obtained.
  • the receiving end may discard the first packet.
  • the receiving end discards the first packet.
  • the first time length is the packet out-of-sequence time that the receiving end can support, or in other words, the receiving end can sort the packets sent within the first time length. For example, if the first time length is 6ms and the current time is 1ms, then the receiving end can sort the packets whose expected reading time is 1ms-7ms. If the first expected reading time is 8ms, it exceeds the sorting capability of the receiving end. In this case, the receiving end discards the first packet, or the receiving end may also cache the first packet, and then sort the first packets when the current time is 2 ms.
  • S604 The receiving end reads the data of the first packet according to the first expected reading time.
  • the receiving end reads the data of the first message according to the first expected reading time, including: in the multiple queues sorted by time, the receiving end sends the first message according to the first expected reading time Enqueue the file; when the first expected reading time has been reached or exceeded, and multiple queues indicate that it is the turn to read the data of the first message, read the data of the first message.
  • each of the multiple queues corresponds to a time difference interval, and the multiple queues are sorted according to the time difference interval.
  • the time difference interval corresponding to queue 1 is [0ns, 0.5ns]
  • the time difference interval corresponding to queue 2 is (0.5ns, 1ns]
  • the time difference interval corresponding to queue 3 is ( 1ns, 1.5ns]
  • the receiving end reads the message, it can first read the message in queue 1, then read the message in queue 2, and finally read the message in queue 3.
  • the receiving end After the received messages are queued, the received messages are sorted. Subsequently, the receiving end can read the data of the messages in the order of the queue output messages.
  • the time difference corresponding to the queue The interval is configured by the receiver or the user.
  • the time difference interval can be modified after configuration.
  • the time difference interval corresponding to the queue may be used by the receiving end to enqueue the received message into the queue.
  • the receiving end can obtain the difference between the expected reading time and the current time, and input the data of the message into the time difference interval corresponding to the difference. in queue.
  • the time difference interval where the difference is located can be understood as: the difference is greater than or equal to the minimum value of the time difference interval where the difference is located, and the difference is less than or equal to the minimum value of the time difference interval where the difference is located. maximum value.
  • the receiving end enqueues the first message according to the first estimated reading time, including: the receiving end inputs the information of the first message according to the difference between the first estimated reading time and the current time first queue.
  • the information of the first packet may include information related to the first packet.
  • the information of the first message includes the first message; or, the information of the first message includes the storage address of the first message at the receiving end; or, the information of the first message includes the storage address of the first message at the receiving end address and first sent timestamp.
  • the information of the first packet may also be referred to as a packet descriptor of the first packet.
  • the receiving end reads the data of the first message from the queue; if the information of the first message includes the storage address of the first message at the receiving end, Then the receiving end reads the data of the first packet from the storage address.
  • the multiple queues include a first queue, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the first queue.
  • multiple queues at the receiving end may be as shown in FIG. 7A .
  • multiple queues include queue 701, queue 702, queue 703..., wherein, the time difference interval corresponding to queue 701 is [0ns, 1ns], and the time difference interval corresponding to queue 702 is (1ns, 2ns] , the time difference interval corresponding to the queue 703 is (2ns, 3ns]. If the difference between the first expected read time and the current time is 1ns, then the first queue is the queue 701; if the first expected read time and the current time If the difference between the first expected reading time and the current time is 2.5 ns, then the first queue is queue 703 .
  • the receiving end determines the first message and the second message according to the first expected read time and the expected read time of the second message.
  • the position of the packet in the first queue Exemplarily, if the first expected reading time is earlier than the expected reading time of the second message, the time when the information of the first message is output from the first queue is earlier than the time when the information of the second message is output from the first queue or, if the first expected read time is later than the expected read time of the second message, the time when the information of the first message is output from the first queue is later than the time when the information of the second message is output from the first queue Time for a queue output.
  • the second message may be other messages of the first service other than the first message sent by the sender, messages of other services sent by the sender, or messages sent by other senders .
  • the sorting of packets by the receiving end does not require the granularity of services, and the received packets can be sorted as a whole without distinguishing between services.
  • the complexity of the receiving end can be reduced, and for any service, its message is also in order, without affecting the function of the service.
  • whether the receiving end reads the message is related to the expected reading time of the message and whether the message is located at the output port of the queue, and is not limited by other conditions. Therefore, the abnormal time stamp of a certain service does not affect the receiving end to read the messages of other services, and the reliability is high.
  • the receiving end may also sort the received packets at the granularity of services, which is not limited.
  • multiple queues are connected in series in the time domain, that is, information in the queues can be output from one queue and input to another queue as time goes by.
  • the receiving end if the difference between the first expected reading time and the current time is less than the minimum value of the time difference interval corresponding to the first queue, the receiving end outputs the information of the first message from the first queue , input to the second queue.
  • the second queue is included in multiple queues, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the second queue. It can be understood that the value in the time difference interval corresponding to the second queue is smaller than the value in the time difference interval corresponding to the first queue, or in other words, compared with the expected reading time of the message in the first queue, the second The expected reading time of the packets in the queue is closer to the current time.
  • the queue 701 , the queue 702 and the queue 703 are connected in series in the time domain. If the current time is time 1, and the difference between the first estimated read time and time 1 is 2.5 ns, then the receiving end will input the information of the first message into the queue 703 corresponding to the time difference interval of 2.5 ns. After a period of time, the current time becomes time 2, the difference between the first estimated reading time and time 2 is 2ns, and if 2ns is less than the minimum value of the time difference interval corresponding to the queue 703, the receiving end sends the first message The information of is output from the queue 703 and input into the queue 702 corresponding to the time difference interval of 2ns.
  • the receiving end After another period of time, the current time becomes time 3, and the difference between the first estimated reading time and time 3 is 1 ns, and if 1 ns is less than the minimum value of the time difference interval corresponding to the queue 702, the receiving end will send the first report
  • the text information is output from the queue 702 and input into the queue 701 corresponding to the time difference interval where 1 ns is located.
  • the multiple queues are divided into multiple groups, each group includes at least one queue, and the lengths of the time difference intervals corresponding to the queues in different groups are different.
  • the length of the time difference interval may be the difference between the maximum value of the time difference interval and the minimum value of the time difference interval.
  • the queues in the first group of queues are greater than the length of the time difference interval corresponding to the queues in the second group of queues. It can be understood that among the multiple queues, the minimum value of the length of the time difference interval corresponding to the queue is smaller than the minimum time interval for sending packets by the sending end.
  • FIG. 7B it is a schematic diagram of multiple queues.
  • multiple queues are divided into 4 groups.
  • the length of the time difference interval corresponding to the queue in queue group 1 is 1/8ns
  • the length of the time difference interval corresponding to the queue in queue group 2 is 16ns
  • the length of the time difference interval corresponding to the queue in queue group 3 is 1 microsecond (us)
  • the length of the time difference interval corresponding to the queue in queue group 4 is 64 us.
  • the first group of queues can be queue group 2, and the second group of queues can be queue group 1; or, the first group of queues can be queue group 3, and the second group of queues can be queue group 2; the first group of queues
  • the column can be Queue Group 4 and the second set of queues can be Queue Group 3.
  • time difference interval lengths for different groups of queues can greatly reduce the number of queues and reduce the complexity of queue maintenance at the receiving end.
  • the first time length that is, the packet out-of-sequence time that the receiving end can support, and the sum of the lengths of the time difference intervals corresponding to multiple queues
  • the time difference corresponding to each queue The length of the value interval is the same, both are 1ns, and the receiving end needs to maintain 8000000 queues.
  • the lengths of the time difference intervals corresponding to the queues in different groups are different, for example, multiple queues are divided into 4 groups, the length of the time difference intervals corresponding to the queues in the first group of queues is 1/8ns, and the length of the second The length of the time difference interval corresponding to the queues in the first group of queues is 16ns, the length of the time difference intervals corresponding to the queues in the third group of queues is 1us, and the length of the time difference intervals corresponding to the queues in the fourth group of queues length is 64us, then in the case that each group includes 128 queues, the sum of the lengths of the time difference intervals corresponding to multiple queues can be greater than 8ms. In this case, the receiving end needs to maintain 512 queues, which greatly reduces the complexity of the receiving end.
  • the receiving end when the lengths of the time difference intervals corresponding to the queues in different groups are different, if the length of the time difference intervals corresponding to the first queue is greater than the second time length, then the receiving end will When the information of the message is input into the first queue, the position of the information of the first message in the first queue may not be determined, so as to reduce the calculation overhead of the receiving end. If the length of the time difference interval corresponding to the first queue is less than or equal to the second time length, the receiving end can determine the first message according to the first expected reading time when inputting the information of the first message into the first queue The position of the message in the first queue.
  • the receiving end can determine the first message according to the first expected reading time when inputting the information of the first message into the second queue The position of the message in the second queue.
  • the receiving end detects whether the sequence of the first packet is correct.
  • the receiving end receives the fourth packet of the first service sent by the sending end, where the fourth packet carries a third sending time stamp, and the third sending time stamp corresponds to the time domain of the sending end.
  • the time of the fourth message can compare the sizes of the first sending timestamp and the third sending timestamp to determine whether the sequence of the first packet is correct. For example, in the case that the fourth message is read latest before reading the first message, the third sending time stamp should be smaller than the first sending time stamp. If the comparison result is that the third sending timestamp is greater than the first sending timestamp, it may indicate that the ordering of the first packet is wrong.
  • the third transmission time stamp should be greater than the first transmission time stamp. If the comparison result is that the third sending timestamp is smaller than the first sending timestamp, it may indicate that the ordering of the first packet is wrong.
  • the receiving end adjusts the first delay parameter. For example, the receiving end may increase the first delay parameter by a second margin, where the second margin is a positive number, and the second margin may be a difference between the third sending timestamp and the first sending timestamp.
  • the receiving end sends an alarm message. For example, if the sequence of the first message is wrong, the receiving end displays warning information on the human-computer interaction interface of the receiving end, so that the user can adjust relevant parameters according to the warning information. Or, if the sequence of the first message is incorrect, the receiving end sends an alarm message to the server, so that the administrator can perform related processing according to the alarm message.
  • the receiving end can perform the above S601-S604 on the received packets, so as to sort the received packets. For example, as shown in Figure 8, if the receiving end and the sending end are synchronized in the time domain, after receiving a new message, the receiving end can use the time stamp Tsr carried in the new message, the The receiving time Tr of the new message and the current statistical maximum transmission delay Tdmax obtain the delay parameter Tc, and the receiving end can also adjust Tdmax and Tc to make Tdmax and Tc more accurate.
  • the receiving end can obtain the expected reading time of the new message according to Tc and Tsr, and read the data of the new message according to the expected reading time. If the receiving end and the sending end are not synchronized in the time domain, after receiving the new message, the receiving end can transmit the time stamp Ts carried in the new message, the sending time stamp Tsn and Tsn of the previously received message The sending timestamp Tsrn and the clock mapping parameter Krs mapped to the time domain of the receiving end are obtained, and the sending timestamp Tsr mapped from Ts to the time domain of the receiving end is obtained, and the receiving end can also adjust Tsn, Tsrn and Krs.
  • the receiving end can obtain Tc according to Tsr, the receiving time Tr of the new message received by the receiving end, and the current statistical maximum transmission delay Tdmax, and obtain the estimated reading time of the new message according to Tc and Tsr, according to Estimated read time to read the data of this new message.
  • the receiving end may receive messages from different sending ends, and for different sending ends, the receiving end uses different clock mapping parameters when performing time domain mapping. However, the receiving end sorts the received packets as a whole, and the sending end may not be distinguished.
  • the receiving end After the receiving end receives the first message of the first service from the sending end through the first path, it can obtain the first delay parameter according to the first maximum transmission delay of multiple paths, according to The first delay parameter obtains the estimated time to read the data of the first packet, and reads the data of the first packet according to the estimated time to read the data of the first packet, so as to realize the sorting of the first packets.
  • the receiving end can sort the received messages as a whole without distinguishing services, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources. Moreover, for any service, its packets are also in order, which does not affect the function of the service.
  • the receiving end reads the data of the message according to the expected time to read the data of the message.
  • the abnormal time stamp of a certain service does not affect the receiving end to read the data of other service messages, and the reliability is high.
  • the method shown in FIG. 6 also does not need to introduce aging time, and can reduce delay jitter.
  • the method shown in Figure 6 has no special requirements on the transmission network, and can be deployed at the sending end and the receiving end, which is easy to implement.
  • the actions of the receiving end in S601-S604 above can be executed by the processor 501 in the communication device 50 shown in FIG. 5 calling the application program code stored in the memory 503, which is not limited in this embodiment of the present application.
  • the embodiment of the present application also provides a communication device, which may be the receiving end in the above method embodiments, or a device including the above receiving end, or a component that may be used for the receiving end.
  • the communication device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • FIG. 9 shows a schematic structural diagram of a communication device 90 .
  • the communication device 90 includes a receiving module 901 and a processing module 902 .
  • the receiving module 901 may also be referred to as a receiving unit to implement a receiving function, for example, it may be a receiving circuit, a receiver, a receiver or a communication interface.
  • the receiving module 901 is configured to receive the first packet of the first service sent by the sending end through the first path, the first packet carries a first sending timestamp, and the first sending timestamp corresponds to the time domain of the sending end.
  • the first path is one of multiple paths for transmitting the packet of the first service to the receiving end.
  • the receiving module 901 may be used to instruct S601.
  • the processing module 902 is configured to obtain a first delay parameter of the first service, where the first delay parameter is determined according to first maximum transmission delays of multiple paths. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S602.
  • the processing module 902 is further configured to obtain a first expected read time according to the first sending time stamp and the first delay parameter. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S603.
  • the processing module 902 is further configured to read the data of the first message according to the first expected reading time. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S603.
  • the processing module 902 is specifically configured to enqueue the first message according to the first expected read time in multiple queues sorted by time; When the reading time is estimated and multiple queues indicate that it is the turn to read the data of the first message, the data of the first message is read.
  • the processing module 902 is further specifically configured to input the information of the first message into the first queue according to the difference between the first estimated reading time and the current time, and the difference between the first estimated reading time and the current time It belongs to the time difference interval corresponding to the first queue.
  • the information of the second message is also stored in the first queue. If the first expected read time is earlier than the expected read time of the second message, the information of the first message is output from the first queue. Time, earlier than the time when the information of the second message is output from the first queue; or, if the first expected read time is later than the expected read time of the second message, the information of the first message is output from the first queue The output time is later than the time when the information of the second packet is output from the first queue.
  • the second message is other messages of the first service sent by the sender except the first message, messages of other services sent by the sender, or messages sent by other senders.
  • the processing module 902 is further configured to transfer the information of the first message from the first The output of the queue is input to the second queue, the second queue is included in multiple queues, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the second queue.
  • multiple queues are divided into multiple groups, the first queue is included in the first group of queues, the second queue is included in the second group of queues, and the time difference intervals corresponding to the queues in the first group of queues The length is greater than the length of the time difference interval corresponding to the queues in the second group of queues.
  • the processing module 902 is specifically configured to map the first sending timestamp to the time domain of the receiving end to obtain the second sending timestamp; the processing module 902 is also specifically configured to The delay parameter gets the first estimated read time.
  • the processing module 902 is further configured to obtain a first reference time stamp, a second reference time stamp, and a first clock mapping parameter, where the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end, The second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end; the processing module 902 is also specifically configured to Mapping parameters to obtain the second sending timestamp.
  • the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path
  • the processing module 902 is further configured to, according to the first transmission delay, the second transmission delay and The adjustment factor is to adjust the first clock mapping parameter.
  • the first transmission delay is the transmission delay of the first message from the sending end to the receiving end
  • the second transmission delay is the transmission time of the third message from the sending end to the receiving end. delay.
  • the receiving module 901 is further configured to receive a fourth packet of the first service sent by the sending end, where the fourth packet carries a third sending timestamp, and the third sending timestamp corresponds to the time domain of the sending end, The time of sending the fourth message; the processing module 902 is also used to compare the size of the first sending time stamp and the third sending time stamp to determine whether the ordering of the first message is correct; the processing module 902 is also used for if the first If the packets are sorted incorrectly, adjust the first delay parameter.
  • the communication device 90 is presented in the form of dividing various functional modules in an integrated manner.
  • a “module” here may refer to a specific ASIC, a circuit, a processor and a memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that can provide the functions described above.
  • the communication device 90 can take the form of the communication device 50 shown in FIG. 5 .
  • the processor 501 in the communication device 50 shown in FIG. 5 can invoke the computer-executed instructions stored in the memory 503, so that the communication device 50 executes the method for transmitting a message in the above method embodiment.
  • the functions/implementation process of the receiving module 901 and the processing module 902 in FIG. 9 can be implemented by the processor 501 in the communication device 50 shown in FIG. 5 invoking computer-executed instructions stored in the memory 503 .
  • the function/implementation process of the processing module 902 in FIG. 9 can be implemented by calling the computer execution instructions stored in the memory 503 by the processor 501 in the communication device 50 shown in FIG. /The implementation process can be implemented through the communication interface 504 in the communication device 50 shown in FIG. 5 .
  • the communication device 90 provided in this embodiment can execute the above-mentioned method for transmitting a message, the technical effect it can obtain can refer to the above-mentioned method embodiment, and details are not repeated here.
  • one or more of the above modules or units may be implemented by software, hardware or a combination of both.
  • the software exists in the form of computer program instructions and is stored in the memory, and the processor can be used to execute the program instructions and realize the above method flow.
  • the processor can be built into a SoC (system on a chip) or ASIC, or it can be an independent semiconductor chip.
  • the core of the processor is used to execute software instructions for calculation or processing, and can further include necessary hardware accelerators, such as field programmable gate array (field programmable gate array, FPGA), PLD (programmable logic device) , or a logic circuit that implements a dedicated logic operation.
  • the hardware can be CPU, microprocessor, digital signal processing (digital signal processing, DSP) chip, microcontroller unit (microcontroller unit, MCU), artificial intelligence processor, ASIC, Any one or any combination of SoC, FPGA, PLD, dedicated digital circuit, hardware accelerator or non-integrated discrete device, which can run necessary software or not depend on software to execute the above method flow.
  • DSP digital signal processing
  • MCU microcontroller unit
  • ASIC artificial intelligence processor
  • an embodiment of the present application further provides a chip system, including: at least one processor and an interface, the at least one processor is coupled to the memory through the interface, and when the at least one processor executes the computer program or instruction in the memory When, the method in any one of the above method embodiments is executed.
  • the communication device further includes a memory.
  • the system-on-a-chip may consist of a chip, or may include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • a software program it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device including one or more servers, data centers, etc. that can be integrated with the medium.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.

Abstract

The present application relates to the field of communications. Disclosed are a message transmission method and apparatus, by means of which messages can be sorted. The method and apparatus are simply implemented and have high reliability. In the method, after receiving, from a sending end, a first message of a first service by means of a first path, a receiving end may determine a first delay parameter according to a first maximum transmission delay of a plurality of paths, obtain a first estimated reading time according to the first delay parameter, and a first sending time stamp that is carried in the first message, and read data of the first message according to the first estimated reading time.

Description

传输报文的方法及装置Method and device for transmitting messages
本申请要求于2021年5月28日提交中国国家知识产权局、申请号为202110593746.8、申请名称为“传输报文的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of China on May 28, 2021, with application number 202110593746.8 and titled "Method and device for transmitting messages", the entire contents of which are hereby incorporated by reference Applying.
技术领域technical field
本申请涉及通信领域,尤其涉及传输报文的方法及装置。The present application relates to the communication field, in particular to a method and device for transmitting messages.
背景技术Background technique
随着网络带宽需求的持续增长,网络的规模急剧扩大。然而在网络中,业务的数据流在时间、空间上的分布却不均匀,这导致了可用带宽在时间、空间上的分布不合理,网络承载效率和数据传输效率较低,数据传输时延较大。例如,在图1A中,边缘节点(provider edge,PE)0的数据流A可以通过标签交换路径(label switched path,LSP)101发送到PE 3。PE 1的数据流B可以通过LSP 102发送到PE 3。PE 2的数据流C可以通过LSP 103、LSP 104或LSP 105发送到PE 3。在数据流A通过LSP 101发送到PE 3,数据流B通过LSP 102发送到PE 3,数据流C通过LSP 103发送到PE 3的情况下,会导致阻塞点A的负载过高,网络承载效率和数据传输效率降低,数据传输时延增加。又例如,在图1B中,若网络负载不高,则PE 4的数据流D可以通过LSP 106、LSP 107或LSP 108发送到PE 5。若网络负载比较高,无法支持数据流D发送的情况下,数据流D可能得等到网络负载降低后才能进行发送。例如,若当前数据流D需要的带宽是6G,而当前LSP 106的可用带宽是2G,LSP 107的可用带宽是3G,LSP 108的可用带宽是1G,则LSP 106、LSP 107和LSP 108都无法满足数据流D的带宽需求,所以数据流D要等到LSP 106、LSP 107和LSP 108中有至少一条LSP的可用带宽大于或等于6G时,才能发送。如此,会降低网络承载效率和数据传输效率,增加数据传输时延。As the demand for network bandwidth continues to grow, the scale of the network expands dramatically. However, in the network, the distribution of service data flow in time and space is uneven, which leads to unreasonable distribution of available bandwidth in time and space, low network bearing efficiency and data transmission efficiency, and long data transmission delay. big. For example, in FIG. 1A, data flow A of an edge node (provider edge, PE) 0 can be sent to PE 3 through a label switched path (label switched path, LSP) 101. Data flow B of PE 1 can be sent to PE 3 through LSP 102. Data flow C of PE 2 can be sent to PE 3 through LSP 103, LSP 104 or LSP 105. When data flow A is sent to PE 3 through LSP 101, data flow B is sent to PE 3 through LSP 102, and data flow C is sent to PE 3 through LSP 103, the load of congestion point A will be too high, and the network carrying efficiency And data transmission efficiency is reduced, and data transmission delay is increased. For another example, in FIG. 1B, if the network load is not high, the data flow D of PE 4 can be sent to PE 5 through LSP 106, LSP 107 or LSP 108. If the network load is too high to support the sending of the data stream D, the data stream D may not be sent until the network load decreases. For example, if the bandwidth required by the current data flow D is 6G, and the current available bandwidth of LSP 106 is 2G, the available bandwidth of LSP 107 is 3G, and the available bandwidth of LSP 108 is 1G, then LSP 106, LSP 107 and LSP 108 cannot The bandwidth requirement of data flow D is met, so data flow D cannot be sent until the available bandwidth of at least one LSP among LSP 106, LSP 107, and LSP 108 is greater than or equal to 6G. In this way, the network bearing efficiency and data transmission efficiency will be reduced, and the data transmission delay will be increased.
为了提高网络承载效率和网络传输效率,降低数据传输时延,提出了多径传输技术。通过多径传输技术,可以将包括数据流的数据的多个报文通过多条路径从发送端发送到接收端。例如,在图1A中,包括数据流C的数据的多个报文可以通过LSP 103,LSP 104和LSP 105中的多条路径发送到PE 3,以降低阻塞点A的负载。又例如,在图1B中,LSP 106、LSP 107和LSP 108加起来可以满足数据流D的带宽需求,所以包括数据流D的数据的多个报文可以通过LSP 106、LSP 107和LSP 108发送到PE 5。如此,数据流D不需要等待网络负载降低后再发送。In order to improve network bearer efficiency and network transmission efficiency, and reduce data transmission delay, a multipath transmission technology is proposed. Through the multi-path transmission technology, multiple packets including the data of the data stream can be sent from the sending end to the receiving end through multiple paths. For example, in FIG. 1A, multiple packets including the data of data flow C can be sent to PE 3 through multiple paths in LSP 103, LSP 104 and LSP 105, so as to reduce the load of choke point A. For another example, in Fig. 1B, LSP 106, LSP 107 and LSP 108 can meet the bandwidth requirement of data flow D together, so multiple messages including the data of data flow D can be sent through LSP 106, LSP 107 and LSP 108 to PE 5. In this way, the data flow D does not need to wait for the network load to decrease before sending it.
通过以上描述可以看出,多径传输技术可以提高网络承载效率和网络传输效率,降低数据传输时延。然而,多径传输技术也带来了新的问题:不同路径的传输时延不同,所以接收端接收报文的顺序与发送端发送报文的顺序不同,即接收端接收到的报文是乱序的。因此,接收端接收到报文后,需要对报文进行排序,以恢复数据流。但是,目前的报文排序方法要么需要较大的计算资源和存储资源,实现起来较为复杂,要么对网络的要求较高,可靠性低。It can be seen from the above description that the multi-path transmission technology can improve network bearing efficiency and network transmission efficiency, and reduce data transmission delay. However, multi-path transmission technology also brings new problems: the transmission delays of different paths are different, so the order in which the receiving end receives packets is different from the order in which the sending end sends packets, that is, the packets received by the receiving end are random. sequential. Therefore, after receiving the packets, the receiving end needs to sort the packets to restore the data flow. However, the current packet sorting methods either require relatively large computing resources and storage resources, and are relatively complicated to implement, or have high requirements on the network and low reliability.
发明内容Contents of the invention
本申请提供传输报文的方法及装置,可以对报文进行排序,实现简单,可靠性高。The application provides a method and device for transmitting messages, which can sort the messages, and is simple to implement and highly reliable.
为达到上述目的,本申请的实施例采用如下技术方案:In order to achieve the above object, the embodiments of the present application adopt the following technical solutions:
第一方面,提供了一种传输报文的方法,执行该方法的通信装置可以为接收端;也可以为应用于接收端中的模块,例如芯片或芯片系统。下面以执行主体为接收端为例进行描述。该方法包括:接收发送端通过第一路径发送的第一业务的第一报文,该第一报文携带第一发送时戳,该第一发送时戳对应于在该发送端的时域上,发送该第一报文的时间,该第一路径是传输该第一业务的报文至该接收端的多个路径中的一个;获得该第一业务的第一时延参数,该第一时延参数是根据该多个路径的第一最大传输时延确定的;根据该第一发送时戳和该第一时延参数获得第一预计读取时间;根据该第一预计读取时间读取该第一报文的数据。In the first aspect, a method for transmitting a message is provided, and the communication device executing the method may be a receiving end; it may also be a module applied to the receiving end, such as a chip or a chip system. The following takes the execution subject as the receiving end as an example for description. The method includes: receiving a first packet of a first service sent by a sending end through a first path, the first packet carrying a first sending timestamp, the first sending timestamp corresponding to the time domain of the sending end, The time when the first message is sent, the first path is one of the multiple paths for transmitting the message of the first service to the receiving end; the first delay parameter of the first service is obtained, and the first delay The parameter is determined according to the first maximum transmission delay of the plurality of paths; the first estimated read time is obtained according to the first sending timestamp and the first delay parameter; the read time is read according to the first expected read time The data of the first message.
基于上述第一方面提供的方法,接收端可以对接收到的报文进行整体排序,不区分业务,可以降低接收端的复杂度,减少计算资源和存储资源的消耗。而且对于任一业务,其报文也是保序的,不影响业务的功能。在排序的过程中,接收端是根据预计读取报文的数据的时间读取报文的数据,某一个业务的时戳异常不影响接收端读取其他业务的报文的数据,可靠性高。上述第一方面提供的方法也不需要引入老化时间,可以减小时延抖动。另外,上述第一方面提供的方法对传输网络没有特殊要求,在发送端和接收端部署即可,实现简单。Based on the method provided in the first aspect above, the receiving end can sort the received messages as a whole without distinguishing services, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources. Moreover, for any service, its packets are also in order, which does not affect the function of the service. In the process of sorting, the receiving end reads the data of the message according to the expected time to read the data of the message. The abnormal time stamp of a certain service does not affect the receiving end to read the data of other service messages, and the reliability is high. . The method provided in the first aspect above does not need to introduce aging time, and can reduce delay jitter. In addition, the method provided in the first aspect above has no special requirements on the transmission network, and can be deployed at the sending end and the receiving end, which is easy to implement.
结合第一方面,在一种可能的实现方式中,根据该第一预计读取时间读取该第一报文的数据,包括:在按照时间排序的多个队列中,根据该第一预计读取时间将该第一报文入队;在已达到或者超过该第一预计读取时间、并且该多个队列指示轮到读取该第一报文的数据的情况下,读取该第一报文的数据。基于上述方法,因为多个队列是按照时间排序的,因此根据第一预计读取时间将第一报文入队后,接收端就实现了对接收到的报文的排序。后续,接收端在已达到或者超过该第一预计读取时间、并且该多个队列指示轮到读取该第一报文的数据的情况下,读取该第一报文的数据,可以实现按照报文的排序读取报文中的数据。With reference to the first aspect, in a possible implementation manner, reading the data of the first message according to the first expected reading time includes: in multiple queues sorted by time, according to the first expected reading time Enqueue the first message at the fetch time; when the first expected read time has been reached or exceeded, and the plurality of queues indicate that it is time to read the data of the first message, read the first The data of the message. Based on the above method, because the multiple queues are sorted according to time, after the first message is enqueued according to the first expected reading time, the receiving end realizes the sorting of the received messages. Subsequently, when the receiving end has reached or exceeded the first expected reading time and the multiple queues indicate that it is the turn to read the data of the first message, the receiving end reads the data of the first message, which can realize Read the data in the message according to the order of the message.
结合第一方面,在一种可能的实现方式中,该多个队列包括第一队列,根据该第一预计读取时间将该第一报文入队,包括:根据该第一预计读取时间与当前时间的差值,将该第一报文的信息输入该第一队列,该第一预计读取时间与当前时间的差值属于该第一队列对应的时间差值区间。基于上述方法,接收端可以根据第一预计读取时间与当前时间的差值,将第一报文入队,即实现了对接收到的报文的排序。With reference to the first aspect, in a possible implementation manner, the multiple queues include a first queue, and enqueuing the first message according to the first expected read time includes: according to the first expected read time The difference between the current time and the information of the first message is input into the first queue, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the first queue. Based on the above method, the receiving end can put the first message into the queue according to the difference between the first expected reading time and the current time, that is, sorting of the received messages is realized.
结合第一方面,在一种可能的实现方式中,若该第一队列中还存储了第二报文的信息,若该第一预计读取时间早于该第二报文的预计读取时间,则该第一报文的信息从该第一队列输出的时间,早于该第二报文的信息从该第一队列输出的时间;或者,若该第一预计读取时间晚于该第二报文的预计读取时间,则该第一报文的信息从该第一队列输出的时间,晚于该第二报文的信息从该第一队列输出的时间。基于上述方法,接收端可以根据第一预计读取时间和第二报文的预计读取时间确定第一报文和第二报文在第一队列中的位置,实现对第一队列中的报文排序。In combination with the first aspect, in a possible implementation, if the first queue also stores information about the second message, if the first expected read time is earlier than the expected read time of the second message , then the time when the information of the first message is output from the first queue is earlier than the time when the information of the second message is output from the first queue; or, if the first expected reading time is later than the first As for the expected reading time of the second message, the time when the information of the first message is output from the first queue is later than the time when the information of the second message is output from the first queue. Based on the above method, the receiving end can determine the positions of the first message and the second message in the first queue according to the first expected reading time and the expected reading time of the second message, so as to realize the Document sorting.
结合第一方面,在一种可能的实现方式中,该第二报文为该发送端发送的除该第一报文之外的第一业务的其他报文,该发送端发送的其他业务的报文,或其他发送端发送的报文。基于上述方法,接收端可以对接收到的报文进行整体排序,不区分业务,也不区分发送端,可以降低接收端的复杂度,减少计算资源和存储资源的消耗。With reference to the first aspect, in a possible implementation manner, the second message is other messages of the first service sent by the sending end except the first message, and the messages of other services sent by the sending end message, or other messages sent by the sender. Based on the above method, the receiving end can sort the received messages as a whole, without distinguishing between services and sending ends, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources.
结合第一方面,在一种可能的实现方式中,该方法还包括:若该第一预计读取时间与当前时间的差值,小于该第一队列对应的时间差值区间的最小值,则将该第一报文的信息从该第一队列输出,输入到第二队列,该第二队列包括在该多个队列中,该第一预计读取时间与当前时间的差值属于该第二队列对应的时间差值区间。基于上述方法,多个队列在时域上是 串联关系。随着时间的流逝,队列中的信息可以从一个队列输出,输入到另一个队列中。如此,接收端可以实现按照队列中的顺序读取报文的数据。With reference to the first aspect, in a possible implementation manner, the method further includes: if the difference between the first expected read time and the current time is smaller than the minimum value of the time difference interval corresponding to the first queue, then The information of the first message is output from the first queue and input to the second queue, the second queue is included in the plurality of queues, and the difference between the first expected reading time and the current time belongs to the second queue The time difference interval corresponding to the queue. Based on the above method, multiple queues are connected in series in the time domain. Over time, information in the queues can be output from one queue and input to another. In this way, the receiving end can read the data of the message according to the sequence in the queue.
结合第一方面,在一种可能的实现方式中,该多个队列分为多组,该第一队列包括在第一组队列中,该第二队列包括在第二组队列中,该第一组队列中的队列对应的时间差值区间的长度,大于该第二组队列中的队列对应的时间差值区间的长度。基于上述方法,可以为不同组的队列配置不同的时间差值区间长度。如此,可以大量减少队列的数量,降低接收端维护队列的复杂度。With reference to the first aspect, in a possible implementation manner, the multiple queues are divided into multiple groups, the first queue is included in the first group of queues, the second queue is included in the second group of queues, the The length of the time difference interval corresponding to the queues in the first group of queues is greater than the length of the time difference interval corresponding to the queues in the second group of queues. Based on the above method, different time difference interval lengths can be configured for queues of different groups. In this way, the number of queues can be greatly reduced, and the complexity of maintaining queues at the receiving end can be reduced.
结合第一方面,在一种可能的实现方式中,根据该第一发送时戳和该第一时延参数获得第一预计读取时间,包括:将该第一发送时戳映射到该接收端的时域上以得到第二发送时戳;根据该第二发送时戳和该第一时延参数获得该第一预计读取时间。基于上述方法,在接收端和发送端在时域上不同步的情况下,接收端可以先进行发送端和接收端之间的时域映射,将接收端和发送端的时域统一起来,再在统一后的时域上获得第一预计读取时间。With reference to the first aspect, in a possible implementation manner, obtaining the first expected read time according to the first sending time stamp and the first delay parameter includes: mapping the first sending time stamp to the receiving end In the time domain, the second sending time stamp is obtained; and the first expected reading time is obtained according to the second sending time stamp and the first delay parameter. Based on the above method, when the receiving end and the sending end are not synchronized in the time domain, the receiving end can perform time domain mapping between the sending end and the receiving end to unify the time domains of the receiving end and the sending end, and then The first estimated reading time is obtained in the unified time domain.
结合第一方面,在一种可能的实现方式中,该方法还包括:获取第一参考时戳、第二参考时戳和第一时钟映射参数,该第一参考时戳为在该发送端的时域上、第一时刻对应的时间,该第二参考时戳为在该接收端的时域上、该第一时刻对应的时间;将该第一发送时戳映射到该接收端的时域上以得到第二发送时戳,包括:根据该第一发送时戳、该第一参考时戳、该第二参考时戳和该第一时钟映射参数,获得该第二发送时戳。基于上述方法,可以得到第二发送时戳,从而可以根据第二发送时戳和第一时延参数获得第一预计读取时间。With reference to the first aspect, in a possible implementation manner, the method further includes: acquiring a first reference time stamp, a second reference time stamp, and a first clock mapping parameter, where the first reference time stamp is a time stamp at the sending end domain, the time corresponding to the first moment, the second reference timestamp is the time corresponding to the first moment in the time domain of the receiving end; the first sending timestamp is mapped to the time domain of the receiving end to obtain The second sending time stamp includes: obtaining the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter. Based on the above method, the second sending time stamp can be obtained, so that the first expected reading time can be obtained according to the second sending time stamp and the first delay parameter.
结合第一方面,在一种可能的实现方式中,第一时刻对应于该发送端通过该第一路径向该接收端发送该第一业务的第三报文的时间,该方法还包括:根据第一传输时延、第二传输时延和调整因子,调整该第一时钟映射参数,该第一传输时延为该第一报文从该发送端传输至该接收端的传输时延,该第二传输时延为该第三报文从该发送端传输至该接收端的传输时延。基于上述方法,可以调整第一时钟映射参数,使得发送端和接收端之间的时域映射更为准确。With reference to the first aspect, in a possible implementation manner, the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path, and the method further includes: according to The first transmission delay, the second transmission delay and the adjustment factor adjust the first clock mapping parameter, the first transmission delay is the transmission delay of the first message from the sending end to the receiving end, the second The second transmission delay is the transmission delay of the third packet from the sending end to the receiving end. Based on the above method, the first clock mapping parameter can be adjusted, so that the time domain mapping between the sending end and the receiving end is more accurate.
结合第一方面,在一种可能的实现方式中,第一时延参数是根据该多个路径的第一最大传输时延确定的,包括:该第一时延参数是根据该多个路径的第一最大传输时延、和第一余量确定的,该第一余量为正数。基于上述方法,通过一个补偿值,即第一余量,尽量使得根据该补偿值补偿后的第一最大传输时延(即第一时延参数)大于或等于多个路径的最大传输时延。如此,可以避免多个路径的最大传输时延估计的较小而导致报文排序错误的情况出现。With reference to the first aspect, in a possible implementation manner, the first delay parameter is determined according to the first maximum transmission delay of the multiple paths, including: the first delay parameter is determined according to the first maximum transmission delay of the multiple paths Determined by the first maximum transmission delay and the first margin, the first margin is a positive number. Based on the above method, a compensation value, that is, the first margin, is used to make the first maximum transmission delay compensated according to the compensation value (ie, the first delay parameter) greater than or equal to the maximum transmission delays of multiple paths. In this way, it is possible to avoid the situation that the estimation of the maximum transmission delay of multiple paths is small, which leads to wrong ordering of packets.
结合第一方面,在一种可能的实现方式中,若该第一时延参数和该第一最大传输时延的差值大于第一阈值,并且持续第一时间,则调整该第一时延参数。基于上述方法,在第一时延参数和第一最大传输时延的差值大于第一阈值,并且持续第一时间的情况下,可以表示当前的第一时延参数是偏大的。在这种情况下,接收端可以调整第一时延参数,避免由于第一时延较大而引入的不必要的时延。With reference to the first aspect, in a possible implementation manner, if the difference between the first delay parameter and the first maximum transmission delay is greater than a first threshold and lasts for a first time, then adjust the first delay parameter. Based on the above method, if the difference between the first delay parameter and the first maximum transmission delay is greater than the first threshold and lasts for the first time, it may indicate that the current first delay parameter is too large. In this case, the receiving end may adjust the first time delay parameter to avoid unnecessary time delay introduced due to a large first time delay.
结合第一方面,在一种可能的实现方式中,该方法还包括:比较存储的第四发送时戳和该第一发送时戳的大小,其中,该第四发送时戳携带在第五报文中,该第五报文是在读取该第一报文之前最新被读取的该第一业务的报文;若该第四发送时戳大于该第一发送时戳,则调整该第一时延参数。基于上述方法,若第四发送时戳大于第一发送时戳,则表示第一报文排序错误。在这种情况下,表示当前的第一时延参数是偏小的,因此可以调整第一时延参数,使得第一时延参数更为准确。With reference to the first aspect, in a possible implementation manner, the method further includes: comparing the stored fourth sending timestamp with the size of the first sending timestamp, where the fourth sending timestamp is carried in the fifth packet Herein, the fifth message is the latest message of the first service that was read before the first message; if the fourth sending time stamp is greater than the first sending time stamp, the fourth sending time stamp is adjusted A delay parameter. Based on the above method, if the fourth sending timestamp is greater than the first sending timestamp, it means that the first packet is wrongly sorted. In this case, it means that the current first delay parameter is too small, and therefore the first delay parameter may be adjusted to make the first delay parameter more accurate.
结合第一方面,在一种可能的实现方式中,该方法还包括:接收该发送端发送的该第一 业务的第四报文,该第四报文携带第三发送时戳,该第三发送时戳对应于在该发送端的时域上,发送该第四报文的时间;比较该第一发送时戳和该第三发送时戳的大小,确定该第一报文的排序是否正确;若该第一报文排序错误,则调整该第一时延参数。基于上述方法,在检测到第一报文排序错误的情况下,可以确定当前的第一时延参数是偏小的,因此可以调整第一时延参数,使得第一时延参数更为准确。With reference to the first aspect, in a possible implementation manner, the method further includes: receiving a fourth message of the first service sent by the sending end, where the fourth message carries a third sending timestamp, and the third The sending time stamp corresponds to the time when the fourth message is sent in the time domain of the sending end; comparing the size of the first sending time stamp and the third sending time stamp to determine whether the ordering of the first message is correct; If the first packet is wrongly sorted, adjust the first delay parameter. Based on the above method, in the case that the first packet sorting error is detected, it can be determined that the current first delay parameter is too small, so the first delay parameter can be adjusted to make the first delay parameter more accurate.
结合第一方面,在一种可能的实现方式中,该方法还包括:若该第一报文的排序错误,发送告警信息。基于上述方法,接收端可以发送告警信息,以便用户或管理员根据告警信息做进一步处理。With reference to the first aspect, in a possible implementation manner, the method further includes: if the sequence of the first packet is wrong, sending an alarm message. Based on the above method, the receiving end can send the alarm information, so that the user or the administrator can perform further processing according to the alarm information.
第二方面,提供了一种通信装置用于实现上述方法。该通信装置可以为上述第一方面中的接收端,或者包含上述接收端的装置。该通信装置包括实现上述方法相应的模块、单元、或手段(means),该模块、单元、或means可以通过硬件实现,软件实现,或者通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块或单元。In a second aspect, a communication device for implementing the above method is provided. The communication device may be the receiving end in the above first aspect, or a device including the above receiving end. The communication device includes a corresponding module, unit, or means (means) for implementing the above method, and the module, unit, or means may be implemented by hardware, software, or by executing corresponding software on hardware. The hardware or software includes one or more modules or units corresponding to the above functions.
结合上述第二方面,在一种可能的实现方式中,该通信装置可以包括接收模块和处理模块。该接收模块,也可以称为接收单元,用以实现上述第一方面及其任一可能的实现方式中的接收功能。该接收模块可以由收发电路,收发机,收发器或者通信接口构成。该处理模块,可以用于实现上述第一方面及其任一可能的实现方式中的处理功能。该处理模块例如可以为处理器。With reference to the second aspect above, in a possible implementation manner, the communication device may include a receiving module and a processing module. The receiving module, which may also be referred to as a receiving unit, is configured to implement the receiving function in the above first aspect and any possible implementation manner thereof. The receiving module may be composed of a transceiver circuit, a transceiver, a transceiver or a communication interface. The processing module may be used to implement the processing function in the above first aspect and any possible implementation manner thereof. The processing module may be, for example, a processor.
第三方面,提供了一种通信装置,包括:处理器;该处理器用于与存储器耦合,并读取存储器中的指令之后,根据该指令执行如上述第一方面及其任一可能的实现方式中所述的方法。该通信装置可以为上述第一方面及其任一可能的实现方式中的接收端,或者包含上述接收端的装置。In a third aspect, a communication device is provided, including: a processor; the processor is configured to be coupled with a memory, and after reading an instruction in the memory, execute the above-mentioned first aspect and any possible implementation thereof according to the instruction method described in . The communication device may be the receiving end in the above first aspect and any possible implementation manner thereof, or a device including the above receiving end.
结合上述第三方面,在一种可能的实现方式中,该通信装置还包括存储器,该存储器,用于保存必要的程序指令和数据。With reference to the third aspect above, in a possible implementation manner, the communications device further includes a memory, where the memory is configured to store necessary program instructions and data.
结合上述第三方面,在一种可能的实现方式中,该通信装置为芯片或芯片系统。可选的,该通信装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。With reference to the third aspect above, in a possible implementation manner, the communication device is a chip or a chip system. Optionally, when the communication device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
第四方面,提供了一种通信装置,包括:处理器和接口电路;接口电路,用于接收计算机程序或指令并传输至处理器;处理器用于执行所述计算机程序或指令,以使该通信装置执执行如上述第一方面及其任一可能的实现方式中所述的方法。In a fourth aspect, a communication device is provided, including: a processor and an interface circuit; the interface circuit is used to receive computer programs or instructions and transmit them to the processor; the processor is used to execute the computer programs or instructions, so that the communication The device executes the method described in the above first aspect and any possible implementation manner thereof.
结合上述第四方面,在一种可能的实现方式中,该通信装置为芯片或芯片系统。可选的,该通信装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。With reference to the fourth aspect above, in a possible implementation manner, the communication device is a chip or a chip system. Optionally, when the communication device is a system-on-a-chip, it may consist of chips, or may include chips and other discrete devices.
第五方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面及其任一可能的实现方式中所述的方法。In a fifth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores instructions, and when it is run on a computer, the computer can execute the above-mentioned first aspect and any possible implementation manners thereof. the method described.
第六方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第一方面及其任一可能的实现方式中所述的方法。In a sixth aspect, a computer program product including instructions is provided, and when it is run on a computer, the computer can execute the method described in the above first aspect and any possible implementation thereof.
第七方面,提供了一种传输报文的方法,该方法包括:发送端将第一发送时戳插入到第一业务的第一报文中;通过第一路径向接收端发送该第一报文,其中该第一发送时戳对应于在该发送端的时域上;发送该第一报文的时间,该第一路径是传输该第一业务的报文至该接收端的多个路径中的一个;接收端,执行上述第一方面及其任一可能的实现方式中所述的方法。In a seventh aspect, a method for transmitting a message is provided, the method comprising: inserting a first sending timestamp into a first message of a first service at a sending end; sending the first message to a receiving end through a first path text, wherein the first sending timestamp corresponds to the time domain of the sending end; the time of sending the first message, and the first path is one of the multiple paths for transmitting the message of the first service to the receiving end One: The receiving end executes the method described in the above first aspect and any possible implementation thereof.
第八方面,提供了一种通信系统,该通信系统包括:发送端和接收端;该发送端,用于 将第一发送时戳插入到第一业务的第一报文中,通过第一路径向接收端发送该第一报文,该第一发送时戳对应于在该发送端的时域上,发送该第一报文的时间,该第一路径是传输该第一业务的报文至该接收端的多个路径中的一个;该接收端,用于执行上述第一方面及其任一可能的实现方式中所述的方法。According to an eighth aspect, a communication system is provided, and the communication system includes: a sending end and a receiving end; the sending end is configured to insert a first sending time stamp into a first packet of a first service through a first path sending the first message to the receiving end, the first sending time stamp corresponds to the time when the first message is sent in the time domain of the sending end, and the first path is to transmit the message of the first service to the One of the multiple paths of the receiving end; the receiving end is configured to execute the method described in the above first aspect and any possible implementation manner thereof.
其中,第二方面至第八方面中任一种可能的实现方式所带来的技术效果可参见上述第一方面及其任一种可能的实现方式所带来的技术效果,此处不再赘述。Wherein, for the technical effects brought about by any one of the possible implementations from the second aspect to the eighth aspect, please refer to the technical effects brought about by the above-mentioned first aspect and any possible implementations thereof, and will not be repeated here. .
附图说明Description of drawings
图1A为网络传输路径的示意图一;FIG. 1A is a first schematic diagram of a network transmission path;
图1B为网络传输路径的示意图二;FIG. 1B is a second schematic diagram of a network transmission path;
图2A为本申请实施例提供的网络传输路径的示意图;FIG. 2A is a schematic diagram of a network transmission path provided by an embodiment of the present application;
图2B为本申请实施例提供的按照时戳对报文排序的示意图;FIG. 2B is a schematic diagram of sorting messages according to timestamps provided by the embodiment of the present application;
图3为本申请实施例提供的报文传输的示意图;FIG. 3 is a schematic diagram of message transmission provided by an embodiment of the present application;
图4为本申请实施例提供的通信系统架构示意图;FIG. 4 is a schematic diagram of a communication system architecture provided by an embodiment of the present application;
图5为本申请实施例提供的通信装置的硬件结构示意图;FIG. 5 is a schematic diagram of a hardware structure of a communication device provided by an embodiment of the present application;
图6为本申请实施例提供的传输报文的方法的流程示意图;FIG. 6 is a schematic flowchart of a method for transmitting a message provided in an embodiment of the present application;
图7A为本申请实施例提供的多个队列的示意图一;FIG. 7A is a first schematic diagram of multiple queues provided by the embodiment of the present application;
图7B为本申请实施例提供的多个队列的示意图二;FIG. 7B is a second schematic diagram of multiple queues provided by the embodiment of the present application;
图8为本申请实施例提供的接收端接收报文的示意图;FIG. 8 is a schematic diagram of receiving a message at a receiving end provided in an embodiment of the present application;
图9为本申请实施例提供的一种通信装置的结构示意图。FIG. 9 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请实施例的实施方式进行详细描述。The implementation of the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
为了解决多径传输带来的接收端接收到的报文是乱序的问题,发送端可以通过多种方法向接收端发送报文,使得接收端可以对接收到的报文进行排序,以恢复数据流。例如,发送端可以通过如下方法向接收端发送报文:In order to solve the problem that the packets received by the receiving end are out of order caused by multi-path transmission, the sending end can send packets to the receiving end through various methods, so that the receiving end can sort the received packets to restore data flow. For example, the sender can send a message to the receiver in the following ways:
方法1:发送端可以在向接收端发送的报文中插入序列号(sequence number,SN)。该SN是以业务为粒度的,也就是说,每个业务都对应了一组SN。对于任一业务,SN是随着发送的报文数量的增加逐渐增大的。例如,对于任一业务,发送端发送的第一个报文插入的SN是1,第二个报文插入的SN是2,第三个报文插入的SN是3,以此类推。这些报文可以通过多个传输路径发送到接收端。接收端接收到这些报文后,可以根据SN对报文排序。示例性的,接收端接收到这些报文后,可以以业务为粒度,将报文携带的SN与能够指示接收端的一块缓存地址的指针(pointer,PTR)做映射(不同业务对应的SN映射的PTR不同)。后续,不同业务对应的排序器需要持续检测该业务的当前PTR对应的报文是否收到,若收到,则读取当前指针对应的缓存地址中的报文,再继续检测下一个指针对应的报文是否收到。若没有收到,则接收端等待该报文。如此,接收端的排序器可以以业务为粒度,对接收到的报文进行排序。Method 1: The sender can insert a sequence number (SN) into the message sent to the receiver. The SN is granular by service, that is to say, each service corresponds to a group of SNs. For any service, SN increases gradually with the increase of the number of packets sent. For example, for any service, the SN inserted in the first message sent by the sender is 1, the SN inserted in the second message is 2, the SN inserted in the third message is 3, and so on. These messages can be sent to the receiver through multiple transmission paths. After receiving these packets, the receiving end can sort the packets according to the SN. Exemplarily, after receiving these messages, the receiving end may map the SN carried in the message with a pointer (pointer, PTR) that can indicate a cache address of the receiving end at the granularity of the service (the SN corresponding to different services is mapped PTR is different). Subsequently, the sequencers corresponding to different services need to continuously detect whether the message corresponding to the current PTR of the service is received. If received, read the message in the buffer address corresponding to the current pointer, and then continue to detect the message corresponding to the next pointer. Whether the message is received. If not received, the receiver waits for the message. In this way, the sorter at the receiving end can sort the received packets at the granularity of the service.
方法2:发送端可以在向接收端发送的报文中插入发送时戳。该发送时戳为网络中的全局同步时戳。也就是说,网络中的各个节点,例如,发送端、接收端和发送端与接收端之间每条传输路径上的节点,是时间同步的。发送端发送报文后,接收端以及传输路径中的每个节点都根据报文携带的发送时戳对报文排序。Method 2: The sending end can insert a sending timestamp in the message sent to the receiving end. The sending time stamp is a global synchronization time stamp in the network. That is to say, each node in the network, for example, the sending end, the receiving end, and the nodes on each transmission path between the sending end and the receiving end are time-synchronized. After the sending end sends the message, the receiving end and each node in the transmission path sort the message according to the sending timestamp carried in the message.
示例性的,如图2A所示,PE 0的数据流可以通过LSP 201、LSP 202和LSP 203从PE 0 发送到PE 5。其中,LSP 201包括PE 1、PE 4和PE 5。LSP 202包括PE 2、PE 4和PE 5。LSP 203包括PE 3、PE 4和PE 5。PE 0发送报文后,PE 1、PE 2、PE 3、PE 4和PE 5都要根据报文携带的发送时戳对接收到的报文排序。以PE 4为例,PE 4接收到来自PE 1、PE 2和PE 3的报文后,可以根据发送时戳对接收到的报文排序,再将排序后的报文按照顺序发送给PE 5。例如,如图2B所示,PE 4可以为来自PE 1、PE 2和PE 3的报文分别建立队列。其中,队列1为PE 4为来自PE 1的报文建立的队列。队列2为PE 4为来自PE 2的报文建立的队列。队列3为PE 4为来自PE 3的报文建立的队列。因为PE 1、PE 2和PE 3之前都对各自接收到的报文进行了排序,所以PE 1、PE 2和PE 3发送的报文是保序的。在这种情况下,PE 4可以比较每个队列当前输出的报文携带的发送时戳的大小,先读取发送时戳较小的报文,如此可以实现对报文的排序。Exemplarily, as shown in FIG. 2A, the data flow of PE 0 can be sent from PE 0 to PE 5 through LSP 201, LSP 202 and LSP 203. Among them, LSP 201 includes PE 1, PE 4 and PE 5. LSP 202 includes PE 2, PE 4 and PE 5. LSP 203 includes PE 3, PE 4 and PE 5. After PE 0 sends a packet, PE 1, PE 2, PE 3, PE 4, and PE 5 all sort the received packets according to the sending timestamp carried in the packet. Taking PE 4 as an example, after receiving packets from PE 1, PE 2, and PE 3, PE 4 can sort the received packets according to the sending timestamp, and then send the sorted packets to PE 5 in order . For example, as shown in Figure 2B, PE 4 can establish queues for packets from PE 1, PE 2, and PE 3 respectively. Among them, queue 1 is a queue established by PE 4 for packets from PE 1. Queue 2 is a queue established by PE 4 for packets from PE 2. Queue 3 is a queue established by PE 4 for packets from PE 3. Because PE 1, PE 2, and PE 3 have sorted the received packets before, the packets sent by PE 1, PE 2, and PE 3 are in order. In this case, PE 4 can compare the size of the sending timestamps carried by the packets currently output by each queue, and read the packets with smaller sending timestamps first, so that the packets can be sorted.
方法3:发送端可以通过第一路径向接收端发送第一业务的第一报文,第一报文携带了第一发送时戳。接收端通过第一路径接收到第一报文后,可以根据多个路径的第一最大传输时延确定第一时延参数,根据第一时延参数和第一发送时戳获得第一预计读取时间,并根据第一预计读取时间读取第一报文的数据。该方法将在下述图6所示的实施例中进行具体阐述,在此不做赘述。Method 3: The sending end may send the first message of the first service to the receiving end through the first path, and the first message carries the first sending timestamp. After the receiving end receives the first message through the first path, it can determine the first delay parameter according to the first maximum transmission delay of multiple paths, and obtain the first expected read time according to the first delay parameter and the first sending timestamp. Get the time, and read the data of the first message according to the first estimated read time. This method will be described in detail in the embodiment shown in FIG. 6 below, and will not be repeated here.
为了便于理解下述图6所示实施例中所述的传输报文的方法,先对该方法的原理进行说明。In order to facilitate the understanding of the method for transmitting packets described in the embodiment shown in FIG. 6 below, the principle of the method will be described first.
如前文所述,报文在不同路径中的传输时延不同,所以接收端接收到的报文是乱序的。那么,接收端接收到报文后,可以获取不同路径中的最大传输时延,根据发送时戳和最大传输时延获得报文的预计读取时间,再根据这个时间读取报文。如此,接收端读取报文的顺序与发送端发送报文的顺序是一致的,即接收端读取的报文是保序的。As mentioned above, the transmission delays of packets on different paths are different, so the packets received by the receiver are out of sequence. Then, after receiving the message, the receiving end can obtain the maximum transmission delay in different paths, obtain the estimated reading time of the message according to the sending timestamp and the maximum transmission delay, and then read the message according to this time. In this way, the order in which the receiving end reads the packets is consistent with the order in which the sending end sends the packets, that is, the packets read by the receiving end are in order.
以图2A所示的网络为例,如图3所示,PE 0通过LSP 201向PE 5发送了报文1,报文1携带的发送时戳为T1时刻。之后,PE 0通过LSP 202向PE 5发送了报文2,报文2携带的发送时戳为T2时刻。之后,PE 0通过LSP 203向PE 5发送了报文3,报文3携带的发送时戳为T3时刻。其中,T1=2纳秒(ns),T2=4ns,T3=6ns。若PE 5在T4时刻接收到了报文2,在T5时刻接收到了报文3,在T6时刻接收到了报文1,其中,T4=5ns,T5=7ns,T6=8ns,则报文1的传输时延为T6-T1=6ns,报文2的传输时延为T4-T2=1ns,报文3的传输时延为T5-T3=1ns。由此可以看出,LSP 201、LSP 202和LSP 203中,LSP 201的传输时延最大。接收端可以将报文的发送时戳与多个路径中的最大传输时延之和,作为报文的预计读取时间。例如,报文1的预计读取时间T6=T1+6=8ns,报文2的预计读取时间T7=T2+6=10ns,报文3的预计读取时间T8=T3+6=12ns。如此,接收端根据预计读取时间读取的报文是保序的。接收端读取的报文在时间轴上的相对位置关系,和发送端发送的报文在时间轴上的相对位置关系相比,没有发生改变,是在时间轴上延时平移。Taking the network shown in Figure 2A as an example, as shown in Figure 3, PE 0 sends message 1 to PE 5 through LSP 201, and the sending timestamp carried in message 1 is time T1. After that, PE 0 sends message 2 to PE 5 through LSP 202, and the sending time stamp carried in message 2 is time T2. Afterwards, PE 0 sends message 3 to PE 5 through LSP 203, and the sending time stamp carried in message 3 is time T3. Wherein, T1=2 nanoseconds (ns), T2=4ns, T3=6ns. If PE 5 receives message 2 at time T4, receives message 3 at time T5, and receives message 1 at time T6, wherein, T4=5ns, T5=7ns, T6=8ns, then the transmission of message 1 The time delay is T6-T1=6ns, the transmission time delay of message 2 is T4-T2=1ns, and the transmission time delay of message 3 is T5-T3=1ns. It can be seen from this that among LSP 201, LSP 202 and LSP 203, LSP 201 has the largest transmission delay. The receiving end can use the sum of the sending timestamp of the message and the maximum transmission delay in multiple paths as the expected reading time of the message. For example, the expected reading time of message 1 is T6=T1+6=8ns, the expected reading time of message 2 is T7=T2+6=10ns, and the expected reading time of message 3 is T8=T3+6=12ns. In this way, the packets read by the receiving end according to the estimated read time are in order. Compared with the relative positional relationship on the time axis of the message read by the receiving end and the relative positional relationship on the time axis of the message sent by the sending end, there is no change, and it is a delay translation on the time axis.
与方法1相比,图6所示的方法不要求以业务为粒度对报文进行排序,而是可以对接收到的报文整体排序,不区分业务。因此,图6所示的方法不需要为每个业务准备对应的排序器,也即是图6所示的方法中,为实现对报文的排序,不需要调度多个排序器,可以降低接收端的复杂度,还可以减少计算资源和存储资源的消耗。另外,接收端根据报文的预计读取时间读取报文即可,不需要引入老化时间(即收端等待报文的时间),可以减小时延抖动。Compared with method 1, the method shown in Figure 6 does not require packets to be sorted at the granularity of services, but can sort the received packets as a whole without distinguishing services. Therefore, the method shown in Figure 6 does not need to prepare a corresponding sorter for each service, that is, in the method shown in Figure 6, in order to achieve the sorting of packets, there is no need to schedule multiple sorters, which can reduce the reception The complexity of the terminal can also reduce the consumption of computing resources and storage resources. In addition, the receiving end only needs to read the message according to the expected reading time of the message, and there is no need to introduce aging time (that is, the time for the receiving end to wait for the message), which can reduce the delay jitter.
与方法2相比,图6所示的方法不要求网络中的各个节点时间同步,也不要求传输路径中的节点都要对报文排序。在图6所示的方法中,接收端对接收到报文进行排序即可,对网络要求不高,实现简单。Compared with method 2, the method shown in FIG. 6 does not require time synchronization of each node in the network, and does not require all nodes in the transmission path to sort packets. In the method shown in FIG. 6 , the receiving end only needs to sort the received messages, which has low requirements on the network and is easy to implement.
如图4所示,为本申请实施例提供的通信系统40的架构示意图。图4中,通信系统40可以包括发送端401、接收端402和网络403。发送端401和接收端402可以通过网络403通信。例如,发送端401发送的报文可以通过网络403中的多条路径到达接收端402。As shown in FIG. 4 , it is a schematic structural diagram of a communication system 40 provided in the embodiment of the present application. In FIG. 4 , a communication system 40 may include a sending end 401 , a receiving end 402 and a network 403 . The sending end 401 and the receiving end 402 can communicate through the network 403 . For example, a packet sent by the sending end 401 may reach the receiving end 402 through multiple paths in the network 403 .
图4中的发送端401或接收端402可以是计算机,或具有收发功能的设备。例如,发送端401或接收端402可以为便携式计算机(如手机)、笔记本电脑、个人计算机(personal computer,PC)、可穿戴电子设备(如智能手表)、平板电脑等。发送端401或接收端402还可以是一种能够提供计算,或应用等服务的设备。可以理解的,发送端401或接收端402还可以称为终端设备、用户端、客户端、用户设备、移动站、移动台或服务器等。The sending end 401 or the receiving end 402 in FIG. 4 may be a computer, or a device with a sending and receiving function. For example, the sending end 401 or the receiving end 402 may be a portable computer (such as a mobile phone), a notebook computer, a personal computer (personal computer, PC), a wearable electronic device (such as a smart watch), a tablet computer, and the like. The sending end 401 or the receiving end 402 may also be a device capable of providing services such as computing or applications. It can be understood that the sending end 401 or the receiving end 402 may also be called a terminal device, a user end, a client, a user equipment, a mobile station, a mobile station or a server, and the like.
图4中的网络403也可以称为传输网络,可以用于传输发送端401和接收端402之间的数据。示例性的,网络403中包括多条路径,其中的任一条路径可以用于将发送端401发送的数据传输到接收端402。其中的任一条路径可以包括至少一个节点,该节点可以转发数据发送端401发送的数据,使得发送端401发送的数据可以到达接收端402。The network 403 in FIG. 4 may also be called a transmission network, and may be used to transmit data between the sending end 401 and the receiving end 402 . Exemplarily, the network 403 includes multiple paths, any of which may be used to transmit the data sent by the sending end 401 to the receiving end 402 . Any one of the paths may include at least one node, and the node may forward the data sent by the data sending end 401 , so that the data sent by the sending end 401 can reach the receiving end 402 .
图4所示的通信系统40仅用于举例,并非用于限制本申请的技术方案。本领域的技术人员应当明白,在具体实现过程中,通信系统40还可以包括其他设备,同时也可根据具体需要来确定发送端和接收端的数量,不予限制。例如,通信系统还可以包括发送端404。发送端404可以通过网络403与接收端402通信。The communication system 40 shown in FIG. 4 is only used as an example, and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in a specific implementation process, the communication system 40 may also include other devices, and the number of sending ends and receiving ends may also be determined according to specific needs, without limitation. For example, the communication system may further include a sending end 404 . The sending end 404 can communicate with the receiving end 402 through the network 403 .
可选的,本申请实施例图4中的各设备(例如接收端402等)也可以称之为通信装置,其可以是一个通用设备或者是一个专用设备,本申请实施例对此不作具体限定。Optionally, each device (such as the receiving end 402, etc.) in FIG. .
可选的,本申请实施例图4中的各设备(例如接收端402)的相关功能可以由一个设备实现,也可以由多个设备共同实现,还可以是由一个设备内的一个或多个功能模块实现,本申请实施例对此不作具体限定。可以理解的是,上述功能既可以是硬件设备中的网络元件,也可以是在专用硬件上运行的软件功能,或者硬件与软件的结合,或者平台(例如,云平台)上实例化的虚拟化功能。Optionally, the relevant functions of each device (such as the receiving end 402) in FIG. The functional modules are implemented, which is not specifically limited in this embodiment of the present application. It can be understood that the above-mentioned functions can be network elements in hardware devices, software functions running on dedicated hardware, or a combination of hardware and software, or instantiated virtualization on a platform (for example, a cloud platform) Function.
在具体实现时,图4所示的各设备都可以采用图5所示的组成结构,或者包括图5所示的部件。图5所示为可适用于本申请实施例的通信装置的硬件结构示意图。该通信装置50包括至少一个处理器501和至少一个通信接口504,用于实现本申请实施例提供的方法。该通信装置50还可以包括通信线路502和存储器503。During specific implementation, each device shown in FIG. 4 may adopt the composition structure shown in FIG. 5 , or include components shown in FIG. 5 . FIG. 5 is a schematic diagram of a hardware structure of a communication device applicable to an embodiment of the present application. The communication device 50 includes at least one processor 501 and at least one communication interface 504, configured to implement the method provided in the embodiment of the present application. The communication device 50 may also include a communication line 502 and a memory 503 .
处理器501可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 501 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more for controlling the execution of the application program program integrated circuit.
通信线路502可包括一通路,在上述组件之间传送信息,例如总线。Communication line 502 may include a path, such as a bus, for transferring information between the aforementioned components.
通信接口504,用于与其他设备或通信网络通信。通信接口504可以是任何收发器一类的装置,如可以是以太网接口、无线接入网(radio access network,RAN)接口、无线局域网(wireless local area networks,WLAN)接口、收发器、管脚、总线、或收发电路等。The communication interface 504 is used for communicating with other devices or a communication network. The communication interface 504 can be any device such as a transceiver, such as an Ethernet interface, a wireless access network (radio access network, RAN) interface, a wireless local area network (wireless local area networks, WLAN) interface, a transceiver, a pin , bus, or transceiver circuits, etc.
存储器503可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是 独立存在,通过通信线路502与处理器501相耦合。存储器503也可以和处理器501集成在一起。本申请实施例提供的存储器通常可以具有非易失性。其中,存储器503用于存储执行本申请实施例提供的方案所涉及的计算机执行指令,并由处理器501来控制执行。处理器501用于执行存储器503中存储的计算机执行指令,从而实现本申请实施例提供的方法。The memory 503 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types that can store information and instructions It can also be an electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be programmed by a computer Any other medium accessed, but not limited to. The memory may exist independently and be coupled with the processor 501 through the communication line 502. The memory 503 can also be integrated with the processor 501 . The memory provided by the embodiment of the present application may generally be non-volatile. Wherein, the memory 503 is used to store computer-executed instructions involved in implementing the solutions provided by the embodiments of the present application, and the execution is controlled by the processor 501 . The processor 501 is configured to execute computer-executed instructions stored in the memory 503, so as to implement the method provided in the embodiment of the present application.
本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。The computer-executed instructions in the embodiments of the present application may also be referred to as application program codes, which is not specifically limited in the embodiments of the present application.
本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。The coupling in the embodiments of the present application is an indirect coupling or a communication connection between devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
作为一种实施例,处理器501可以包括一个或多个CPU,例如图5中的CPU0和CPU1。As an embodiment, the processor 501 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 5 .
作为一种实施例,通信装置50可以包括多个处理器,例如图5中的处理器501和处理器507。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。As an embodiment, the communication device 50 may include multiple processors, for example, the processor 501 and the processor 507 in FIG. 5 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
作为一种实施例,通信装置50还可以包括输出设备505和/或输入设备506。输出设备505和处理器501耦合,可以以多种方式来显示信息。例如,输出设备505可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备506和处理器501耦合,可以以多种方式接收用户的输入。例如,输入设备506可以是鼠标、键盘、触摸屏设备或传感设备等。As an embodiment, the communication device 50 may further include an output device 505 and/or an input device 506 . Output device 505 is coupled to processor 501 and can display information in a variety of ways. For example, the output device 505 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector) Wait. The input device 506 is coupled to the processor 501 and can receive user input in various ways. For example, the input device 506 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
可以理解的,图5中示出的组成结构并不构成对该通信装置的限定,除图5所示部件之外,该通信装置可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It can be understood that the composition structure shown in FIG. 5 does not constitute a limitation to the communication device. In addition to the components shown in FIG. 5, the communication device may include more or less components than shown in the figure, or combine some components, or a different arrangement of components.
下面以图4所示架构为例,对本申请实施例提供的传输报文的方法进行描述。下述实施例中的各设备可以具备图5所示部件,不予赘述。The following uses the architecture shown in FIG. 4 as an example to describe the method for transmitting a packet provided by the embodiment of the present application. Each device in the following embodiments may have the components shown in FIG. 5 , which will not be described in detail.
需要说明的是,本申请实施例中,传输可以根据具体的上下文理解为发送和/或接收。传输可以是名词,也可以是动词。在不强调动作的执行主体时,常常用传输代替发送和/或接收。例如,短语传输报文,从发送端的角度来看,可以理解为发送报文,而从接收端的角度来看,可以理解为接收报文。It should be noted that, in this embodiment of the present application, transmission may be understood as sending and/or receiving according to a specific context. Transfer can be a noun or a verb. Transmission is often used instead of sending and/or receiving when the subject of the action is not emphasized. For example, the phrase transmission message can be understood as sending a message from the perspective of the sender, and can be understood as receiving a message from the perspective of the receiver.
需要说明的是,本申请下述实施例中各个设备之间的消息名字或消息中各参数的名字等只是一个示例,具体实现中也可以是其他的名字,本申请实施例对此不作具体限定。It should be noted that the names of the messages between devices or the names of the parameters in the messages in the following embodiments of the present application are just examples, and other names may also be used in specific implementations, which are not specifically limited in the embodiments of the present application. .
为了便于描述本申请实施例的技术方案,在本申请实施例中,可以采用“第一”、“第二”等字样对功能相同或相似的技术特征进行区分。该“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。在本申请实施例中,“示例性的”或者“例如”等词用于表示例子、例证或说明,被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。In order to facilitate the description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" may be used to distinguish technical features with the same or similar functions. The words "first" and "second" do not limit the number and execution order, and the words "first" and "second" do not necessarily mean that they must be different. In the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations, and any embodiment or design described as "exemplary" or "for example" should not be interpreted It is more preferred or more advantageous than other embodiments or design solutions. The use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner for easy understanding.
需要说明的是,在本申请实施例中,对于一种技术特征,通过“第一”、“第二”、“第三”、“A”、“B”、“C”和“D”等区分该种技术特征中的技术特征,该“第一”、“第二”、“第三”、“A”、“B”、“C”和“D”描述的技术特征间无先后顺序或者大小顺序。It should be noted that, in the embodiment of the present application, for a technical feature, "first", "second", "third", "A", "B", "C" and "D" etc. To distinguish the technical features of this type of technical features, the technical features described by the "first", "second", "third", "A", "B", "C" and "D" are in no order or order of size.
可以理解的,本申请实施例中同一个步骤或者具有相同功能的步骤或者技术特征在不同实施例之间可以互相参考借鉴。It can be understood that, in the embodiments of the present application, the same step or steps or technical features having the same function can be used for reference in different embodiments.
可以理解的,本申请实施例中,接收端可以执行本申请实施例中的部分或全部步骤,这些步骤仅是示例,本申请实施例还可以执行其它步骤或者各种步骤的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部步骤。It can be understood that in the embodiment of the present application, the receiving end may perform some or all of the steps in the embodiment of the present application, these steps are only examples, and the embodiment of the present application may also perform other steps or variations of various steps. In addition, each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all the steps in the embodiment of the present application.
在本申请实施例中,不限定传输报文的方法的执行主体的具体结构,只要能够实现本申请实施例的提供的方法即可。例如,本申请实施例提供的传输报文的方法的执行主体可以是接收端,或者为应用于接收端中的部件,例如,芯片系统,本申请对此不进行限定。本申请实施例中,芯片系统可以由芯片构成,也可以包括芯片和其他分立器件。下述实施例以传输报文的方法的执行主体为接收端为例进行描述。In the embodiment of the present application, the specific structure of the execution subject of the method for transmitting the message is not limited, as long as the method provided in the embodiment of the present application can be realized. For example, the execution subject of the method for transmitting a message provided in the embodiment of the present application may be the receiving end, or a component applied to the receiving end, for example, a chip system, which is not limited in the present application. In the embodiment of the present application, the system-on-a-chip may be composed of chips, or may include chips and other discrete devices. The following embodiments are described by taking the execution subject of the method for transmitting a message as the receiving end as an example.
如图6所示,为本申请实施例提供的一种传输报文的方法,该传输报文的方法包括S601-S604。As shown in FIG. 6 , it is a method for transmitting a message provided in the embodiment of the present application, and the method for transmitting a message includes S601-S604.
S601:发送端通过第一路径向接收端发送第一业务的第一报文。相应的,接收端接收发送端通过第一路径发送的第一业务的第一报文。S601: The sending end sends the first packet of the first service to the receiving end through the first path. Correspondingly, the receiving end receives the first packet of the first service sent by the sending end through the first path.
其中,发送端可以是图4中的发送端401。接收端可以是图4中的接收端402。第一路径是传输第一业务的报文至接收端的多个路径中的一个。第一业务为发送端的多个业务中的一个。Wherein, the sending end may be the sending end 401 in FIG. 4 . The receiving end may be the receiving end 402 in FIG. 4 . The first path is one of multiple paths for transmitting the packet of the first service to the receiving end. The first service is one of multiple services of the sending end.
本申请实施例中,第一报文携带第一发送时戳和第一报文的数据。其中,第一发送时戳对应于在发送端的时域上,发送第一报文的时间,或者说,第一发送时戳用于表示在发送端的时域上,发送第一报文的时间。例如,发送端在生成第一报文时,将生成第一报文的时间作为第一发送时戳,以表示在发送端的时域上,发送第一报文的时间。In this embodiment of the present application, the first packet carries the first sending timestamp and data of the first packet. Wherein, the first sending time stamp corresponds to the time when the first message is sent in the time domain of the sending end, or in other words, the first sending time stamp is used to indicate the time when the first message is sent in the time domain of the sending end. For example, when the sender generates the first packet, the time when the first packet is generated is used as the first sending timestamp to represent the time when the first packet is sent in the time domain of the sender.
可以理解的,发送端在第一业务的报文中插入的发送时戳的精度能够满足以下要求:相邻两个报文的发送时戳不重复,并且满足时间递增关系。另外,该发送时戳的精度还可以满足:不影响发送报文的数据的最大带宽。以通过二进制芯片实现为例,发送时戳的精度可以为1/(2^n)ns,例如1/8ns。发送时戳的位宽可以满足记录网络最大时延不翻转需求,比如最大支持1秒(s)时延。It can be understood that the accuracy of the sending time stamp inserted by the sending end into the message of the first service can meet the following requirements: the sending time stamps of two adjacent messages are not repeated, and the time increment relationship is satisfied. In addition, the accuracy of the sending time stamp can also satisfy: the maximum bandwidth of the data that does not affect the sending message. Taking the implementation of the binary chip as an example, the precision of sending the time stamp can be 1/(2^n)ns, for example, 1/8ns. The bit width of the sending timestamp can meet the requirement of recording the maximum delay of the network without inversion, for example, the maximum support is 1 second (s) delay.
S602:接收端获得第一业务的第一时延参数。S602: The receiving end obtains a first delay parameter of the first service.
一种可能的实现方式,第一时延参数是根据发送端和接收端之间的多个路径的第一最大传输时延确定的。其中,发送端和接收端之间的多个路径可以包括发送端和接收端之间的全部路径,也可以包括发送端与接收端之间的部分路径。若发送端和接收端之间的多个路径包括发送端与接收端之间的部分路径,则该部分路径包括传输第一业务的报文至接收端的多个路径。In a possible implementation manner, the first delay parameter is determined according to a first maximum transmission delay of multiple paths between the sending end and the receiving end. Wherein, the multiple paths between the sending end and the receiving end may include all paths between the sending end and the receiving end, or may include part of the paths between the sending end and the receiving end. If the multiple paths between the sending end and the receiving end include a partial path between the sending end and the receiving end, the partial path includes multiple paths for transmitting the packet of the first service to the receiving end.
示例性的,若发送端和接收端之间的全部路径包括路径1-路径5,其中,路径1-路径3用于传输第一业务的报文,则发送端和接收端之间的多个路径可以包括路径1-路径3,或者包括路径1-路径4,或者包括路径1-路径5,或者包括路径1-路径3以及路径5。Exemplarily, if all the paths between the sending end and the receiving end include path 1-path 5, wherein, path 1-path 3 are used to transmit packets of the first service, then multiple paths between the sending end and the receiving end The path may include path 1-path 3, or path 1-path 4, or path 1-path 5, or path 1-path 3 and path 5.
示例性的,第一时延参数是根据第一最大传输时延和第一余量确定的。例如,第一时延参数是第一最大传输时延和第一余量之和;或者,第一时延参数是第一最大传输时延和第一余量之积。其中,第一余量也可以称为安全补偿值、补偿值等,不予限制。第一余量为正数。第一余量可以是用户设置的、也可以是默认缺省值。在具体应用中,用户可以根据具体情况修改第一余量。Exemplarily, the first delay parameter is determined according to the first maximum transmission delay and the first margin. For example, the first delay parameter is the sum of the first maximum transmission delay and the first margin; or, the first delay parameter is the product of the first maximum transmission delay and the first margin. Wherein, the first margin may also be referred to as a safety compensation value, a compensation value, etc., without limitation. The first margin is a positive number. The first margin may be set by the user, or may be a default default value. In a specific application, the user can modify the first margin according to specific conditions.
本申请实施例中,第一最大传输时延是一个估计值,用于表示发送端和接收端之间的多个路径的最大传输时延。示例性的,接收端可以通过至少下述两种方式获得第一最大传输时 延。In the embodiment of the present application, the first maximum transmission delay is an estimated value, which is used to represent the maximum transmission delay of multiple paths between the sending end and the receiving end. Exemplarily, the receiving end can obtain the first maximum transmission delay in at least the following two ways.
方式1:接收端根据历史上多个路径的传输时延,获得第一最大传输时延。Method 1: The receiving end obtains the first maximum transmission delay according to the transmission delays of multiple paths in history.
一种可能的实现方式,接收端将一段时间内、发送端与接收端之间的多个路径的传输时延的最大值确定为第一最大传输时延。例如,接收端将1个月内、发送端与接收端之间的多个路径的传输时延的最大值确定为第一最大传输时延。在方式1中,第一最大传输时延为一个固定值。除非重新设置,通常第一最大传输时延不变。In a possible implementation manner, the receiving end determines a maximum value of transmission delays of multiple paths between the sending end and the receiving end within a period of time as the first maximum transmission delay. For example, the receiving end determines the maximum value of the transmission delays of multiple paths between the sending end and the receiving end within one month as the first maximum transmission delay. In mode 1, the first maximum transmission delay is a fixed value. Unless reset, usually the first maximum transmission delay remains unchanged.
方式2:接收端以业务为粒度,按周期统计,以得到第一最大传输时延。Method 2: The receiving end takes the service as the granularity and makes statistics on a periodic basis to obtain the first maximum transmission delay.
一种可能的实现方式,在一个周期内,接收端统计第一业务的报文在发送端与接收端之间的多个路径的传输时延,将当前统计出的多个路径的最大传输时延确定为第一最大传输时延。对于方式2,第一最大传输时延是一个变化的值,其随着统计结果可能会发生改变。即,接收端可以动态调整第一最大传输时延,或者说,接收端可以实时统计第一最大传输时延。In a possible implementation, in one period, the receiving end counts the transmission delays of the packets of the first service on multiple paths between the sending end and the receiving end, and calculates the maximum transmission time of the multiple paths currently counted. Delay is determined as the first maximum transmission delay. For mode 2, the first maximum transmission delay is a variable value, which may change according to the statistical results. That is, the receiving end can dynamically adjust the first maximum transmission delay, or in other words, the receiving end can count the first maximum transmission delay in real time.
示例性的,接收端在周期开始时接收到第一业务的报文1,报文1的传输时延为2ns,则接收端确定第一最大传输时延为2ns。接收端接收到报文1后,又接收到第一业务的报文2,报文2的传输时延为1ns,则接收端确定第一最大传输时延为2ns。接收端接收到报文2后,又接收到第一业务的报文3,报文3的传输时延为3ns,则接收端确定第一最大传输时延为3ns。Exemplarily, when the receiving end receives the packet 1 of the first service at the beginning of the period, and the transmission delay of the packet 1 is 2 ns, the receiving end determines that the first maximum transmission delay is 2 ns. After receiving packet 1, the receiving end receives packet 2 of the first service, and the transmission delay of packet 2 is 1 ns, so the receiving end determines that the first maximum transmission delay is 2 ns. After receiving packet 2, the receiving end receives packet 3 of the first service, and the transmission delay of packet 3 is 3 ns, so the receiving end determines that the first maximum transmission delay is 3 ns.
对于方式2,接收端得到第一最大传输时延的伪代码可以如下所示:For method 2, the pseudo code for the receiving end to obtain the first maximum transmission delay can be as follows:
Figure PCTCN2022071659-appb-000001
Figure PCTCN2022071659-appb-000001
其中,Tr为接收端接收到第一报文的时间,Tsr对应于在接收端的时域上,发送端发送第一报文的时间,Td为第一报文的传输时延,Tdamx为第一最大传输时延。上述伪代码描述了以下过程:1、计算第一报文的传输时延;2、若第一报文的传输时延大于最新的第一最大传输时延,则将第一报文的传输时延确定为第一最大传输时延;3、统计周期结束后,将第一最大传输时延设置为0。Among them, Tr is the time when the receiving end receives the first message, Tsr corresponds to the time when the sending end sends the first message in the time domain of the receiving end, Td is the transmission delay of the first message, and Tdamx is the first Maximum transmission delay. The pseudo-code above describes the following process: 1. Calculate the transmission delay of the first message; 2. If the transmission delay of the first message is greater than the latest first maximum transmission delay, the transmission time of the first message The delay is determined as the first maximum transmission delay; 3. After the statistics period ends, the first maximum transmission delay is set to 0.
可以理解的,第一最大传输时延是一个估计值,可能会出现估计不准确的情况。为了避免多个路径的最大传输时延估计的较小而导致报文排序错误的情况出现,可以设置一个补偿值(即第一余量),以尽量使得根据该补偿值补偿后的第一最大传输时延(即第一时延参数)大于或等于多个路径的最大传输时延。It can be understood that the first maximum transmission delay is an estimated value, and the estimation may be inaccurate. In order to avoid the situation that the estimated maximum transmission delay of multiple paths is small and cause packet sorting errors, a compensation value (that is, the first margin) can be set to try to make the first maximum after compensation according to the compensation value The transmission delay (that is, the first delay parameter) is greater than or equal to the maximum transmission delay of multiple paths.
一种可能的实现方式,若第一时延参数和第一最大传输时延的差值大于第一阈值,并且持续第一时间,则表示当前的第一时延参数是偏大的。在这种情况下,接收端可以调整第一时延参数。例如,接收端可以多次小步回调第一时延参数。每次回调的值可以小于发送端发送报文的最小时间间隔,以避免由于回调导致的报文乱序。In a possible implementation manner, if the difference between the first delay parameter and the first maximum transmission delay is greater than the first threshold and lasts for a first time, it indicates that the current first delay parameter is too large. In this case, the receiving end may adjust the first delay parameter. For example, the receiving end may call back the first delay parameter in small steps multiple times. The value of each callback can be less than the minimum time interval for the sender to send messages to avoid packet disorder caused by callbacks.
一种可能的实现方式,S604之后,接收端还可以检测第一报文的排序是否正确。若接收端检测到第一报文排序错误,则表示当前的第一时延参数是偏小的。在这种情况下,接收端可以调整第一时延参数。例如,接收端可以将第一时延参数增加第二余量。接收端检测第一报文的排序是否正确的过程将在S604之后介绍,在此不做赘述。In a possible implementation manner, after S604, the receiving end may also detect whether the sequence of the first packet is correct. If the receiving end detects that the ordering of the first packet is wrong, it means that the current first delay parameter is too small. In this case, the receiving end may adjust the first delay parameter. For example, the receiving end may increase the first delay parameter by the second margin. The process for the receiving end to detect whether the sorting of the first packet is correct will be introduced after S604, and will not be repeated here.
综上所述,接收端对第一时延参数的动态调整的伪代码可以如下所示:To sum up, the pseudocode of the dynamic adjustment of the first delay parameter at the receiving end can be as follows:
Figure PCTCN2022071659-appb-000002
Figure PCTCN2022071659-appb-000002
其中,Tc为第一时延参数,Tgd为第一余量,Tfb为第二余量,Tb为每次回调的值。回调条件为如果Tc-Tdmax>Tgd,且持续满足X毫秒(ms)时间。可以理解的,上述Tc=Tc+Tfb是代码的表述方式,用于表示对Tc进行调整。第一个Tc为调整后的第一时延参数,第二个Tc为调整前的第一时延参数。类似的,上述Tc=Tc–Tb也是代码的表述方式,用于表示对Tc进行调整。第一个Tc为调整后的第一时延参数,第二个Tc为调整前的第一时延参数。上述伪代码描述了以下过程:若Tc<(Tdmax+Tgd),则将Tdmax+Tgd确定为第一时延参数;或者,若接收端检测到第一报文排序错误,则将Tc+Tfb确定为第一时延参数;或者,若满足回调条件,则将Tc–Tb确定为第一时延参数。Wherein, Tc is the first delay parameter, Tgd is the first margin, Tfb is the second margin, and Tb is the value of each callback. The callback condition is if Tc-Tdmax>Tgd, and it lasts for X milliseconds (ms). It can be understood that the above Tc=Tc+Tfb is an expression of a code, which is used to indicate that Tc is adjusted. The first Tc is the first time delay parameter after adjustment, and the second Tc is the first time delay parameter before adjustment. Similarly, the above-mentioned Tc=Tc-Tb is also an expression of a code, which is used to indicate that Tc is adjusted. The first Tc is the first time delay parameter after adjustment, and the second Tc is the first time delay parameter before adjustment. The above pseudo code describes the following process: if Tc<(Tdmax+Tgd), then determine Tdmax+Tgd as the first delay parameter; or, if the receiving end detects that the first packet is incorrectly sorted, then determine Tc+Tfb is the first delay parameter; or, if the callback condition is met, Tc-Tb is determined as the first delay parameter.
S603:接收端根据第一发送时戳和第一时延参数获得第一预计读取时间。S603: The receiving end obtains a first estimated read time according to the first sending timestamp and the first delay parameter.
其中,第一预计读取时间可以为接收端预计读取第一报文的时间。Wherein, the first expected reading time may be the time when the receiving end expects to read the first packet.
本申请实施例中,接收端和发送端在时域上可以同步也可以不同步。若接收端和发送端在时域上同步,则接收端可以将第一发送时戳和第一时延参数相加得到第一预计读取时间。若接收端和发送端在时域上不同步,则接收端可以先进行发送端和接收端之间的时域映射,将接收端和发送端的时域统一起来,再在统一后的时域上获得第一预计读取时间。具体地,接收端可以将第一发送时戳映射到接收端的时域上以得到第二发送时戳,根据第二发送时戳和第一时延参数得到第一预计读取时间。其中,第二发送时戳对应于在接收端的时域上,发送端发送第一报文的时间,或者说,第二发送时戳用于表示在接收端的时域上,发送端发送第一报文的时间。In this embodiment of the present application, the receiving end and the sending end may or may not be synchronized in the time domain. If the receiving end and the sending end are synchronized in the time domain, the receiving end may add the first sending timestamp and the first delay parameter to obtain the first expected reading time. If the receiving end and the sending end are not synchronized in the time domain, the receiving end can perform time domain mapping between the sending end and the receiving end first, unify the time domains of the receiving end and the sending end, and then map the time domain on the unified time domain Get the first estimated read time. Specifically, the receiving end may map the first sending time stamp to the time domain of the receiving end to obtain the second sending time stamp, and obtain the first expected read time according to the second sending time stamp and the first delay parameter. Wherein, the second sending time stamp corresponds to the time when the sending end sends the first message in the time domain of the receiving end, or in other words, the second sending time stamp is used to indicate that in the time domain of the receiving end, the time when the sending end sends the first message text time.
时域映射的具体方法如下:接收端根据第一发送时戳、第一参考时戳、第二参考时戳和第一时钟映射参数获得第二发送时戳。其中,第一参考时戳为在发送端的时域上、第一时刻对应的时间。第二参考时戳为在接收端的时域上、第一时刻对应的时间。The specific method of time domain mapping is as follows: the receiving end obtains the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter. Wherein, the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end. The second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end.
示例性的,计算方式如下:T sr1=T sr0+K sr0*(T s1-T s0),或者,T sr1=T sr0+K sr0*(T s1-T s0)+C。其中,T sr1为第二发送时戳,T sr0为第二参考时戳,K sr0为第一时钟映射参数,T s1为第一发送时戳,T s0为第一参考时戳,C为调整参数。 Exemplarily, the calculation method is as follows: T sr1 =T sr0 +K sr0 *(T s1 -T s0 ), or, T sr1 =T sr0 +K sr0 *(T s1 -T s0 )+C. Among them, T sr1 is the second transmission time stamp, T sr0 is the second reference time stamp, K sr0 is the first clock mapping parameter, T s1 is the first transmission time stamp, T s0 is the first reference time stamp, and C is the adjustment parameter.
对于接收端和发送端在时域上不同步的情况,在S603之前,接收端可以获取第一参考时戳、第二参考时戳和第一时钟映射参数,接收端还可以进一步获得第二发送时戳,本申请不做限定。For the situation that the receiving end and the sending end are not synchronized in the time domain, before S603, the receiving end can obtain the first reference time stamp, the second reference time stamp and the first clock mapping parameter, and the receiving end can further obtain the second sending The time stamp is not limited in this application.
本申请实施例中,若第一报文为接收端接收到的来自发送端的第一个报文,则第一参考时戳、第二参考时戳和第一时钟映射参数可以是一个初始化的值。该初始化的值可以是用户或接收端配置的。例如,若第一报文为接收端接收到的来自发送端的第一个报文,则第一参考时戳和第二参考时戳为0,第一时钟映射参数为1。若第一报文不是接收端接收到的来自发送端的第一个报文,则第一参考时戳可以对应于在发送端的时域上,发送端在发送第一报文之前发送的报文的发送时间,第二参考时戳可以为将第一参考时戳映射到接收端的时域上得 到的时戳,第一时钟映射参数可以为将初始化的时钟映射参数进行至少一次动态调整后的参数。接收端每次动态调整时钟映射参数的过程,可以参考下述接收端调整第一时钟映射参数,得到第二时钟映射参数的介绍,在此不做赘述。In this embodiment of the application, if the first message is the first message received by the receiving end from the sending end, the first reference time stamp, the second reference time stamp and the first clock mapping parameter may be an initialized value . The initialized value can be configured by the user or the receiving end. For example, if the first message is the first message received by the receiving end from the sending end, the first reference time stamp and the second reference time stamp are 0, and the first clock mapping parameter is 1. If the first message is not the first message from the sender received by the receiver, the first reference time stamp may correspond to the time stamp of the message sent by the sender before sending the first message in the time domain of the sender For sending time, the second reference time stamp may be a time stamp obtained by mapping the first reference time stamp to the time domain of the receiving end, and the first clock mapping parameter may be a parameter after at least one dynamic adjustment of the initialized clock mapping parameter. For the process of dynamically adjusting the clock mapping parameters at the receiving end each time, you can refer to the following introduction of adjusting the first clock mapping parameters at the receiving end to obtain the second clock mapping parameters, which will not be repeated here.
可以理解的,为了使得发送端和接收端之间的时域映射更为准确,接收端可以在得到第二发送时戳后,调整第一时钟映射参数,以得到第二时钟映射参数。后续,接收端可以根据第二时钟映射参数在发送端和接收端之间做时域映射。It can be understood that, in order to make the time domain mapping between the sending end and the receiving end more accurate, the receiving end may adjust the first clock mapping parameter to obtain the second clock mapping parameter after obtaining the second sending timestamp. Subsequently, the receiving end may perform time-domain mapping between the sending end and the receiving end according to the second clock mapping parameter.
一种可能的实现方式,S603之后,接收端根据第一传输时延、第二传输时延和调整因子,调整第一时钟映射参数,以得到第二时钟映射参数。在这种情况下,第一时刻对应于发送端通过第一路径向接收端发送第一业务的第三报文的时间。第一传输时延为第一报文从发送端传输至接收端的传输时延,第二传输时延为第三报文从发送端传输至接收端的传输时延。In a possible implementation manner, after S603, the receiving end adjusts the first clock mapping parameter according to the first transmission delay, the second transmission delay and the adjustment factor, so as to obtain the second clock mapping parameter. In this case, the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path. The first transmission delay is the transmission delay of the first packet from the sending end to the receiving end, and the second transmission delay is the transmission delay of the third packet from the sending end to the receiving end.
示例性的,第二时钟映射参数满足公式:K sr1=K sr0+K c*T dc1。其中,K sr1为第二时钟映射参数,K sr0为第一时钟映射参数,K c为调整因子,T dc1满足公式:T dc1=(T r1-T sr1)-(T r0-T sr0)。其中,T r1为接收端接收到第一报文的时间,T sr1为第二发送时戳,T r0为接收端接收到第三报文的时间,T sr0为第二参考时戳。本申请实施例中,如果时钟跟踪范围<150ppm,则K c可以设为K c=150/(10^6*1000)。 Exemplarily, the second clock mapping parameter satisfies the formula: K sr1 =K sr0 +K c *T dc1 . Wherein, K sr1 is the second clock mapping parameter, K sr0 is the first clock mapping parameter, K c is the adjustment factor, and T dc1 satisfies the formula: T dc1 =(T r1 -T sr1 )-(T r0 -T sr0 ). Wherein, T r1 is the time when the receiving end receives the first message, T sr1 is the second sending time stamp, T r0 is the time when the receiving end receives the third message, and T sr0 is the second reference time stamp. In the embodiment of the present application, if the clock tracking range is <150ppm, K c may be set to K c =150/(10^6*1000).
综上所述,发送端和接收端之间进行时域映射的伪代码可以如下所示:To sum up, the pseudo code for time-domain mapping between the sender and receiver can be as follows:
Figure PCTCN2022071659-appb-000003
Figure PCTCN2022071659-appb-000003
其中,Tsn为第一参考时戳,Tsrn为第二参考时戳,Krs为时钟映射参数,Tsr为第二发送时戳,Ts为第一发送时戳,Td为第一传输时延,Tdn为第二传输时延,Kc为调整因子。可以理解的,上述Krs=Krs+Kc*Tdc是代码的表述方式,用于表示对Krs进行调整。第一个Krs为调整后的时钟映射参数,第二个Krs为调整前的时钟映射参数。类似的,上述Tsrn=Tsrn+Td也是代码的表述方式,用于表示对Tsrn进行调整。第一个Tsrn为调整后的第二参考时戳,第二个Tsrn为调整前的第二参考时戳。上述伪代码描述了以下过程:Tsn和Tsrn的初始 化值为0,Krs的初始化值为1;接收端接收到一个新的报文(例如,第一报文)后,可以根据公式Tsr=Tsrn+Krs*(Ts-Tsn)得到第二发送时戳,并计算Td和Tdc;若Ts比Tsn得到的晚,则令Tsrn=Tsr,Tsn=Ts,Krs=Krs+Kc*Tdc,Tdn=Td;Td表示传输时延,正常情况下应该为正值,若通过上述方法得到的Td<0,则接收端可以调整Tsrn,使得Td>0。例如,接收端可以令Tsrn=Tsrn+Td。Among them, Tsn is the first reference time stamp, Tsrn is the second reference time stamp, Krs is the clock mapping parameter, Tsr is the second transmission time stamp, Ts is the first transmission time stamp, Td is the first transmission delay, and Tdn is The second transmission delay, Kc is an adjustment factor. It can be understood that the above-mentioned Krs=Krs+Kc*Tdc is an expression of the code, which is used to indicate that Krs is adjusted. The first Krs is the adjusted clock mapping parameter, and the second Krs is the clock mapping parameter before adjustment. Similarly, the above-mentioned Tsrn=Tsrn+Td is also an expression of the code, which is used to indicate that Tsrn is adjusted. The first Tsrn is the adjusted second reference time stamp, and the second Tsrn is the second reference time stamp before adjustment. The pseudo-code above describes the following process: the initialization value of Tsn and Tsrn is 0, and the initialization value of Krs is 1; Krs*(Ts-Tsn) obtains the second sending timestamp, and calculates Td and Tdc; if Ts is obtained later than Tsn, then make Tsrn=Tsr, Tsn=Ts, Krs=Krs+Kc*Tdc, Tdn=Td; Td represents the transmission delay, which should be a positive value under normal circumstances. If Td<0 obtained by the above method, the receiving end can adjust Tsrn so that Td>0. For example, the receiving end may set Tsrn=Tsrn+Td.
通过上述描述可知,接收端可以将Krs的初始值设置为1,后续通过Tdc动态调整Krs,使得Krs趋于稳定。例如,使得Krs最终限幅在正负150ppm范围内。It can be seen from the above description that the receiving end can set the initial value of Krs to 1, and then dynamically adjust Krs through Tdc, so that Krs tends to be stable. For example, make the final limit of Krs within the range of plus or minus 150ppm.
可以理解的,若Krs准确,则Tdc将趋近于0。因此,若Tdc逐渐增大,则表示Krs小了,可以适当增大Krs;若Tdc逐渐变小,则表示Krs大了,可以适当减小Krs。通过动态调整调整Krs,可以得到较为准确的Krs。Understandably, if Krs is accurate, Tdc will approach zero. Therefore, if Tdc gradually increases, it means that Krs is small, and Krs can be increased appropriately; if Tdc gradually decreases, it means that Krs is large, and Krs can be appropriately reduced. By adjusting Krs dynamically, a more accurate Krs can be obtained.
一种可能的实现方式,若第一预计读取时间小于当前时间,则表示读取第一报文的时间已经过了,接收端可以丢弃第一报文。In a possible implementation manner, if the first expected reading time is less than the current time, it means that the time for reading the first packet has passed, and the receiving end may discard the first packet.
一种可能的实现方式,若第一预计读取时间与当前时间之差大于第一时间长度,则接收端丢弃第一报文。其中,第一时间长度为接收端能够支持的报文乱序时间,或者说,接收端能够对第一时间长度内发送的报文进行排序。例如,若第一时间长度为6ms,当前时间为1ms,则接收端可以对预计读取时间为1ms-7ms的报文进行排序。若第一预计读取时间为8ms,则超出了接收端的排序能力。在这种情况下,接收端丢弃第一报文,或者,接收端也可以将第一报文缓存,等到当前时间为2ms时,再对第一报文排序。In a possible implementation manner, if the difference between the first expected reading time and the current time is greater than the first time length, the receiving end discards the first packet. Wherein, the first time length is the packet out-of-sequence time that the receiving end can support, or in other words, the receiving end can sort the packets sent within the first time length. For example, if the first time length is 6ms and the current time is 1ms, then the receiving end can sort the packets whose expected reading time is 1ms-7ms. If the first expected reading time is 8ms, it exceeds the sorting capability of the receiving end. In this case, the receiving end discards the first packet, or the receiving end may also cache the first packet, and then sort the first packets when the current time is 2 ms.
S604:接收端根据第一预计读取时间读取第一报文的数据。S604: The receiving end reads the data of the first packet according to the first expected reading time.
一种可能的实现方式,接收端根据第一预计读取时间读取第一报文的数据,包括:在按照时间排序的多个队列中,接收端根据第一预计读取时间将第一报文入队;在已达到或者超过第一预计读取时间、并且多个队列指示轮到读取第一报文的数据的情况下,读取第一报文的数据。In a possible implementation manner, the receiving end reads the data of the first message according to the first expected reading time, including: in the multiple queues sorted by time, the receiving end sends the first message according to the first expected reading time Enqueue the file; when the first expected reading time has been reached or exceeded, and multiple queues indicate that it is the turn to read the data of the first message, read the data of the first message.
首先,对多个队列进行具体阐述。First, the multiple queues are described in detail.
本申请实施例中,多个队列中的每个队列对应一个时间差值区间,多个队列根据时间差值区间排序。以3个队列为例,若队列1对应的时间差值区间为[0ns,0.5ns],队列2对应的时间差值区间为(0.5ns,1ns],队列3对应的时间差值区间为(1ns,1.5ns],则接收端读取报文时,可以先读取队列1中的报文,再读取队列2中的报文,最后读取队列3中的报文。如此,接收端将接收到的报文入队后,即实现了对接收到的报文排序。后续,接收端可以按照队列输出报文的顺序读取报文的数据。可以理解的,队列对应的时间差值区间为接收端配置的,或用户配置的。时间差值区间配置后还可以修改。In the embodiment of the present application, each of the multiple queues corresponds to a time difference interval, and the multiple queues are sorted according to the time difference interval. Taking three queues as an example, if the time difference interval corresponding to queue 1 is [0ns, 0.5ns], the time difference interval corresponding to queue 2 is (0.5ns, 1ns], and the time difference interval corresponding to queue 3 is ( 1ns, 1.5ns], when the receiving end reads the message, it can first read the message in queue 1, then read the message in queue 2, and finally read the message in queue 3. In this way, the receiving end After the received messages are queued, the received messages are sorted. Subsequently, the receiving end can read the data of the messages in the order of the queue output messages. It is understandable that the time difference corresponding to the queue The interval is configured by the receiver or the user. The time difference interval can be modified after configuration.
本申请实施例中,队列对应的时间差值区间可以用于接收端将接收到的报文入队。示例性的,接收端获取到报文的预计读取时间后,可以获取该预计读取时间与当前时间的差值,将该报文的数据输入到该差值所在的时间差值区间对应的队列中。其中,该差值所在的时间差值区间可以理解为:该差值大于或等于差值所在的时间差值区间的最小值,并且该差值小于或等于该差值所在的时间差值区间的最大值。In the embodiment of the present application, the time difference interval corresponding to the queue may be used by the receiving end to enqueue the received message into the queue. Exemplarily, after the receiving end obtains the expected reading time of the message, it can obtain the difference between the expected reading time and the current time, and input the data of the message into the time difference interval corresponding to the difference. in queue. Wherein, the time difference interval where the difference is located can be understood as: the difference is greater than or equal to the minimum value of the time difference interval where the difference is located, and the difference is less than or equal to the minimum value of the time difference interval where the difference is located. maximum value.
一种可能的实现方式,接收端根据第一预计读取时间将第一报文入队,包括:接收端根据第一预计读取时间与当前时间的差值,将第一报文的信息输入第一队列。其中,第一报文的信息可以包括与第一报文相关的信息。例如,第一报文的信息包括第一报文;或者,第一报文的信息包括第一报文在接收端的存储地址;或者,第一报文的信息包括第一报文在接收端的存储地址和第一发送时戳。第一报文的信息还可以称为第一报文的报文描述符。可以理 解的,若第一报文的信息包括第一报文,则接收端从队列中读取第一报文的数据;若第一报文的信息包括第一报文在接收端的存储地址,则接收端从该存储地址中读取第一报文的数据。多个队列包括第一队列,第一预计读取时间与当前时间的差值属于第一队列对应的时间差值区间。In a possible implementation, the receiving end enqueues the first message according to the first estimated reading time, including: the receiving end inputs the information of the first message according to the difference between the first estimated reading time and the current time first queue. Wherein, the information of the first packet may include information related to the first packet. For example, the information of the first message includes the first message; or, the information of the first message includes the storage address of the first message at the receiving end; or, the information of the first message includes the storage address of the first message at the receiving end address and first sent timestamp. The information of the first packet may also be referred to as a packet descriptor of the first packet. It can be understood that if the information of the first message includes the first message, the receiving end reads the data of the first message from the queue; if the information of the first message includes the storage address of the first message at the receiving end, Then the receiving end reads the data of the first packet from the storage address. The multiple queues include a first queue, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the first queue.
示例性的,接收端的多个队列可以如图7A所示。图7A中,多个队列包括队列701,队列702,队列703……,其中,队列701对应的时间差值区间为[0ns,1ns],队列702对应的时间差值区间为(1ns,2ns],队列703对应的时间差值区间为(2ns,3ns]。若第一预计读取时间与当前时间的差值为1ns,则第一队列为队列701;若第一预计读取时间与当前时间的差值为1.5ns,则第一队列为队列702;第一预计读取时间与当前时间的差值为2.5ns,则第一队列为队列703。Exemplarily, multiple queues at the receiving end may be as shown in FIG. 7A . In Fig. 7A, multiple queues include queue 701, queue 702, queue 703..., wherein, the time difference interval corresponding to queue 701 is [0ns, 1ns], and the time difference interval corresponding to queue 702 is (1ns, 2ns] , the time difference interval corresponding to the queue 703 is (2ns, 3ns]. If the difference between the first expected read time and the current time is 1ns, then the first queue is the queue 701; if the first expected read time and the current time If the difference between the first expected reading time and the current time is 2.5 ns, then the first queue is queue 703 .
一种可能的实现方式,若第一队列中还存储了第二报文的信息,则接收端根据第一预计读取时间和第二报文的预计读取时间确定第一报文和第二报文在第一队列中的位置。示例性的,若第一预计读取时间早于第二报文的预计读取时间,则第一报文的信息从第一队列输出的时间,早于第二报文的信息从第一队列输出的时间;或者,若第一预计读取时间晚于第二报文的预计读取时间,则第一报文的信息从第一队列输出的时间,晚于第二报文的信息从第一队列输出的时间。In a possible implementation, if information of the second message is also stored in the first queue, the receiving end determines the first message and the second message according to the first expected read time and the expected read time of the second message. The position of the packet in the first queue. Exemplarily, if the first expected reading time is earlier than the expected reading time of the second message, the time when the information of the first message is output from the first queue is earlier than the time when the information of the second message is output from the first queue or, if the first expected read time is later than the expected read time of the second message, the time when the information of the first message is output from the first queue is later than the time when the information of the second message is output from the first queue Time for a queue output.
本申请实施例中,第二报文可以为发送端发送的除第一报文之外的第一业务的其他报文,发送端发送的其他业务的报文,或其他发送端发送的报文。In this embodiment of the application, the second message may be other messages of the first service other than the first message sent by the sender, messages of other services sent by the sender, or messages sent by other senders .
可以理解的,本申请实施例中,接收端对报文的排序不要求以业务为粒度的,可以对接收到的报文整体排序,不区分业务。如此可以降低接收端的复杂度,而且对于任一业务,其报文也是保序的,不影响业务的功能。另外,接收端是否读取报文是与该报文的预计读取时间和该报文是否位于队列的输出端口有关,不受其他条件的限制。因此,某一个业务的时戳异常不影响接收端读取其他业务的报文,可靠性高。It can be understood that in the embodiment of the present application, the sorting of packets by the receiving end does not require the granularity of services, and the received packets can be sorted as a whole without distinguishing between services. In this way, the complexity of the receiving end can be reduced, and for any service, its message is also in order, without affecting the function of the service. In addition, whether the receiving end reads the message is related to the expected reading time of the message and whether the message is located at the output port of the queue, and is not limited by other conditions. Therefore, the abnormal time stamp of a certain service does not affect the receiving end to read the messages of other services, and the reliability is high.
应理解,本申请实施例中,接收端也可以以业务为粒度对接收到的报文进行排序,不予限制。It should be understood that in the embodiment of the present application, the receiving end may also sort the received packets at the granularity of services, which is not limited.
本申请实施例中,多个队列在时域上是串联关系,也就是说,队列中的信息,随着时间的流逝可以从一个队列输出,输入到另一个队列中。In the embodiment of the present application, multiple queues are connected in series in the time domain, that is, information in the queues can be output from one queue and input to another queue as time goes by.
一种可能的实现方式,若第一预计读取时间与当前时间的差值,小于第一队列对应的时间差值区间的最小值,则接收端将第一报文的信息从第一队列输出,输入到第二队列。其中,第二队列包括在多个队列中,第一预计读取时间与当前时间的差值属于第二队列对应的时间差值区间。可以理解的,第二队列对应的时间差值区间中的数值,小于第一队列对应的时间差值区间中的数值,或者说,相对于第一队列中报文的预计读取时间,第二队列中报文的预计读取时间与当前时间更接近。A possible implementation, if the difference between the first expected reading time and the current time is less than the minimum value of the time difference interval corresponding to the first queue, the receiving end outputs the information of the first message from the first queue , input to the second queue. Wherein, the second queue is included in multiple queues, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the second queue. It can be understood that the value in the time difference interval corresponding to the second queue is smaller than the value in the time difference interval corresponding to the first queue, or in other words, compared with the expected reading time of the message in the first queue, the second The expected reading time of the packets in the queue is closer to the current time.
示例性的,以图7A所示的队列为例,队列701、队列702和队列703在时域上是串联关系。若当前时间为时刻1,第一预计读取时间与时刻1的差值为2.5ns,则接收端将第一报文的信息输入2.5ns所在的时间差值区间对应的队列703中。过了一段时间,当前时间变成了时刻2,第一预计读取时间与时刻2的差值为2ns,2ns小于队列703对应的时间差值区间的最小值,则接收端将第一报文的信息从队列703输出,输入到2ns所在的时间差值区间对应的队列702中。又过了一段时间,当前时间变成了时刻3,第一预计读取时间与时刻3的差值为1ns,1ns小于队列702对应的时间差值区间的最小值,则接收端将第一报文的信息从队列702输出,输入到1ns所在的时间差值区间对应的队列701中。Exemplarily, taking the queue shown in FIG. 7A as an example, the queue 701 , the queue 702 and the queue 703 are connected in series in the time domain. If the current time is time 1, and the difference between the first estimated read time and time 1 is 2.5 ns, then the receiving end will input the information of the first message into the queue 703 corresponding to the time difference interval of 2.5 ns. After a period of time, the current time becomes time 2, the difference between the first estimated reading time and time 2 is 2ns, and if 2ns is less than the minimum value of the time difference interval corresponding to the queue 703, the receiving end sends the first message The information of is output from the queue 703 and input into the queue 702 corresponding to the time difference interval of 2ns. After another period of time, the current time becomes time 3, and the difference between the first estimated reading time and time 3 is 1 ns, and if 1 ns is less than the minimum value of the time difference interval corresponding to the queue 702, the receiving end will send the first report The text information is output from the queue 702 and input into the queue 701 corresponding to the time difference interval where 1 ns is located.
一种可能的实现方式,多个队列分为多组,每组包括至少一个队列,不同组中的队列对应的时间差值区间的长度不同。其中,时间差值区间的长度可以为时间差值区间的最大值与时间差值区间的最小值之差。以图7A中的队列701为例,队列701对应的时间差值区间为[0ns,1ns],则队列701对应的时间差值区间的长度为1ns-0ns=1ns。In a possible implementation manner, the multiple queues are divided into multiple groups, each group includes at least one queue, and the lengths of the time difference intervals corresponding to the queues in different groups are different. Wherein, the length of the time difference interval may be the difference between the maximum value of the time difference interval and the minimum value of the time difference interval. Taking the queue 701 in FIG. 7A as an example, the time difference interval corresponding to the queue 701 is [0 ns, 1 ns], and the length of the time difference interval corresponding to the queue 701 is 1 ns-0 ns=1 ns.
示例性的,以上述第一队列和第二队列为例,若第一队列包括在第一组队列中,第二队列包括在第二组队列中,则第一组队列中的队列对应的时间差值区间的长度,大于第二组队列中的队列对应的时间差值区间的长度。可以理解的,多个队列中,队列对应的时间差值区间的长度的最小值小于发送端发送报文的最小时间间隔。Exemplarily, taking the above-mentioned first queue and the second queue as examples, if the first queue is included in the first group of queues and the second queue is included in the second group of queues, then the queues in the first group of queues The length of the corresponding time difference interval is greater than the length of the time difference interval corresponding to the queues in the second group of queues. It can be understood that among the multiple queues, the minimum value of the length of the time difference interval corresponding to the queue is smaller than the minimum time interval for sending packets by the sending end.
如图7B所示,为多个队列的示意图。图7B中,多个队列被分为了4组。队列组1中的队列对应的时间差值区间的长度为1/8ns,队列组2中的队列对应的时间差值区间的长度为16ns,队列组3中的队列对应的时间差值区间的长度为1微秒(us),队列组4中的队列对应的时间差值区间的长度为64us。第一组队列可以为队列组2,第二组队列可以为队列组1;或者,第一组队列可以为队列组3,第二组队列可以为队列组2;第一组队列可以为队列组4,第二组队列可以为队列组3。As shown in FIG. 7B , it is a schematic diagram of multiple queues. In Fig. 7B, multiple queues are divided into 4 groups. The length of the time difference interval corresponding to the queue in queue group 1 is 1/8ns, the length of the time difference interval corresponding to the queue in queue group 2 is 16ns, and the length of the time difference interval corresponding to the queue in queue group 3 is 1 microsecond (us), and the length of the time difference interval corresponding to the queue in queue group 4 is 64 us. The first group of queues can be queue group 2, and the second group of queues can be queue group 1; or, the first group of queues can be queue group 3, and the second group of queues can be queue group 2; the first group of queues The column can be Queue Group 4 and the second set of queues can be Queue Group 3.
可以理解的,为不同组的队列配置不同的时间差值区间长度,可以大量减少队列的数量,降低接收端维护队列的复杂度。示例性的,以第一时间长度(即接收端能够支持的报文乱序时间,也是多个队列对应的时间差值区间的长度之和)为8ms为例,若每个队列对应的时间差值区间长度相同,都为1ns,则接收端需要维护8000000个队列。若不同组中的队列对应的时间差值区间的长度不同,例如,多个队列被分为了4组,第一组队列中的队列对应的时间差值区间的长度为1/8ns,第二组队列中的队列对应的时间差值区间的长度为16ns,第三组队列中的队列对应的时间差值区间的长度为1us,第四组队列中的队列对应的时间差值区间的长度为64us,则在每组包括128个队列的情况下,即可使得多个队列对应的时间差值区间的长度之和大于8ms。在这种情况下,接收端需要维护512个队列,大大降低了接收端的复杂度。It can be understood that configuring different time difference interval lengths for different groups of queues can greatly reduce the number of queues and reduce the complexity of queue maintenance at the receiving end. Exemplarily, taking the first time length (that is, the packet out-of-sequence time that the receiving end can support, and the sum of the lengths of the time difference intervals corresponding to multiple queues) as an example, if the time difference corresponding to each queue The length of the value interval is the same, both are 1ns, and the receiving end needs to maintain 8000000 queues. If the lengths of the time difference intervals corresponding to the queues in different groups are different, for example, multiple queues are divided into 4 groups, the length of the time difference intervals corresponding to the queues in the first group of queues is 1/8ns, and the length of the second The length of the time difference interval corresponding to the queues in the first group of queues is 16ns, the length of the time difference intervals corresponding to the queues in the third group of queues is 1us, and the length of the time difference intervals corresponding to the queues in the fourth group of queues length is 64us, then in the case that each group includes 128 queues, the sum of the lengths of the time difference intervals corresponding to multiple queues can be greater than 8ms. In this case, the receiving end needs to maintain 512 queues, which greatly reduces the complexity of the receiving end.
一种可能的实现方式,对于不同组中的队列对应的时间差值区间的长度不同的情况,若第一队列对应的时间差值区间的长度大于第二时间长度,则接收端在将第一报文的信息输入第一队列时,可以不确定第一报文的信息在第一队列中的位置,以降低接收端的计算开销。若第一队列对应的时间差值区间的长度小于或等于第二时间长度,则接收端在将第一报文的信息输入第一队列时,可以根据第一预计读取时间确定第一报文的信息在第一队列中的位置。类似的,若第二队列对应的时间差值区间的长度大于第二时间长度,则接收端在将第一报文的信息输入第二队列时,可以不确定第一报文的信息在第二队列中的位置,以降低接收端的计算开销。若第二队列对应的时间差值区间的长度小于或等于第二时间长度,则接收端在将第一报文的信息输入第二队列时,可以根据第一预计读取时间确定第一报文的信息在第二队列中的位置。In a possible implementation, when the lengths of the time difference intervals corresponding to the queues in different groups are different, if the length of the time difference intervals corresponding to the first queue is greater than the second time length, then the receiving end will When the information of the message is input into the first queue, the position of the information of the first message in the first queue may not be determined, so as to reduce the calculation overhead of the receiving end. If the length of the time difference interval corresponding to the first queue is less than or equal to the second time length, the receiving end can determine the first message according to the first expected reading time when inputting the information of the first message into the first queue The position of the message in the first queue. Similarly, if the length of the time difference interval corresponding to the second queue is greater than the second time length, when the receiving end inputs the information of the first message into the second queue, it may not be sure that the information of the first message is in the second queue. position in the queue to reduce computational overhead on the receiving end. If the length of the time difference interval corresponding to the second queue is less than or equal to the second time length, the receiving end can determine the first message according to the first expected reading time when inputting the information of the first message into the second queue The position of the message in the second queue.
一种可能的实现方式,S604之后,接收端检测第一报文的排序是否正确。In a possible implementation manner, after S604, the receiving end detects whether the sequence of the first packet is correct.
作为一种示例,接收端接收发送端发送的第一业务的第四报文,其中,第四报文携带第三发送时戳,第三发送时戳对应于在发送端的时域上,发送所述第四报文的时间。接收端可以比较第一发送时戳和第三发送时戳的大小,以确定第一报文的排序是否正确。例如,在第四报文是在读取第一报文之前最新被读取的的情况下,第三发送时戳应该小于第一发送时戳。若比较结果为第三发送时戳大于第一发送时戳,则可以表示第一报文的排序错误。在第四报文是在读取第一报文之后最新被读取的的情况下,第三发送时戳应该大于第一发送时戳。若比较结果为第三发送时戳小于第一发送时戳,则可以表示第一报文的排序错误。As an example, the receiving end receives the fourth packet of the first service sent by the sending end, where the fourth packet carries a third sending time stamp, and the third sending time stamp corresponds to the time domain of the sending end. The time of the fourth message. The receiving end can compare the sizes of the first sending timestamp and the third sending timestamp to determine whether the sequence of the first packet is correct. For example, in the case that the fourth message is read latest before reading the first message, the third sending time stamp should be smaller than the first sending time stamp. If the comparison result is that the third sending timestamp is greater than the first sending timestamp, it may indicate that the ordering of the first packet is wrong. In case the fourth telegram is read most recently after reading the first telegram, the third transmission time stamp should be greater than the first transmission time stamp. If the comparison result is that the third sending timestamp is smaller than the first sending timestamp, it may indicate that the ordering of the first packet is wrong.
一种可能的实现方式,若第一报文的排序错误,接收端调整第一时延参数。例如,接收端可以将第一时延参数增加第二余量,第二余量为正数,第二余量可以为第三发送时戳和第一发送时戳之差。In a possible implementation manner, if the sequence of the first packet is wrong, the receiving end adjusts the first delay parameter. For example, the receiving end may increase the first delay parameter by a second margin, where the second margin is a positive number, and the second margin may be a difference between the third sending timestamp and the first sending timestamp.
一种可能的实现方式,若第一报文的排序错误,接收端发送告警信息。例如,若第一报文的排序错误,则接收端在接收端的人机交互界面上显示告警信息,以便用户根据告警信息调整相关参数。或者,若第一报文的排序错误,则接收端向服务器发送告警信息,以便管理员根据告警信息进行相关处理。In a possible implementation manner, if the sequence of the first packet is incorrect, the receiving end sends an alarm message. For example, if the sequence of the first message is wrong, the receiving end displays warning information on the human-computer interaction interface of the receiving end, so that the user can adjust relevant parameters according to the warning information. Or, if the sequence of the first message is incorrect, the receiving end sends an alarm message to the server, so that the administrator can perform related processing according to the alarm message.
可以理解的,上述S601-S604是基于接收端接收到的一个报文进行描述的。接收端对接收到的报文都可以执行上述S601-S604,以对接收到的报文进行排序。例如,如图8所示,若接收端与发送端在时域上同步,则接收端接收到新的报文后,可以根据新的报文中携带的发送时戳Tsr、接收端接收到的新的报文的接收时间Tr以及当前统计的最大传输时延Tdmax获取时延参数Tc,接收端还可以对Tdmax和Tc进行调整,使得Tdmax和Tc更为准确。后续,接收端可以根据Tc和Tsr,得到新的报文的预计读取时间,根据预计读取时间读取该新的报文的数据。若接收端与发送端在时域上不同步,则接收端接收到新的报文后,可以根据新的报文携带的发送时戳Ts、以前接收到的报文的发送时戳Tsn、Tsn映射到接收端的时域上的发送时戳Tsrn以及时钟映射参数Krs,获取Ts映射到接收端的时域上的发送时戳Tsr,接收端还可以调整Tsn、Tsrn和Krs。后续,接收端可以根据Tsr、接收端接收到的新的报文的接收时间Tr以及当前统计的最大传输时延Tdmax获取Tc,根据Tc和Tsr,得到新的报文的预计读取时间,根据预计读取时间读取该新的报文的数据。It can be understood that the foregoing S601-S604 are described based on a packet received by the receiving end. The receiving end can perform the above S601-S604 on the received packets, so as to sort the received packets. For example, as shown in Figure 8, if the receiving end and the sending end are synchronized in the time domain, after receiving a new message, the receiving end can use the time stamp Tsr carried in the new message, the The receiving time Tr of the new message and the current statistical maximum transmission delay Tdmax obtain the delay parameter Tc, and the receiving end can also adjust Tdmax and Tc to make Tdmax and Tc more accurate. Subsequently, the receiving end can obtain the expected reading time of the new message according to Tc and Tsr, and read the data of the new message according to the expected reading time. If the receiving end and the sending end are not synchronized in the time domain, after receiving the new message, the receiving end can transmit the time stamp Ts carried in the new message, the sending time stamp Tsn and Tsn of the previously received message The sending timestamp Tsrn and the clock mapping parameter Krs mapped to the time domain of the receiving end are obtained, and the sending timestamp Tsr mapped from Ts to the time domain of the receiving end is obtained, and the receiving end can also adjust Tsn, Tsrn and Krs. Subsequently, the receiving end can obtain Tc according to Tsr, the receiving time Tr of the new message received by the receiving end, and the current statistical maximum transmission delay Tdmax, and obtain the estimated reading time of the new message according to Tc and Tsr, according to Estimated read time to read the data of this new message.
可以理解的,接收端可以接收来自不同发送端的报文,对于不同的发送端,接收端在进行时域映射时,采用的时钟映射参数不同。但是,接收端对接收到的报文是整体排序,可以不区分发送端。It can be understood that the receiving end may receive messages from different sending ends, and for different sending ends, the receiving end uses different clock mapping parameters when performing time domain mapping. However, the receiving end sorts the received packets as a whole, and the sending end may not be distinguished.
基于图6所示的方法,接收端通过第一路径接收到来自发送端的第一业务的第一报文后,可以根据多个路径的第一最大传输时延,获取第一时延参数,根据第一时延参数获取预计读取第一报文的数据的时间,根据预计读取第一报文的数据的时间读取第一报文的数据,以实现对第一报文的排序。通过图6所示的方法,接收端可以对接收到的报文进行整体排序,不区分业务,可以降低接收端的复杂度,减少计算资源和存储资源的消耗。而且对于任一业务,其报文也是保序的,不影响业务的功能。在排序的过程中,接收端是根据预计读取报文的数据的时间读取报文的数据,某一个业务的时戳异常不影响接收端读取其他业务的报文的数据,可靠性高。图6所示的方法也不需要引入老化时间,可以减小时延抖动。另外,图6所示的方法对传输网络没有特殊要求,在发送端和接收端部署即可,实现简单。Based on the method shown in Figure 6, after the receiving end receives the first message of the first service from the sending end through the first path, it can obtain the first delay parameter according to the first maximum transmission delay of multiple paths, according to The first delay parameter obtains the estimated time to read the data of the first packet, and reads the data of the first packet according to the estimated time to read the data of the first packet, so as to realize the sorting of the first packets. Through the method shown in Figure 6, the receiving end can sort the received messages as a whole without distinguishing services, which can reduce the complexity of the receiving end and reduce the consumption of computing resources and storage resources. Moreover, for any service, its packets are also in order, which does not affect the function of the service. In the process of sorting, the receiving end reads the data of the message according to the expected time to read the data of the message. The abnormal time stamp of a certain service does not affect the receiving end to read the data of other service messages, and the reliability is high. . The method shown in FIG. 6 also does not need to introduce aging time, and can reduce delay jitter. In addition, the method shown in Figure 6 has no special requirements on the transmission network, and can be deployed at the sending end and the receiving end, which is easy to implement.
其中,上述S601-S604中的接收端的动作可以由图5所示的通信装置50中的处理器501调用存储器503中存储的应用程序代码来执行,本申请实施例对此不做任何限制。The actions of the receiving end in S601-S604 above can be executed by the processor 501 in the communication device 50 shown in FIG. 5 calling the application program code stored in the memory 503, which is not limited in this embodiment of the present application.
上述主要从各个网元之间交互的角度对本申请实施例提供的方案进行了介绍。相应的,本申请实施例还提供了通信装置,该通信装置可以为上述方法实施例中的接收端,或者包含上述接收端的装置,或者为可用于接收端的部件。可以理解的是,该通信装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solution provided by the embodiment of the present application from the perspective of interaction between various network elements. Correspondingly, the embodiment of the present application also provides a communication device, which may be the receiving end in the above method embodiments, or a device including the above receiving end, or a component that may be used for the receiving end. It can be understood that, in order to realize the above functions, the communication device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
图9示出了一种通信装置90的结构示意图。该通信装置90包括接收模块901和处理模块902。接收模块901,也可以称为接收单元用以实现接收功能,例如可以是接收电路,接收机,接收器或者通信接口。FIG. 9 shows a schematic structural diagram of a communication device 90 . The communication device 90 includes a receiving module 901 and a processing module 902 . The receiving module 901 may also be referred to as a receiving unit to implement a receiving function, for example, it may be a receiving circuit, a receiver, a receiver or a communication interface.
其中,以通信装置90为上述方法实施例中的接收端为例:Wherein, taking the communication device 90 as the receiving end in the above method embodiment as an example:
接收模块901,用于接收发送端通过第一路径发送的第一业务的第一报文,第一报文携带第一发送时戳,第一发送时戳对应于在发送端的时域上,发送第一报文的时间,第一路径是传输第一业务的报文至接收端的多个路径中的一个。示例性的,结合图6,接收模块901可以用于指示S601。The receiving module 901 is configured to receive the first packet of the first service sent by the sending end through the first path, the first packet carries a first sending timestamp, and the first sending timestamp corresponds to the time domain of the sending end. At the time of the first packet, the first path is one of multiple paths for transmitting the packet of the first service to the receiving end. Exemplarily, with reference to FIG. 6 , the receiving module 901 may be used to instruct S601.
处理模块902,用于获得第一业务的第一时延参数,第一时延参数是根据多个路径的第一最大传输时延确定的。示例性的,结合图6,处理模块902可以用于执行S602。The processing module 902 is configured to obtain a first delay parameter of the first service, where the first delay parameter is determined according to first maximum transmission delays of multiple paths. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S602.
处理模块902,还用于根据第一发送时戳和第一时延参数获得第一预计读取时间。示例性的,结合图6,处理模块902可以用于执行S603。The processing module 902 is further configured to obtain a first expected read time according to the first sending time stamp and the first delay parameter. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S603.
处理模块902,还用于根据第一预计读取时间读取第一报文的数据。示例性的,结合图6,处理模块902可以用于执行S603。The processing module 902 is further configured to read the data of the first message according to the first expected reading time. Exemplarily, with reference to FIG. 6 , the processing module 902 may be used to execute S603.
可选的,处理模块902,具体用于在按照时间排序的多个队列中,根据第一预计读取时间将第一报文入队;处理模块902,还具体用于在已达到或者超过第一预计读取时间、并且多个队列指示轮到读取第一报文的数据的情况下,读取第一报文的数据。Optionally, the processing module 902 is specifically configured to enqueue the first message according to the first expected read time in multiple queues sorted by time; When the reading time is estimated and multiple queues indicate that it is the turn to read the data of the first message, the data of the first message is read.
可选的,处理模块902,还具体用于根据第一预计读取时间与当前时间的差值,将第一报文的信息输入第一队列,第一预计读取时间与当前时间的差值属于第一队列对应的时间差值区间。Optionally, the processing module 902 is further specifically configured to input the information of the first message into the first queue according to the difference between the first estimated reading time and the current time, and the difference between the first estimated reading time and the current time It belongs to the time difference interval corresponding to the first queue.
可选的,第一队列中还存储了第二报文的信息,若第一预计读取时间早于第二报文的预计读取时间,则第一报文的信息从第一队列输出的时间,早于第二报文的信息从第一队列输出的时间;或者,若第一预计读取时间晚于第二报文的预计读取时间,则第一报文的信息从第一队列输出的时间,晚于第二报文的信息从第一队列输出的时间。Optionally, the information of the second message is also stored in the first queue. If the first expected read time is earlier than the expected read time of the second message, the information of the first message is output from the first queue. Time, earlier than the time when the information of the second message is output from the first queue; or, if the first expected read time is later than the expected read time of the second message, the information of the first message is output from the first queue The output time is later than the time when the information of the second packet is output from the first queue.
可选的,第二报文为发送端发送的除第一报文之外的第一业务的其他报文,发送端发送的其他业务的报文,或其他发送端发送的报文。Optionally, the second message is other messages of the first service sent by the sender except the first message, messages of other services sent by the sender, or messages sent by other senders.
可选的,处理模块902,还用于若第一预计读取时间与当前时间的差值,小于第一队列对应的时间差值区间的最小值,则将第一报文的信息从第一队列输出,输入到第二队列,第二队列包括在多个队列中,第一预计读取时间与当前时间的差值属于第二队列对应的时间差值区间。Optionally, the processing module 902 is further configured to transfer the information of the first message from the first The output of the queue is input to the second queue, the second queue is included in multiple queues, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the second queue.
可选的,多个队列分为多组,第一队列包括在第一组队列中,第二队列包括在第二组队列中,第一组队列中的队列对应的时间差值区间的长度,大于第二组队列中的队列对应的时间差值区间的长度。Optionally, multiple queues are divided into multiple groups, the first queue is included in the first group of queues, the second queue is included in the second group of queues, and the time difference intervals corresponding to the queues in the first group of queues The length is greater than the length of the time difference interval corresponding to the queues in the second group of queues.
可选的,处理模块902,具体用于将第一发送时戳映射到接收端的时域上以得到第二发送时戳;处理模块902,还具体用于根据第二发送时戳和第一时延参数获得第一预计读取时间。Optionally, the processing module 902 is specifically configured to map the first sending timestamp to the time domain of the receiving end to obtain the second sending timestamp; the processing module 902 is also specifically configured to The delay parameter gets the first estimated read time.
可选的,处理模块902,还用于获取第一参考时戳、第二参考时戳和第一时钟映射参数,第一参考时戳为在发送端的时域上、第一时刻对应的时间,第二参考时戳为在接收端的时域上、第一时刻对应的时间;处理模块902,还具体用于根据第一发送时戳、第一参考时戳、第二参考时戳和第一时钟映射参数,获得第二发送时戳。Optionally, the processing module 902 is further configured to obtain a first reference time stamp, a second reference time stamp, and a first clock mapping parameter, where the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end, The second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end; the processing module 902 is also specifically configured to Mapping parameters to obtain the second sending timestamp.
可选的,第一时刻对应于发送端通过第一路径向接收端发送第一业务的第三报文的时间, 处理模块902,还用于根据第一传输时延、第二传输时延和调整因子,调整第一时钟映射参数,第一传输时延为第一报文从发送端传输至接收端的传输时延,第二传输时延为第三报文从发送端传输至接收端的传输时延。Optionally, the first moment corresponds to the time when the sending end sends the third packet of the first service to the receiving end through the first path, and the processing module 902 is further configured to, according to the first transmission delay, the second transmission delay and The adjustment factor is to adjust the first clock mapping parameter. The first transmission delay is the transmission delay of the first message from the sending end to the receiving end, and the second transmission delay is the transmission time of the third message from the sending end to the receiving end. delay.
可选的,接收模块901,还用于接收发送端发送的第一业务的第四报文,第四报文携带第三发送时戳,第三发送时戳对应于在发送端的时域上,发送第四报文的时间;处理模块902,还用于比较第一发送时戳和第三发送时戳的大小,确定第一报文的排序是否正确;处理模块902,还用于若第一报文排序错误,则调整第一时延参数。Optionally, the receiving module 901 is further configured to receive a fourth packet of the first service sent by the sending end, where the fourth packet carries a third sending timestamp, and the third sending timestamp corresponds to the time domain of the sending end, The time of sending the fourth message; the processing module 902 is also used to compare the size of the first sending time stamp and the third sending time stamp to determine whether the ordering of the first message is correct; the processing module 902 is also used for if the first If the packets are sorted incorrectly, adjust the first delay parameter.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
在本实施例中,该通信装置90以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定ASIC,电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到该通信装置90可以采用图5所示的通信装置50的形式。In this embodiment, the communication device 90 is presented in the form of dividing various functional modules in an integrated manner. A "module" here may refer to a specific ASIC, a circuit, a processor and a memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that can provide the functions described above. In a simple embodiment, those skilled in the art can imagine that the communication device 90 can take the form of the communication device 50 shown in FIG. 5 .
比如,图5所示的通信装置50中的处理器501可以通过调用存储器503中存储的计算机执行指令,使得通信装置50执行上述方法实施例中的传输报文的方法。For example, the processor 501 in the communication device 50 shown in FIG. 5 can invoke the computer-executed instructions stored in the memory 503, so that the communication device 50 executes the method for transmitting a message in the above method embodiment.
具体的,图9中的接收模块901和处理模块902的功能/实现过程可以通过图5所示的通信装置50中的处理器501调用存储器503中存储的计算机执行指令来实现。或者,图9中的处理模块902的功能/实现过程可以通过图5所示的通信装置50中的处理器501调用存储器503中存储的计算机执行指令来实现,图9中的接收模块901的功能/实现过程可以通过图5中所示的通信装置50中的通信接口504来实现。Specifically, the functions/implementation process of the receiving module 901 and the processing module 902 in FIG. 9 can be implemented by the processor 501 in the communication device 50 shown in FIG. 5 invoking computer-executed instructions stored in the memory 503 . Alternatively, the function/implementation process of the processing module 902 in FIG. 9 can be implemented by calling the computer execution instructions stored in the memory 503 by the processor 501 in the communication device 50 shown in FIG. /The implementation process can be implemented through the communication interface 504 in the communication device 50 shown in FIG. 5 .
由于本实施例提供的通信装置90可执行上述传输报文的方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the communication device 90 provided in this embodiment can execute the above-mentioned method for transmitting a message, the technical effect it can obtain can refer to the above-mentioned method embodiment, and details are not repeated here.
需要说明的是,以上模块或单元的一个或多个可以软件、硬件或二者结合来实现。当以上任一模块或单元以软件实现的时候,所述软件以计算机程序指令的方式存在,并被存储在存储器中,处理器可以用于执行所述程序指令并实现以上方法流程。该处理器可以内置于SoC(片上系统)或ASIC,也可是一个独立的半导体芯片。该处理器内处理用于执行软件指令以进行运算或处理的核外,还可进一步包括必要的硬件加速器,如现场可编程门阵列(field programmable gate array,FPGA)、PLD(可编程逻辑器件)、或者实现专用逻辑运算的逻辑电路。It should be noted that one or more of the above modules or units may be implemented by software, hardware or a combination of both. When any of the above modules or units is implemented by software, the software exists in the form of computer program instructions and is stored in the memory, and the processor can be used to execute the program instructions and realize the above method flow. The processor can be built into a SoC (system on a chip) or ASIC, or it can be an independent semiconductor chip. The core of the processor is used to execute software instructions for calculation or processing, and can further include necessary hardware accelerators, such as field programmable gate array (field programmable gate array, FPGA), PLD (programmable logic device) , or a logic circuit that implements a dedicated logic operation.
当以上模块或单元以硬件实现的时候,该硬件可以是CPU、微处理器、数字信号处理(digital signal processing,DSP)芯片、微控制单元(microcontroller unit,MCU)、人工智能处理器、ASIC、SoC、FPGA、PLD、专用数字电路、硬件加速器或非集成的分立器件中的任一个或任一组合,其可以运行必要的软件或不依赖于软件以执行以上方法流程。When the above modules or units are implemented by hardware, the hardware can be CPU, microprocessor, digital signal processing (digital signal processing, DSP) chip, microcontroller unit (microcontroller unit, MCU), artificial intelligence processor, ASIC, Any one or any combination of SoC, FPGA, PLD, dedicated digital circuit, hardware accelerator or non-integrated discrete device, which can run necessary software or not depend on software to execute the above method flow.
可选的,本申请实施例还提供了一种芯片系统,包括:至少一个处理器和接口,该至少一个处理器通过接口与存储器耦合,当该至少一个处理器执行存储器中的计算机程序或指令时,使得上述任一方法实施例中的方法被执行。在一种可能的实现方式中,该通信装置还包括存储器。可选的,该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。Optionally, an embodiment of the present application further provides a chip system, including: at least one processor and an interface, the at least one processor is coupled to the memory through the interface, and when the at least one processor executes the computer program or instruction in the memory When, the method in any one of the above method embodiments is executed. In a possible implementation manner, the communication device further includes a memory. Optionally, the system-on-a-chip may consist of a chip, or may include a chip and other discrete devices, which is not specifically limited in this embodiment of the present application.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产 生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or may be a data storage device including one or more servers, data centers, etc. that can be integrated with the medium. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application has been described in conjunction with various embodiments here, however, in the process of implementing the claimed application, those skilled in the art can understand and Other variations of the disclosed embodiments are implemented. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that these measures cannot be combined to advantage.
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely illustrative of the application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of this application. Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (25)

  1. 一种传输报文的方法,应用于接收端,其特征在于,所述方法包括:A method for transmitting messages, applied to a receiving end, characterized in that the method includes:
    接收发送端通过第一路径发送的第一业务的第一报文,所述第一报文携带第一发送时戳,所述第一发送时戳对应于在所述发送端的时域上,发送所述第一报文的时间,所述第一路径是传输所述第一业务的报文至所述接收端的多个路径中的一个;receiving the first packet of the first service sent by the sending end through the first path, the first packet carrying a first sending timestamp, the first sending timestamp corresponding to the time domain of the sending end, sending The time of the first message, the first path is one of multiple paths for transmitting the message of the first service to the receiving end;
    获得所述第一业务的第一时延参数,所述第一时延参数是根据所述多个路径的第一最大传输时延确定的;Obtain a first delay parameter of the first service, where the first delay parameter is determined according to the first maximum transmission delay of the multiple paths;
    根据所述第一发送时戳和所述第一时延参数获得第一预计读取时间;Obtain a first expected read time according to the first sending timestamp and the first delay parameter;
    根据所述第一预计读取时间读取所述第一报文的数据。Read the data of the first message according to the first estimated read time.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一预计读取时间读取所述第一报文的数据,包括:The method according to claim 1, wherein reading the data of the first message according to the first expected reading time comprises:
    在按照时间排序的多个队列中,根据所述第一预计读取时间将所述第一报文入队;In multiple queues sorted by time, enqueue the first message according to the first expected reading time;
    在已达到或者超过所述第一预计读取时间、并且所述多个队列指示轮到读取所述第一报文的数据的情况下,读取所述第一报文的数据。When the first expected reading time has been reached or exceeded, and the multiple queues indicate that it is time to read the data of the first message, the data of the first message is read.
  3. 根据权利要求2所述的方法,其特征在于,所述多个队列包括第一队列,所述根据所述第一预计读取时间将所述第一报文入队,包括:The method according to claim 2, wherein the multiple queues include a first queue, and enqueuing the first message according to the first expected reading time includes:
    根据所述第一预计读取时间与当前时间的差值,将所述第一报文的信息输入所述第一队列,所述第一预计读取时间与当前时间的差值属于所述第一队列对应的时间差值区间。Input the information of the first message into the first queue according to the difference between the first predicted reading time and the current time, and the difference between the first predicted reading time and the current time belongs to the first queue. The time difference interval corresponding to a queue.
  4. 根据权利要求3所述的方法,其特征在于,所述第一队列中还存储了第二报文的信息,The method according to claim 3, wherein information of the second message is also stored in the first queue,
    若所述第一预计读取时间早于所述第二报文的预计读取时间,则所述第一报文的信息从所述第一队列输出的时间,早于所述第二报文的信息从所述第一队列输出的时间;或者,If the first expected reading time is earlier than the expected reading time of the second message, the time when the information of the first message is output from the first queue is earlier than the second message The time at which the information was output from the first queue; or,
    若所述第一预计读取时间晚于所述第二报文的预计读取时间,则所述第一报文的信息从所述第一队列输出的时间,晚于所述第二报文的信息从所述第一队列输出的时间。If the first expected reading time is later than the expected reading time of the second message, the time when the information of the first message is output from the first queue is later than that of the second message The time the message was output from the first queue.
  5. 根据权利要求4所述的方法,其特征在于,所述第二报文为所述发送端发送的除所述第一报文之外的第一业务的其他报文,所述发送端发送的其他业务的报文,或其他发送端发送的报文。The method according to claim 4, wherein the second message is other messages of the first service other than the first message sent by the sending end, and the second message sent by the sending end Messages of other services, or messages sent by other senders.
  6. 根据权利要求3-5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 3-5, wherein the method further comprises:
    若所述第一预计读取时间与当前时间的差值,小于所述第一队列对应的时间差值区间的最小值,则将所述第一报文的信息从所述第一队列输出,输入到第二队列,所述第二队列包括在所述多个队列中,所述第一预计读取时间与当前时间的差值属于所述第二队列对应的时间差值区间。If the difference between the first expected reading time and the current time is smaller than the minimum value of the time difference interval corresponding to the first queue, output the information of the first message from the first queue, input to the second queue, the second queue is included in the plurality of queues, and the difference between the first expected reading time and the current time belongs to the time difference interval corresponding to the second queue.
  7. 根据权利要求6所述的方法,其特征在于,所述多个队列分为多组,所述第一队列包括在第一组队列中,所述第二队列包括在第二组队列中,所述第一组队列中的队列对应的时间差值区间的长度,大于所述第二组队列中的队列对应的时间差值区间的长度。The method according to claim 6, wherein the plurality of queues are divided into multiple groups, the first queue is included in the first group of queues, and the second queue is included in the second group of queues , the length of the time difference interval corresponding to the queues in the first group of queues is greater than the length of the time difference interval corresponding to the queues in the second group of queues.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述根据所述第一发送时戳和所述第一时延参数获得第一预计读取时间,包括:The method according to any one of claims 1-7, wherein the obtaining the first estimated read time according to the first sending timestamp and the first delay parameter comprises:
    将所述第一发送时戳映射到所述接收端的时域上以得到第二发送时戳;mapping the first sending timestamp to the time domain of the receiving end to obtain a second sending timestamp;
    根据所述第二发送时戳和所述第一时延参数获得所述第一预计读取时间。Obtain the first expected read time according to the second sending timestamp and the first delay parameter.
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, characterized in that the method further comprises:
    获取第一参考时戳、第二参考时戳和第一时钟映射参数,所述第一参考时戳为在所述发送端的时域上、第一时刻对应的时间,所述第二参考时戳为在所述接收端的时域上、所述第 一时刻对应的时间;Obtain a first reference time stamp, a second reference time stamp and a first clock mapping parameter, the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end, and the second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end;
    所述将所述第一发送时戳映射到所述接收端的时域上以得到第二发送时戳,包括:The mapping of the first sending timestamp to the time domain of the receiving end to obtain the second sending timestamp includes:
    根据所述第一发送时戳、所述第一参考时戳、所述第二参考时戳和所述第一时钟映射参数,获得所述第二发送时戳。Obtain the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter.
  10. 根据权利要求9所述的方法,其特征在于,所述第一时刻对应于所述发送端通过所述第一路径向所述接收端发送所述第一业务的第三报文的时间,所述方法还包括:The method according to claim 9, wherein the first moment corresponds to the time when the sending end sends the third message of the first service to the receiving end through the first path, so The method also includes:
    根据第一传输时延、第二传输时延和调整因子,调整所述第一时钟映射参数,所述第一传输时延为所述第一报文从所述发送端传输至所述接收端的传输时延,所述第二传输时延为所述第三报文从所述发送端传输至所述接收端的传输时延。Adjust the first clock mapping parameter according to the first transmission delay, the second transmission delay and the adjustment factor, where the first transmission delay is the transmission time of the first message from the sending end to the receiving end Transmission delay, the second transmission delay is the transmission delay of the third packet from the sending end to the receiving end.
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-10, further comprising:
    接收所述发送端发送的所述第一业务的第四报文,所述第四报文携带第三发送时戳,所述第三发送时戳对应于在所述发送端的时域上,发送所述第四报文的时间;receiving the fourth packet of the first service sent by the sending end, the fourth packet carrying a third sending timestamp, the third sending timestamp corresponding to the time domain of the sending end, sending the time of the fourth message;
    比较所述第一发送时戳和所述第三发送时戳的大小,确定所述第一报文的排序是否正确;Comparing the sizes of the first sending timestamp and the third sending timestamp to determine whether the sorting of the first message is correct;
    若所述第一报文排序错误,则调整所述第一时延参数。If the sequence of the first packet is wrong, adjust the first delay parameter.
  12. 一种通信装置,其特征在于,所述通信装置包括:接收模块和处理模块;A communication device, characterized in that the communication device includes: a receiving module and a processing module;
    所述接收模块,用于接收发送端通过第一路径发送的第一业务的第一报文,所述第一报文携带第一发送时戳,所述第一发送时戳对应于在所述发送端的时域上,发送所述第一报文的时间,所述第一路径是传输所述第一业务的报文至所述接收端的多个路径中的一个;The receiving module is configured to receive the first message of the first service sent by the sending end through the first path, the first message carries a first sending timestamp, and the first sending timestamp corresponds to the In the time domain of the sending end, the time when the first message is sent, and the first path is one of multiple paths for transmitting the message of the first service to the receiving end;
    所述处理模块,用于获得所述第一业务的第一时延参数,所述第一时延参数是根据所述多个路径的第一最大传输时延确定的;The processing module is configured to obtain a first delay parameter of the first service, where the first delay parameter is determined according to the first maximum transmission delay of the multiple paths;
    所述处理模块,还用于根据所述第一发送时戳和所述第一时延参数获得第一预计读取时间;The processing module is further configured to obtain a first expected read time according to the first sending timestamp and the first delay parameter;
    所述处理模块,还用于根据所述第一预计读取时间读取所述第一报文的数据。The processing module is further configured to read the data of the first message according to the first expected reading time.
  13. 根据权利要求12所述的通信装置,其特征在于,The communication device according to claim 12, wherein:
    所述处理模块,具体用于在按照时间排序的多个队列中,根据所述第一预计读取时间将所述第一报文入队;The processing module is specifically configured to enqueue the first message according to the first expected reading time in multiple queues sorted by time;
    所述处理模块,还具体用于在已达到或者超过所述第一预计读取时间、并且所述多个队列指示轮到读取所述第一报文的数据的情况下,读取所述第一报文的数据。The processing module is further specifically configured to read the first message when the first expected reading time has been reached or exceeded, and the multiple queues indicate that it is time to read the data of the first message. The data of the first message.
  14. 根据权利要求13所述的通信装置,其特征在于,The communication device according to claim 13, wherein:
    所述处理模块,还具体用于根据所述第一预计读取时间与当前时间的差值,将所述第一报文的信息输入所述第一队列,所述第一预计读取时间与当前时间的差值属于所述第一队列对应的时间差值区间。The processing module is further specifically configured to input the information of the first message into the first queue according to the difference between the first expected reading time and the current time, and the first expected reading time and The current time difference belongs to the time difference interval corresponding to the first queue.
  15. 根据权利要求14所述的通信装置,其特征在于,所述第一队列中还存储了第二报文的信息,The communication device according to claim 14, wherein information of the second message is also stored in the first queue,
    若所述第一预计读取时间早于所述第二报文的预计读取时间,则所述第一报文的信息从所述第一队列输出的时间,早于所述第二报文的信息从所述第一队列输出的时间;或者,If the first expected reading time is earlier than the expected reading time of the second message, the time when the information of the first message is output from the first queue is earlier than the second message The time at which the information was output from the first queue; or,
    若所述第一预计读取时间晚于所述第二报文的预计读取时间,则所述第一报文的信息从所述第一队列输出的时间,晚于所述第二报文的信息从所述第一队列输出的时间。If the first expected reading time is later than the expected reading time of the second message, the time when the information of the first message is output from the first queue is later than that of the second message The time the message was output from the first queue.
  16. 根据权利要求15所述的通信装置,其特征在于,所述第二报文为所述发送端发送的除所述第一报文之外的第一业务的其他报文,所述发送端发送的其他业务的报文,或其他发送端发送的报文。The communication device according to claim 15, wherein the second message is other messages of the first service other than the first message sent by the sending end, and the sending end sends Messages of other services, or messages sent by other senders.
  17. 根据权利要求14-16中任一项所述的通信装置,其特征在于,The communication device according to any one of claims 14-16, characterized in that,
    所述处理模块,还用于若所述第一预计读取时间与当前时间的差值,小于所述第一队列对应的时间差值区间的最小值,则将所述第一报文的信息从所述第一队列输出,输入到第二队列,所述第二队列包括在所述多个队列中,所述第一预计读取时间与当前时间的差值属于所述第二队列对应的时间差值区间。The processing module is further configured to: if the difference between the first expected read time and the current time is smaller than the minimum value of the time difference interval corresponding to the first queue, then send the information of the first message to Output from the first queue, input to the second queue, the second queue is included in the plurality of queues, the difference between the first expected read time and the current time belongs to the corresponding to the second queue Time difference interval.
  18. 根据权利要求17所述的通信装置,其特征在于,所述多个队列分为多组,所述第一队列包括在第一组队列中,所述第二队列包括在第二组队列中,所述第一组队列中的队列对应的时间差值区间的长度,大于所述第二组队列中的队列对应的时间差值区间的长度。The communication device according to claim 17, wherein the multiple queues are divided into multiple groups, the first queue is included in the first group of queues, and the second queue is included in the second group of queues wherein, the length of the time difference interval corresponding to the queues in the first group of queues is greater than the length of the time difference interval corresponding to the queues in the second group of queues.
  19. 根据权利要求12-18中任一项所述的通信装置,其特征在于,The communication device according to any one of claims 12-18, characterized in that,
    所述处理模块,具体用于将所述第一发送时戳映射到所述接收端的时域上以得到第二发送时戳;The processing module is specifically configured to map the first sending timestamp to the time domain of the receiving end to obtain a second sending timestamp;
    所述处理模块,还具体用于根据所述第二发送时戳和所述第一时延参数获得所述第一预计读取时间。The processing module is further specifically configured to obtain the first expected read time according to the second sending timestamp and the first delay parameter.
  20. 根据权利要求19所述的通信装置,其特征在于,The communication device according to claim 19, wherein:
    所述处理模块,还用于获取第一参考时戳、第二参考时戳和第一时钟映射参数,所述第一参考时戳为在所述发送端的时域上、第一时刻对应的时间,所述第二参考时戳为在所述接收端的时域上、所述第一时刻对应的时间;The processing module is further configured to obtain a first reference time stamp, a second reference time stamp and a first clock mapping parameter, the first reference time stamp is the time corresponding to the first moment in the time domain of the sending end , the second reference time stamp is the time corresponding to the first moment in the time domain of the receiving end;
    所述处理模块,还具体用于根据所述第一发送时戳、所述第一参考时戳、所述第二参考时戳和所述第一时钟映射参数,获得所述第二发送时戳。The processing module is further specifically configured to obtain the second sending time stamp according to the first sending time stamp, the first reference time stamp, the second reference time stamp and the first clock mapping parameter .
  21. 根据权利要求20所述的通信装置,其特征在于,所述第一时刻对应于所述发送端通过所述第一路径向所述接收端发送所述第一业务的第三报文的时间,The communication device according to claim 20, wherein the first moment corresponds to the time when the sending end sends the third message of the first service to the receiving end through the first path,
    所述处理模块,还用于根据第一传输时延、第二传输时延和调整因子,调整所述第一时钟映射参数,所述第一传输时延为所述第一报文从所述发送端传输至所述接收端的传输时延,所述第二传输时延为所述第三报文从所述发送端传输至所述接收端的传输时延。The processing module is further configured to adjust the first clock mapping parameter according to the first transmission delay, the second transmission delay and an adjustment factor, the first transmission delay being the The transmission delay from the sending end to the receiving end, and the second transmission delay is the transmission delay of the third packet from the sending end to the receiving end.
  22. 根据权利要求12-21中任一项所述的通信装置,其特征在于,The communication device according to any one of claims 12-21, characterized in that,
    所述接收模块,还用于接收所述发送端发送的所述第一业务的第四报文,所述第四报文携带第三发送时戳,所述第三发送时戳对应于在所述发送端的时域上,发送所述第四报文的时间;The receiving module is further configured to receive a fourth message of the first service sent by the sending end, where the fourth message carries a third sending timestamp, and the third sending timestamp corresponds to the In the time domain of the sending end, the time for sending the fourth message;
    所述处理模块,还用于比较所述第一发送时戳和所述第三发送时戳的大小,确定所述第一报文的排序是否正确;The processing module is further configured to compare the sizes of the first sending time stamp and the third sending time stamp, and determine whether the sorting of the first message is correct;
    所述处理模块,还用于若所述第一报文排序错误,则调整所述第一时延参数。The processing module is further configured to adjust the first delay parameter if the first packet is wrongly sorted.
  23. 一种通信装置,其特征在于,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述装置执行如权利要求1至11中任一项所述的方法。A communication device, characterized in that it includes: a processor, the processor is coupled with a memory, and the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor, the device Carrying out the method according to any one of claims 1 to 11.
  24. 一种计算机可读介质,其上存储有计算机程序或指令,其特征在于,所述计算机程序或指令被执行时使得计算机执行如权利要求1至11中任一项所述的方法。A computer-readable medium, on which computer programs or instructions are stored, wherein when the computer program or instructions are executed, the computer executes the method according to any one of claims 1 to 11.
  25. 一种通信系统,其特征在于,包括:发送端和接收端;A communication system, characterized in that it includes: a sending end and a receiving end;
    所述发送端,用于将第一发送时戳插入到第一业务的第一报文中,通过第一路径向所述接收端发送所述第一报文,所述第一发送时戳对应于在所述发送端的时域上,发送所述第一报文的时间,所述第一路径是传输所述第一业务的报文至所述接收端的多个路径中的一个;The sending end is configured to insert the first sending time stamp into the first message of the first service, and send the first message to the receiving end through the first path, and the first sending time stamp corresponds to In the time domain of the sending end, the time at which the first message is sent, the first path is one of multiple paths for transmitting the message of the first service to the receiving end;
    所述接收端,用于执行如权利要求1-11中任一项所述的方法。The receiving end is configured to execute the method according to any one of claims 1-11.
PCT/CN2022/071659 2021-05-28 2022-01-12 Message transmission method and apparatus WO2022247307A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110593746.8A CN115412508A (en) 2021-05-28 2021-05-28 Method and device for transmitting message
CN202110593746.8 2021-05-28

Publications (1)

Publication Number Publication Date
WO2022247307A1 true WO2022247307A1 (en) 2022-12-01

Family

ID=84155296

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/071659 WO2022247307A1 (en) 2021-05-28 2022-01-12 Message transmission method and apparatus

Country Status (2)

Country Link
CN (1) CN115412508A (en)
WO (1) WO2022247307A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294870A (en) * 2016-04-05 2017-10-24 中兴通讯股份有限公司 Message sending, receiving method and device and message processing method and system
CN110380978A (en) * 2018-04-13 2019-10-25 清华大学 Dispatching method, device, computer equipment and the storage medium of multi-path transmission
CN111082898A (en) * 2018-10-19 2020-04-28 华为技术有限公司 Message processing method and device
US20200236043A1 (en) * 2016-12-21 2020-07-23 Dejero Labs Inc. Packet transmission system and method
CN111490934A (en) * 2020-04-24 2020-08-04 电子科技大学 Multi-path routing system based on stream burstiness

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294870A (en) * 2016-04-05 2017-10-24 中兴通讯股份有限公司 Message sending, receiving method and device and message processing method and system
US20200236043A1 (en) * 2016-12-21 2020-07-23 Dejero Labs Inc. Packet transmission system and method
CN110380978A (en) * 2018-04-13 2019-10-25 清华大学 Dispatching method, device, computer equipment and the storage medium of multi-path transmission
CN111082898A (en) * 2018-10-19 2020-04-28 华为技术有限公司 Message processing method and device
CN111490934A (en) * 2020-04-24 2020-08-04 电子科技大学 Multi-path routing system based on stream burstiness

Also Published As

Publication number Publication date
CN115412508A (en) 2022-11-29

Similar Documents

Publication Publication Date Title
US8370675B2 (en) Precise clock synchronization
US8549341B2 (en) System and method for reducing latency associated with timestamps in a multi-core, multi-threaded processor
CN110214436B (en) Multi-core lock-free rate limiting device and method
Moreno et al. Batch to the future: Analyzing timestamp accuracy of high-performance packet I/O engines
KR20220045982A (en) A method for transmitting a data packet, and an apparatus for implementing the method
WO2020207469A1 (en) Service processing method and apparatus
Ruan et al. FSQCN: Fast and simple quantized congestion notification in data center Ethernet
WO2022247307A1 (en) Message transmission method and apparatus
WO2023197835A1 (en) Clock synchronization method and related device
Orosz et al. Performance evaluation of a high precision software-based timestamping solution for network monitoring
US8630181B2 (en) Communication system and corresponding integrated circuit and method
Orosz et al. Software-based packet capturing with high precision timestamping for Linux
US20230131022A1 (en) Telemetry and Buffer-Capacity Based Circuits for Load-Balanced Fine-Grained Adaptive Routing in High-Performance System Interconnect
CN114938354A (en) Congestion control method, device, equipment and storage medium
CN114338386A (en) Network configuration method and device, electronic equipment and storage medium
WO2016134632A1 (en) Data processing system
Jahnke et al. Live in the express lane
US20230361900A1 (en) Synchronized rate control at rate limiter
Liu et al. Optimizing flow completion time via adaptive buffer management in data center networks
Pham Communication performance of low-resource sensor motes for data-intensive applications
US11637778B2 (en) Filter with engineered damping for load-balanced fine-grained adaptive routing in high-performance system interconnect
US11683269B2 (en) Data flow processing method, electronic device, and storage medium
US20240054559A1 (en) Method, apparatus and system for time stamping and sequencing data items
WO2023019889A1 (en) Packet processing method and apparatus, device, and computer readable storage medium
Chen et al. Scheduling methods of spacewire fiber-optic bus and verification

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22810046

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE