WO2022110174A1 - Message editing method and device - Google Patents

Message editing method and device Download PDF

Info

Publication number
WO2022110174A1
WO2022110174A1 PCT/CN2020/132850 CN2020132850W WO2022110174A1 WO 2022110174 A1 WO2022110174 A1 WO 2022110174A1 CN 2020132850 W CN2020132850 W CN 2020132850W WO 2022110174 A1 WO2022110174 A1 WO 2022110174A1
Authority
WO
WIPO (PCT)
Prior art keywords
editing
message
command
editing unit
unit
Prior art date
Application number
PCT/CN2020/132850
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 华为技术有限公司
Priority to CN202080106442.8A priority Critical patent/CN116458143A/en
Priority to PCT/CN2020/132850 priority patent/WO2022110174A1/en
Publication of WO2022110174A1 publication Critical patent/WO2022110174A1/en

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

Embodiments of the present application relate to the technical field of chip design, and provide a message editing method and device, capable of increasing a message editing rate of a message editor. The specific solution comprises: a first editing unit can receive a first message, the first message comprising a first command sequence and a first data payload; when an identifier of the first editing unit is the same as that of a first editing command, the first editing unit can intercept the first editing command from the first command sequence, and edit the first data payload according to the first editing command, so as to obtain a second message, the first editing command being a first editing command in the first command sequence, and the second message comprising the first command sequence after the first editing command is intercepted and the edited first data payload; then, the first editing unit can send the second message to a second editing unit, so that the second editing unit processes the second message.

Description

一种编辑报文的方法及装置A method and device for editing a message 技术领域technical field
本申请实施例涉及芯片设计技术领域,尤其涉及一种编辑报文的方法及装置。The embodiments of the present application relate to the technical field of chip design, and in particular, to a method and apparatus for editing a message.
背景技术Background technique
随着科技的进步,许多业务(例如自动驾驶、金融交易等)对网络时延和带宽的要求越来越高。其中,在运行业务的过程中,报文编辑器编辑业务的报文的速率,可以影响业务的网络时延和带宽。With the advancement of technology, many services (such as autonomous driving, financial transactions, etc.) have higher and higher requirements for network latency and bandwidth. Wherein, in the process of running the service, the rate at which the packet editor edits the service packets can affect the network delay and bandwidth of the service.
通常情况下,一条报文中可以存在多个编辑命令(例如校验命令、删除命令等)。常用的报文编辑方法中,报文编辑器需要执行多个编辑命令,对该报文进行多次编辑,以完成对该报文的处理。Usually, there may be multiple editing commands (for example, verify commands, delete commands, etc.) in one message. In a commonly used message editing method, the message editor needs to execute multiple editing commands to edit the message multiple times to complete the processing of the message.
然而,上述方法中,报文编辑器必须对一条报文编辑多次之后,才可以开始编辑下一个报文。也就是说,当存在两条报文需要编辑时,报文编辑器只能串行编辑每一条报文,即只能在编辑完一条报文后,再编辑另一条报文,编辑报文的速率较低。However, in the above method, the message editor must edit a message for many times before starting to edit the next message. That is to say, when there are two messages that need to be edited, the message editor can only edit each message serially, that is, after editing one message, edit another message and edit the rate is lower.
发明内容SUMMARY OF THE INVENTION
本申请提供一种编辑报文的方法及电子设备,报文编辑器可以同时编辑多条报文,从而提高编辑报文的速率。The present application provides a method and electronic device for editing a message, and a message editor can edit multiple messages at the same time, thereby increasing the speed of editing messages.
第一方面,本申请提供一种编辑报文的方法,该方法可以应用于报文编辑器,该报文编辑器包括多个编辑单元,多个编辑单元包括第一编辑单元和第二编辑单元。In a first aspect, the present application provides a method for editing a message, the method can be applied to a message editor, the message editor includes a plurality of editing units, and the plurality of editing units includes a first editing unit and a second editing unit .
第一编辑单元可以接收第一报文,该第一报文包括第一命令序列和第一数据净荷,第一命令序列包括按照第一预设顺序排列的多个编辑命令,第一命令序列包含于第一报文的头部。在第一编辑单元的标识与第一编辑命令的标识相同的情况下,第一编辑单元则可以从第一命令序列中截取第一编辑命令,并根据第一编辑命令编辑第一数据净荷,得到第二报文。其中,第一编辑命令是第一命令序列中的第一个编辑命令,第二报文包括截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷。之后,第一编辑单元可以向第二编辑单元发送第二报文,由第二编辑单元处理第二报文。The first editing unit can receive a first message, the first message includes a first command sequence and a first data payload, the first command sequence includes a plurality of editing commands arranged in a first preset order, the first command sequence Included in the header of the first packet. When the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit can intercept the first editing command from the first command sequence, and edit the first data payload according to the first editing command, Get the second message. The first editing command is the first editing command in the first command sequence, and the second packet includes the first command sequence after intercepting the first editing command and the edited first data payload. Afterwards, the first editing unit may send the second message to the second editing unit, and the second editing unit processes the second message.
基于上述技术方案,在第一编辑单元的标识与第一编辑命令的标识相同的情况下,第一编辑单元只根据第一编辑命令编辑第一报文(第一命令序列和第一数据净荷)。也就是说,多个编辑单元中,多个编辑单元的标识与编辑命令序列中的多个编辑命令的标识存在对应关系。并且,第一编辑单元只需要编辑一次第一报文,无需对第一报文进行多次编辑。之后,第一编辑单元将截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷(即第二报文)发送至第二编辑单元,由第二编辑单元处理第二报文。Based on the above technical solution, when the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit only edits the first packet (the first command sequence and the first data payload) according to the first editing command ). That is, among the multiple editing units, the identifiers of the multiple editing units have a corresponding relationship with the identifiers of the multiple editing commands in the editing command sequence. Moreover, the first editing unit only needs to edit the first message once, and does not need to edit the first message multiple times. After that, the first editing unit sends the first command sequence after intercepting the first editing command and the edited first data payload (ie, the second message) to the second editing unit, and the second editing unit processes the second message. arts.
本申请中的报文编辑器包括多个编辑单元,该多个编辑单元可以串行编辑一个报文。例如,第一编辑单元编辑完一个报文(如第一报文)后,可将编辑后的报文(如第二报文)发送至第二编辑单元,由第二编辑单元继续编辑该报文。如此,第二报文发送至第二编辑单元后,第一编辑单元便处于空闲状态。此时,第一编辑单元便可以 编辑新的报文。这样一来,报文编辑器可以同时编辑多条报文,提高了编辑报文的速率。The message editor in this application includes a plurality of editing units, and the plurality of editing units can edit a message in series. For example, after editing a message (such as the first message) by the first editing unit, it may send the edited message (such as the second message) to the second editing unit, and the second editing unit will continue to edit the message arts. In this way, after the second message is sent to the second editing unit, the first editing unit is in an idle state. At this point, the first editing unit can edit the new message. In this way, the message editor can edit multiple messages at the same time, which improves the speed of editing messages.
结合第一方面,在一种可能的设计方式中,上述方法还包括:第一编辑单元可以接收第三报文,该第三报文包括第二命令序列和第二数据净荷,该第二命令序列包括按照第二预设顺序排列的多个编辑命令,第二命令序列包含于第三报文的头部。在第一编辑单元向第二编辑单元发送第二报文之后,若第一编辑单元的标识与第二编辑命令的标识相同,第一编辑单元则可以从第二命令序列中截取第二编辑命令,并根据第二编辑命令编辑第二数据净荷,得到第四报文;其中,第二编辑命令是第二命令序列中的第一个编辑命令,第四报文包括截取第二编辑命令之后的第二命令序列和编辑后的第二数据净荷。然后,第一编辑单元向第二编辑单元发送第四报文,由第二编辑单元处理第四报文。With reference to the first aspect, in a possible design manner, the above method further includes: the first editing unit may receive a third packet, where the third packet includes a second command sequence and a second data payload, the second The command sequence includes a plurality of editing commands arranged in a second preset order, and the second command sequence is included in the header of the third packet. After the first editing unit sends the second message to the second editing unit, if the identifier of the first editing unit is the same as the identifier of the second editing command, the first editing unit can intercept the second editing command from the second command sequence , and edit the second data payload according to the second editing command to obtain a fourth message; wherein, the second editing command is the first editing command in the second command sequence, and the fourth message includes after intercepting the second editing command the second command sequence and the edited second data payload. Then, the first editing unit sends the fourth message to the second editing unit, and the second editing unit processes the fourth message.
可以理解的是,由于在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元处于空闲状态。因此,在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元可以编辑接收到的第三报文。这样一来,报文编辑器可以同时编辑多条报文(第一编辑单元编辑第三报文,第二编辑单元编辑第二报文),从而提高编辑报文的速率。之后,第一编辑单元编辑第三报文得到第四报文,并向第二编辑单元发送第四报文,使第二编辑单元处理第四报文。由于报文编辑器包括多个编辑单元。因此,报文编辑器可以通过上述方式,由多个编辑单元串行编辑报文,以完成对报文的编辑。It can be understood that after the first editing unit sends the second message to the second editing unit, the first editing unit is in an idle state. Therefore, after the first editing unit sends the second message to the second editing unit, the first editing unit can edit the received third message. In this way, the message editor can edit multiple messages at the same time (the first editing unit edits the third message, and the second editing unit edits the second message), thereby increasing the speed of editing messages. After that, the first editing unit edits the third message to obtain the fourth message, and sends the fourth message to the second editing unit, so that the second editing unit processes the fourth message. Since the message editor includes multiple editing units. Therefore, the message editor can edit the message serially by a plurality of editing units in the above manner, so as to complete the editing of the message.
结合第一方面,在另一种可能的设计方式中,上述“第一编辑单元可以接收第一报文”的方法包括:第一编辑单元可以接收来自多个编辑单元中第三编辑单元的第一报文,该第一报文是第三编辑单元处理后的报文;或者,第一编辑单元可以接收来自报文编辑器的上游器件的第一报文。With reference to the first aspect, in another possible design manner, the above-mentioned method of "the first editing unit can receive the first message" includes: the first editing unit can receive the first message from the third editing unit in the plurality of editing units A message, the first message is the message processed by the third editing unit; or, the first editing unit may receive the first message from the upstream device of the message editor.
也就是说,上述第一编辑单元既可以接收来自第三编辑单元处理后的报文,也可以接收来自报文编辑器的上游器件(例如芯片报文缓存管理器(Data Buffer Manager,DBM))发送的未被编辑的原始报文。That is to say, the above-mentioned first editing unit can not only receive the message processed by the third editing unit, but also receive the upstream device from the message editor (for example, the chip message buffer manager (Data Buffer Manager, DBM)) The original unedited message sent.
结合第一方面,在另一种可能的设计方式中,上述方法还包括:若第一编辑单元的标识与第一编辑命令的标识不同,第一编辑单元可以向第二编辑单元透传第一报文,由第二编辑单元处理第一报文。In combination with the first aspect, in another possible design manner, the above method further includes: if the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit can transparently transmit the first editing unit to the second editing unit. message, the first message is processed by the second editing unit.
也就是说,多个编辑单元中,多个编辑单元的标识与编辑命令序列中的多个编辑命令的标识存在对应关系。在第一编辑单元的标识与第一编辑命令的标识不同的情况下,第一编辑单元不会对第一报文进行编辑,而是将其发送至第二编辑单元,由第二编辑单元处理该第一报文。That is, among the multiple editing units, the identifiers of the multiple editing units have a corresponding relationship with the identifiers of the multiple editing commands in the editing command sequence. When the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit will not edit the first message, but will send it to the second editing unit for processing by the second editing unit the first message.
结合第一方面,在另一种可能的设计方式中,上述第二编辑单元可以是多个编辑单元中、预先设定的第一编辑单元的下一个编辑单元。With reference to the first aspect, in another possible design manner, the above-mentioned second editing unit may be the next editing unit of the preset first editing unit among the plurality of editing units.
示例性的,报文编辑器中包括依次排列的编辑单元a、编辑单元b和编辑单元c。编辑单元a为报文编辑器中的第一个编辑单元,编辑单元b为第二个编辑单元,编辑单元c为第三个编辑单元。当第一编辑单元为编辑单元a时,第二编辑单元为编辑单元b。也就是说,编辑单元a处理完报文之后,会将处理后的报文发送至编辑单元b。Exemplarily, the message editor includes an editing unit a, an editing unit b, and an editing unit c that are arranged in sequence. Editing unit a is the first editing unit in the message editor, editing unit b is the second editing unit, and editing unit c is the third editing unit. When the first editing unit is editing unit a, the second editing unit is editing unit b. That is to say, after editing unit a finishes processing the message, it sends the processed message to editing unit b.
结合第一方面,在另一种可能的设计方式中,第一编辑单元还包括MUX模块, 第二编辑单元为MUX模块指定的、第一编辑单元的下一个编辑单元。With reference to the first aspect, in another possible design manner, the first editing unit further includes a MUX module, and the second editing unit is specified by the MUX module and is the next editing unit of the first editing unit.
示例性的,报文编辑器中包括依次排列的编辑单元a、编辑单元b和编辑单元c。编辑单元a为报文编辑器中的第一个编辑单元,编辑单元b为第二个编辑单元,编辑单元c为第三个编辑单元。当第一编辑单元为编辑单元a时,MUX模块可以将编辑单元c作为第二编辑单元。也就是说,编辑单元a处理完报文之后,会将处理后的报文发送至编辑单元c。Exemplarily, the message editor includes an editing unit a, an editing unit b, and an editing unit c that are arranged in sequence. Editing unit a is the first editing unit in the message editor, editing unit b is the second editing unit, and editing unit c is the third editing unit. When the first editing unit is the editing unit a, the MUX module may use the editing unit c as the second editing unit. That is to say, after the editing unit a has processed the message, it will send the processed message to the editing unit c.
这样一来,在第一编辑单元处理完报文之后,第一编辑单元可以将该报文发送至当前命令序列中的第一编辑命令所对应的编辑单元(即第二编辑单元),由第二编辑单元编辑该报文。可以避免报文经过多个不需要编辑该报文的编辑单元,减少了传输报文的时间,提高了报文编辑器编辑报文的速率。In this way, after the first editing unit processes the message, the first editing unit can send the message to the editing unit (ie, the second editing unit) corresponding to the first editing command in the current command sequence, and the The second editing unit edits the message. The message can be prevented from passing through a plurality of editing units that do not need to edit the message, thereby reducing the time for transmitting the message and improving the speed of the message editor for editing the message.
第二方面,本申请提供一种编辑报文的装置。该编辑报文的装置包括:接收模块、处理模块和发送模块。In a second aspect, the present application provides an apparatus for editing a message. The device for editing a message includes a receiving module, a processing module and a sending module.
接收模块,用于接收第一报文,第一报文包括第一命令序列和第一数据净荷,第一命令序列包括按照第一预设顺序排列的多个编辑命令,第一命令序列包含于第一报文的头部。a receiving module, configured to receive a first message, where the first message includes a first command sequence and a first data payload, the first command sequence includes a plurality of editing commands arranged in a first preset order, and the first command sequence includes in the header of the first packet.
处理模块,用于若第一编辑单元的标识与第一编辑命令的标识相同,则从第一命令序列中截取第一编辑命令,并根据第一编辑命令编辑第一数据净荷,得到第二报文;其中,第一编辑命令是第一命令序列中的第一个编辑命令,第二报文包括截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷。The processing module is configured to intercept the first editing command from the first command sequence if the identification of the first editing unit is the same as the identification of the first editing command, and edit the first data payload according to the first editing command to obtain the second editing command. message; wherein the first editing command is the first editing command in the first command sequence, and the second message includes the first command sequence after intercepting the first editing command and the edited first data payload.
发送模块,用于向第二编辑单元发送第二报文,由第二编辑单元处理第二报文。The sending module is used for sending the second message to the second editing unit, and the second editing unit processes the second message.
结合第二方面,在一种可能的设计中,接收模块,还用于接收第三报文,第三报文包括第二命令序列和第二数据净荷,第二命令序列包括按照第二预设顺序排列的多个编辑命令,第二命令序列包含于第三报文的头部。处理模块,还用于若第一编辑单元的标识与第二编辑命令的标识相同,第一编辑单元则从第二命令序列中截取第二编辑命令,并根据第二编辑命令编辑第二数据净荷,得到第四报文;其中,第二编辑命令是第二命令序列中的第一个编辑命令,第四报文包括截取第二编辑命令之后的第二命令序列和编辑后的第二数据净荷。发送模块,还用于向第二编辑单元发送第四报文,由第二编辑单元处理第四报文。In combination with the second aspect, in a possible design, the receiving module is further configured to receive a third packet, where the third packet includes a second command sequence and a second data payload, and the second command sequence includes Assuming that multiple editing commands are arranged in sequence, the second command sequence is included in the header of the third packet. The processing module is further configured to, if the identifier of the first editing unit is the same as the identifier of the second editing command, the first editing unit intercepts the second editing command from the second command sequence, and edits the second data net according to the second editing command. load to obtain a fourth message; wherein, the second editing command is the first editing command in the second command sequence, and the fourth message includes the second command sequence after intercepting the second editing command and the edited second data payload. The sending module is further configured to send a fourth message to the second editing unit, and the second editing unit processes the fourth message.
结合第二方面,在另一种可能的设计中,接收模块,具体用于接收来自多个编辑单元中第三编辑单元的第一报文,第一报文是第三编辑单元处理后的报文;或者,接收模块,还具体用于接收来自报文编辑器的上游器件的第一报文。In combination with the second aspect, in another possible design, the receiving module is specifically configured to receive a first message from a third editing unit in the plurality of editing units, where the first message is a message processed by the third editing unit. or, the receiving module is further specifically configured to receive the first message from the upstream device of the message editor.
结合第二方面,在另一种可能的设计中,发送模块,还用于若第一编辑单元的标识与第一编辑命令的标识不同,第一编辑单元向第二编辑单元透传第一报文,由第二编辑单元处理第一报文。In conjunction with the second aspect, in another possible design, the sending module is also used to transparently transmit the first report to the second editing unit if the identification of the first editing unit is different from the identification of the first editing command. message, the first message is processed by the second editing unit.
结合第二方面,在另一种可能的设计中,第二编辑单元是多个编辑单元中、预先设定的第一编辑单元的下一个编辑单元;或者,第一编辑单元还包括MUX模块,第二编辑单元为MUX模块指定的、第一编辑单元的下一个编辑单元。In combination with the second aspect, in another possible design, the second editing unit is the next editing unit of the preset first editing unit among the multiple editing units; or, the first editing unit further includes a MUX module, The second editing unit is designated by the MUX module and is the next editing unit of the first editing unit.
第三方面,本申请提供一种报文编辑器,该报文编辑器包括多个编辑单元,该报文编辑器可以执行如第一方面及其任一种可能的设计方式所述的方法。In a third aspect, the present application provides a message editor, where the message editor includes a plurality of editing units, and the message editor can execute the method described in the first aspect and any possible design manners thereof.
第四方面,本申请提供一种芯片系统,该芯片系统应用于编辑报文的装置。该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。该接口电路用于编辑报文的装置的存储器接收信号,并向处理器发送该信号,该信号包括存储器中存储的计算机指令。当处理器执行所述计算机指令时,编辑报文的装置执行如第一方面及其任一种可能的设计方式所述的方法。In a fourth aspect, the present application provides a chip system, which is applied to an apparatus for editing a message. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by wires. The memory of the device for editing the message by the interface circuit receives the signal and sends the signal to the processor, the signal including the computer instructions stored in the memory. When the processor executes the computer instructions, the apparatus for editing a message executes the method described in the first aspect and any possible design manners thereof.
第五方面,本申请提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在编辑报文的装置上运行时,使得所述编辑报文的装置执行如第一方面及其任一种可能的设计方式所述的方法。In a fifth aspect, the present application provides a computer storage medium, the computer storage medium comprising computer instructions, when the computer instructions are executed on an apparatus for editing a message, the apparatus for editing a message is made to perform the first aspect and any of its possible design methods.
第六方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面及其任一种可能的设计方式所述的方法。In a sixth aspect, the present application provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the method described in the first aspect and any possible design manners thereof.
可以理解地,上述提供的第二方面及其任一种可能的设计方式所述的编辑报文的装置,第三方面所述的报文编辑器,第四方面所述的芯片系统,第五方面所述的计算机存储介质,第六方面所述的计算机程序产品所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the device for editing a message described in the second aspect and any possible design methods provided above, the message editor described in the third aspect, the chip system described in the fourth aspect, the fifth aspect For the beneficial effects that can be achieved by the computer storage medium described in the aspect and the computer program product described in the sixth aspect, reference may be made to the beneficial effects in the first aspect and any possible design manners thereof, which will not be repeated here.
附图说明Description of drawings
图1A为本申请实施例提供的一种通信系统架构的组成示意图;FIG. 1A is a schematic diagram of the composition of a communication system architecture provided by an embodiment of the present application;
图1B为本申请实施例提供的一种报文编辑器的结构示意图;1B is a schematic structural diagram of a message editor provided by an embodiment of the present application;
图1C为本申请实施例提供的一种通信系统架构的组成示意图;FIG. 1C is a schematic composition diagram of a communication system architecture provided by an embodiment of the present application;
图2为本申请实施例提供的一种报文的数据结构示意图;2 is a schematic diagram of a data structure of a message provided by an embodiment of the present application;
图3为本申请实施例提供的一种编辑报文的方法流程图;3 is a flowchart of a method for editing a message provided by an embodiment of the present application;
图4为本申请实施例提供的一种报文数据结构的实例示意图;4 is a schematic diagram of an example of a message data structure provided by an embodiment of the present application;
图5为本申请实施例提供的另一种报文数据结构的实例示意图;5 is a schematic diagram of an example of another message data structure provided by an embodiment of the present application;
图6为本申请实施例提供的一种编辑单元的结构示意图;6 is a schematic structural diagram of an editing unit provided by an embodiment of the present application;
图7为本申请实施例提供的另一种报文编辑器的结构示意图;7 is a schematic structural diagram of another message editor provided by an embodiment of the present application;
图8为本申请实施例提供的另一种编辑报文的方法流程图;8 is a flowchart of another method for editing a message provided by an embodiment of the present application;
图9为本申请实施例提供的另一种报文编辑器的结构示意图;9 is a schematic structural diagram of another message editor provided by an embodiment of the present application;
图10为本申请实施例提供的一种编辑报文的实例示意图;10 is a schematic diagram of an example of editing a message provided by an embodiment of the present application;
图11为本申请实施例提供的一种编辑报文的装置的组成示意图;11 is a schematic diagram of the composition of an apparatus for editing a message provided by an embodiment of the present application;
图12为本申请实施例提供的一种芯片系统的结构组成示意图。FIG. 12 is a schematic structural composition diagram of a chip system provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
本申请中字符“/”,一般表示前后关联对象是一种“或者”的关系。例如,A/B可以理解为A或者B。In this application, the character "/" generally indicates that the related objects before and after are an "or" relationship. For example, A/B can be understood as A or B.
术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个” 的含义是两个或两个以上。The terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
此外,本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是可选地还包括其他没有列出的步骤或模块,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。Furthermore, references to the terms "comprising" and "having" in the description of this application, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally also include other unlisted steps or modules, or optionally also Other steps or modules inherent to these processes, methods, products or devices are included.
另外,在本申请实施例中,“示例性的”、或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、或者“例如”等词旨在以具体方式呈现概念。In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations. Any embodiment or design described in this application as "exemplary" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, use of words such as "exemplary" or "such as" is intended to present concepts in a specific manner.
随着科技的进步,许多业务(例如自动驾驶、金融交易等)对网络时延和带宽的要求越来越高。其中,在运行业务的过程中,报文编辑器编辑业务的报文的速率,可以影响业务的网络时延和带宽。With the advancement of technology, many services (such as autonomous driving, financial transactions, etc.) have higher and higher requirements for network latency and bandwidth. Wherein, in the process of running the service, the rate at which the packet editor edits the service packets can affect the network delay and bandwidth of the service.
在一些解决方案中,报文编辑器中存在一个编辑单元。可以多次调用该编辑单元串行执行一条报文中的多个编辑命令,以完成对报文的编辑。报文编辑器编辑报文的最大包率(每秒编辑报文的速率)可以通过以下公式估算:In some solutions, an editing unit exists in the message editor. The editing unit can be called multiple times to execute multiple editing commands in a message serially to complete the editing of the message. The maximum packet rate (the rate of editing packets per second) of the packet editor can be estimated by the following formula:
Figure PCTCN2020132850-appb-000001
Figure PCTCN2020132850-appb-000001
其中,ClockFrequency表示编辑器工作的时钟频率,以GHz为单位。M表示编辑单元执行单条编辑命令需要的时钟周期数量。N表示调用编辑单元的次数。TotalPktLen表示报文长度,包括微码生成的NHP和PA写入的ORG PKT的总长度。BusWidth为编辑总线位宽。Celling(TotalPktLen/BusWidth,1)表示待编辑报文占用的总线拍数。Among them, ClockFrequency represents the clock frequency at which the editor works, in GHz. M represents the number of clock cycles required by the editing unit to execute a single editing command. N represents the number of times the editing unit is called. TotalPktLen indicates the length of the message, including the total length of the NHP generated by the microcode and the ORG PKT written by the PA. BusWidth is the edit bus bit width. Celling(TotalPktLen/BusWidth, 1) indicates the number of bus beats occupied by the message to be edited.
然而,上述方案中,报文编辑器中的一个编辑单元必须对一条报文进行多次编辑之后,才可以开始编辑下一个报文。也就是说,当存在两条报文需要编辑时,报文编辑器只能串行编辑每一条报文,即只能在编辑完一条报文后,再编辑另一条报文,编辑报文的速率较低。However, in the above solution, an editing unit in the message editor must edit a message multiple times before starting to edit the next message. That is to say, when there are two messages that need to be edited, the message editor can only edit each message serially, that is, after editing one message, edit another message and edit the rate is lower.
为此,本申请实施例提供一种编辑报文的方法。该方法中,报文编辑器包括多个编辑单元,多个编辑单元包括第一编辑单元和第二编辑单元。第一编辑单元可以接收第一报文,并对该第一报文进行编辑,得到第二报文。之后,第一编辑单元向第二编辑单元发送第二报文,由第二编辑单元编辑第二报文。To this end, an embodiment of the present application provides a method for editing a message. In this method, the message editor includes multiple editing units, and the multiple editing units include a first editing unit and a second editing unit. The first editing unit may receive the first message, and edit the first message to obtain the second message. After that, the first editing unit sends the second message to the second editing unit, and the second editing unit edits the second message.
这样一来,由于第一编辑单元在编辑第一报文之后,将得到的第二编辑报文发送至第二编辑单元。因此,第一编辑单元此时处于空闲状态。因此,在第一编辑单元将第二报文发送至第二编辑单元之后,第一编辑单元可以在第二编辑单元处理第二报文时,编辑接收到的新的报文。这样一来,报文编辑器可以同时编辑多条报文,从而提高编辑报文的速率。本申请实施例提供的编辑报文的方法可以应用于报文编辑器编辑报文的过程中。In this way, after editing the first message, the first editing unit sends the obtained second editing message to the second editing unit. Therefore, the first editing unit is in an idle state at this time. Therefore, after the first editing unit sends the second message to the second editing unit, the first editing unit can edit the received new message when the second editing unit processes the second message. In this way, the message editor can edit multiple messages at the same time, thereby increasing the speed of editing messages. The method for editing a message provided by the embodiment of the present application can be applied to a process of editing a message by a message editor.
在一些实施例中,本申请实施例提供的方案可以应用于智能网卡芯片处理主机与网络设备之间的数据的应用场景。在该应用场景中,智能网卡芯片的一侧连接主机(Host),智能网卡芯片的另一侧连接网络设备(Network)。示例性的,如图1A所示,智能网卡芯片的一侧通过高速串行计算机扩展总线(Peripheral Component Interface  Express,PCIE)/直接存储器访问(Direct Memory Access,DMA)连接主机,智能网卡芯片的另一侧通过介质访问控制(Media Access Control,MAC)连接网络设备。下面对图1A所示的智能网卡芯片的功能模块进行介绍。In some embodiments, the solutions provided in the embodiments of the present application may be applied to an application scenario in which a smart network card chip processes data between a host and a network device. In this application scenario, one side of the smart network card chip is connected to a host (Host), and the other side of the smart network card chip is connected to a network device (Network). Exemplarily, as shown in Figure 1A, one side of the smart network card chip is connected to the host through a high-speed serial computer expansion bus (Peripheral Component Interface Express, PCIE)/Direct Memory Access (Direct Memory Access, DMA), and the other side of the smart network card chip is connected to the host. One side connects network devices through Media Access Control (MAC). The functional modules of the smart network card chip shown in FIG. 1A are introduced below.
PCIE/DMA模块,可以用于接收和发送智能网卡芯片和主机之间的数据。The PCIE/DMA module can be used to receive and send data between the smart network card chip and the host.
MAC模块,可以用于接收和发送智能网卡芯片和网络设备之间的数据。The MAC module can be used to receive and send data between the smart network card chip and network devices.
报文分析器(Packet Analyzer,PA)0可以用于接收MAC模块从网络设备接收到的报文(以下可以称为原始报文),并对报文进行类型解析,完成部分协议校验以及处理等。PA1可以用于接收PCIE/DMA模块从网络设备侧接收到的报文(以下可以称为原始报文),对原始报文进行类型解析,完成部分协议校验以及处理等。并且,PA0和PA1可以向DBM发送解析结果、校验结果和原始报文。Packet Analyzer (PA) 0 can be used to receive the packets (hereinafter referred to as original packets) received by the MAC module from the network device, perform type analysis on the packets, and complete part of the protocol verification and processing. Wait. The PA1 can be used to receive the message (hereinafter referred to as the original message) received by the PCIE/DMA module from the network device side, perform type analysis on the original message, and complete part of the protocol verification and processing. Moreover, PA0 and PA1 can send the parsing result, the verification result and the original message to the DBM.
DBM包括报文缓存,用于负责存储原始报文和编辑命令。具体的,DBM在接收到PA0和PA1发送的解析结果、校验结果和原始报文之后,可以将原始报文存入随机存取存储器(Random Access Memory,RAM)中,并将原始报文的指针以及描述信息送给报文调度器(Ingress Scheduler,ISCH)。并且,DBM还可以接收来自ISCH的请求,并将报文头(包括编辑命令)和解析结果发送至微码(Processor Unit,PU)/(Microcode)。然后,DBM可以接收PU/Microcode的请求,将报文的编辑命令存储到RAM中。接着,DBM可以接收输出报文调度器(Egress Scheduler,ESCH)的请求,按照报文编辑器(Packet Editor,PE)要求的报文的数据结构将原始报文的编辑命令和原始报文拼接为待编辑报文,并将待编辑报文发送至PE0/PE1。DBM includes a message cache, which is responsible for storing original messages and editing commands. Specifically, after receiving the parsing result, verification result and original message sent by PA0 and PA1, DBM can store the original message in a random access memory (Random Access Memory, RAM), and store the original message in a random access memory (RAM). The pointer and description information are sent to the message scheduler (Ingress Scheduler, ISCH). In addition, the DBM can also receive the request from the ISCH, and send the message header (including the editing command) and the parsing result to the microcode (Processor Unit, PU)/(Microcode). Then, DBM can receive the request of PU/Microcode and store the editing command of the message in RAM. Next, the DBM can receive the request of the output packet scheduler (Egress Scheduler, ESCH), and splices the editing command of the original packet and the original packet according to the packet data structure required by the packet editor (Packet Editor, PE) as The message to be edited is sent to PE0/PE1.
ISCH用于管理处理器资源,并基于端口及优先级等对原始报文进行排序。之后,ISCH根据预设调度算法将原始报文调度给微码。并且,ISCH向DBM发送通知消息,使DBM向微码发送报文头和解析结果。ISCH is used to manage processor resources and sort raw packets based on ports and priorities. After that, the ISCH schedules the original message to the microcode according to the preset scheduling algorithm. In addition, the ISCH sends a notification message to the DBM, so that the DBM sends the message header and the parsing result to the microcode.
PU/Microcode是由多个线程组成的处理器单元。该处理器单元中运行微码,该微码用于处理多种协议报文。微码具体用于根据协议分析原始报文,处理原始报文,以生成原始报文的编辑命令,并调整编辑命令的排列顺序。并且,微码可以向DBM发起请求,将编辑命令存入DMB中等。PU/Microcode is a processor unit consisting of multiple threads. The processor unit runs microcode for processing various protocol messages. The microcode is specifically used to analyze the original packet according to the protocol, process the original packet, generate an editing command of the original packet, and adjust the arrangement order of the editing command. Also, the microcode can initiate a request to the DBM to store the editing commands in the DMB, etc.
ESCH可以基于端口及优先级对待编辑报文进行排序,并根据预设调度算法调度待编辑报文。之后,ESCH将调度结果发送至DBM。ESCH can sort the to-be-edited packets based on ports and priorities, and schedule the to-be-edited packets according to a preset scheduling algorithm. After that, ESCH sends the scheduling result to DBM.
PE0/PE1负责编辑待编辑报文。PE0/PE1 is responsible for editing the message to be edited.
具体的,PE1负责编辑发送至网络设备的待编辑报文,并将编辑完成的报文发送至MAC。PE0负责编辑发送至主机侧的待编辑报文,并将编辑完成的报文发送至PCIE/DMA。PE0/PE1包括多个编辑单元,Specifically, PE1 is responsible for editing the message to be edited sent to the network device, and sending the edited message to the MAC. PE0 is responsible for editing the message to be edited sent to the host side, and sending the edited message to PCIE/DMA. PE0/PE1 includes multiple editing units,
示例性的,如图1B所示,PE包括报文分离(CMD PKT Separator,CPS)模块、多个报文编辑单元(Packet Editor Unit,PEU)。示例性的,多个PEU包括:PEU1、PEU2、PEU3和PEU4。Exemplarily, as shown in FIG. 1B , the PE includes a packet separation (CMD PKT Separator, CPS) module and a plurality of packet editor units (Packet Editor Unit, PEU). Exemplarily, the plurality of PEUs include: PEU1, PEU2, PEU3 and PEU4.
其中,CPS模块用于解析待编辑报文,将待编辑报文分成编辑命令和数据净荷。每个PEU用于完成待编辑报文中的1条编辑命令。多个PEU中可能存在部分PEU的功能类型相同,也可能多个PEU的功能类型均不相同,本申请实施例对此不作限定。例如,PEU1和PEU2可以执行添加/删除/替换命令(HDR_CMD),则PEU1和PEU2 为具有添加/删除/替换数据功能的编辑单元;PEU3可以执行计算并替换TCP TIMESTAMP的命令(TTS_CMD),则PEU3为具有计算并替换TCP TIMESTAMP功能的编辑单元;PEU4可以执行计算添加CRC32的命令(CRC32_CMD),则PEU4为具有计算添加CRC32功能的编辑单元。或者,PEU1、PEU2、PEU3和PEU4均为具有添加/删除/替换数据功能的编辑单元。The CPS module is used to parse the message to be edited, and divide the message to be edited into editing commands and data payloads. Each PEU is used to complete one edit command in the message to be edited. Among the multiple PEUs, some PEUs may have the same function type, or multiple PEUs may have different function types, which are not limited in this embodiment of the present application. For example, PEU1 and PEU2 can execute add/delete/replace commands (HDR_CMD), then PEU1 and PEU2 are editing units with add/delete/replace data functions; PEU3 can execute commands to calculate and replace TCP TIMESTAMP (TTS_CMD), then PEU3 It is an editing unit with the function of calculating and replacing TCP TIMESTAMP; PEU4 can execute the command to calculate and add CRC32 (CRC32_CMD), then PEU4 is an editing unit with the function of calculating and adding CRC32. Alternatively, PEU1, PEU2, PEU3, and PEU4 are all editing units with functions to add/delete/replace data.
需要说明的是,图1B所示的报文编辑器编辑报文的最大包率(每秒编辑报文的速率)可以通过以下公式估算:It should be noted that, the maximum packet rate (the rate of editing packets per second) of the packet editor shown in FIG. 1B can be estimated by the following formula:
Figure PCTCN2020132850-appb-000002
Figure PCTCN2020132850-appb-000002
其中,ClockFrequency表示编辑器工作的时钟频率,以GHz为单位。TotalCmdLen表示编辑命令的总长度,包括4B PKT_CMD_HDR,PE_CMD和DMA_CMD的长度。TotalPktLen表示报文长度,包括微码生成的NHP和PA写入的ORG PKT的总长度。BusWidth为编辑总线位宽。Celling(TotalCmdLen/BusWidth,1)表示编辑命令占用的总线拍数。Celling(TotalPktLen/BusWidth,1)表示待编辑报文占用的总线拍数。Among them, ClockFrequency represents the clock frequency at which the editor works, in GHz. TotalCmdLen indicates the total length of editing commands, including the length of 4B PKT_CMD_HDR, PE_CMD and DMA_CMD. TotalPktLen indicates the length of the message, including the total length of the NHP generated by the microcode and the ORG PKT written by the PA. BusWidth is the edit bus bit width. Celling(TotalCmdLen/BusWidth, 1) indicates the number of bus beats occupied by editing commands. Celling(TotalPktLen/BusWidth, 1) indicates the number of bus beats occupied by the message to be edited.
在本申请实施例中,报文编辑器中的多个编辑单元的顺序,由开发人员根据业务场景进行预先设定。In the embodiment of the present application, the sequence of the multiple editing units in the message editor is preset by the developer according to the business scenario.
在另一些实施例中,本申请实施例提供的方案还可以应用于网络处理器芯片处理网络设备与网络设备之间的数据的应用场景。在该应用场景中,智能网卡芯片的两侧均连接一个网络设备。两侧的网络设备可以是同一类型的网络设备,也可以是不同类型的网络设备,本申请实施例对此不作限定。In other embodiments, the solutions provided in the embodiments of the present application may also be applied to an application scenario in which a network processor chip processes data between a network device and a network device. In this application scenario, both sides of the smart network card chip are connected to a network device. The network devices on both sides may be the same type of network devices, or may be different types of network devices, which are not limited in this embodiment of the present application.
例如,如图1C所示,智能网卡芯片的一侧通过PCIE/DMA连接Network A,智能网卡芯片的另一侧通过MAC连接Network B。具体对于图1B所述的功能模块的介绍,可以参考上述对图1A中的功能模块的介绍,此处不予赘述。For example, as shown in Figure 1C, one side of the smart network card chip is connected to Network A through PCIE/DMA, and the other side of the smart network card chip is connected to Network B through MAC. For the specific introduction of the functional modules shown in FIG. 1B , reference may be made to the above-mentioned introduction to the functional modules in FIG. 1A , which will not be repeated here.
需要说明的是,以上智能网卡芯片处理主机与网络设备之间的数据的应用场景、网络处理器芯片处理网络设备与网络设备之间的数据的应用场景,只是对本申请实施例的应用场景进行举例说明,本申请实施例对此不作限定。It should be noted that the application scenarios in which the smart network card chip processes data between the host and the network device and the application scenarios in which the network processor chip processes data between the network device and the network device are only examples of the application scenarios in the embodiments of the present application. It is noted that this embodiment of the present application does not limit this.
本申请实施例中的网络设备和主机可以是平板电脑、手机、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、车载设备等设备,本申请实施例对网络设备和主机的具体形态不作特殊限制。The network devices and hosts in the embodiments of the present application may be tablet computers, mobile phones, desktops, laptops, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, and cellular phones, Personal digital assistant (personal digital assistant, PDA), augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) equipment, in-vehicle equipment and other equipment, the embodiment of this application does not make special restrictions on the specific form of the network equipment and the host .
本申请提供的编辑报文的方法的执行主体可以为编辑报文的装置,该执行装置可以为图1B所示的报文编辑器。同时,该执行装置还可以为该报文编辑器的中央处理器(Central Processing Unit,CPU),或者该报文编辑器中的用于编辑报文的编辑单元。本申请实施例中以编辑单元执行编辑报文的方法为例,说明本申请实施例提供的编辑报文的方法。The execution body of the method for editing a message provided by the present application may be a device for editing a message, and the executing device may be the message editor shown in FIG. 1B . Meanwhile, the execution device may also be a central processing unit (Central Processing Unit, CPU) of the message editor, or an editing unit in the message editor for editing messages. In the embodiment of the present application, the method for editing a message by an editing unit is taken as an example to describe the method for editing a message provided by the embodiment of the present application.
在介绍本申请实施例的方法之前,先对本申请实施例提供的待编辑报文(例如第一报文、第二报文等)的数据结构进行介绍。Before introducing the method of the embodiment of the present application, the data structure of the to-be-edited packet (for example, the first packet, the second packet, etc.) provided by the embodiment of the present application is first introduced.
具体的,如图2所示,待编辑报文包括:PE命令长度PE_CMD_LEN、DMA命令 长度DMA_CMD_LEN、RSV(Reserve,RSV,保留字段,用于4字节对齐或者将来扩展)、PE命令PE CMDs(PE CMD 1、PE CMD 2、PE CMD 3、…、PE CMD n)、DMA CMD、新的报文头/数据净荷(New HDR and/or Payload,NHP)、原始数据净荷(Original packet,ORG PKT)。其中,PE_CMD_LEN、DMA_CMD_LEN、RSV、PE CMDs、DMA CMD、NHP是由微码写入DBM中的;ORG PKT是由PA写入DBM中的。Specifically, as shown in Figure 2, the message to be edited includes: PE command length PE_CMD_LEN, DMA command length DMA_CMD_LEN, RSV (Reserve, RSV, reserved field, used for 4-byte alignment or future expansion), PE command PE CMDs ( PE CMD 1, PE CMD 2, PE CMD 3, ..., PE CMD n), DMA CMD, new header/data payload (New HDR and/or Payload, NHP), original data payload (Original packet, ORG PKT). Among them, PE_CMD_LEN, DMA_CMD_LEN, RSV, PE CMDs, DMA CMD, NHP are written into DBM by microcode; ORG PKT is written into DBM by PA.
例如,请参考表1,其示出针对待编辑报文的数据结构的说明。For example, please refer to Table 1, which shows a description of the data structure of the message to be edited.
表1Table 1
Figure PCTCN2020132850-appb-000003
Figure PCTCN2020132850-appb-000003
需要说明的是,PE CMD1、PE CMD2、…、PE CMDn可能为具有相同功能类型 的编辑命令,也可能为具有不同功能类型的编辑命令,本申请实施例对此不作限定。每一个编辑命令具有一个唯一标识(OPCODE,OPCD)。该标识用于指示编辑命令的功能类型。It should be noted that PE CMD1, PE CMD2, . Each editing command has a unique identifier (OPCODE, OPCD). This flag is used to indicate the function type of the edit command.
例如,请参考表2,其示出了HDR_CMD的说明。For example, please refer to Table 2, which shows the description of HDR_CMD.
表2Table 2
Figure PCTCN2020132850-appb-000004
Figure PCTCN2020132850-appb-000004
由表2可以得出,OPCD=4'h2时,编辑命令为HDR_CMD;HDR_CMD是变长命令,CMD_LEN指示该HDR_CMD的总长度,ILEN指示变长的IDAT的长度。又例如,当编辑命令的OPCD=0x8时,该编辑命令为TTS CMD。又例如,当编辑命令的OPCD=4'h6时,该编辑命令为CRC32CMD。具体对于编辑命令与OPCD的对应关系的介绍,可以参考现有技术或者HDR_CMD,此处不予赘述。It can be concluded from Table 2 that when OPCD=4'h2, the editing command is HDR_CMD; HDR_CMD is a variable-length command, CMD_LEN indicates the total length of the HDR_CMD, and ILEN indicates the length of the variable-length IDAT. For another example, when the OPCD of the edit command=0x8, the edit command is TTS CMD. For another example, when the OPCD of the edit command=4'h6, the edit command is CRC32CMD. For the introduction of the corresponding relationship between the editing command and the OPCD, reference may be made to the prior art or HDR_CMD, which will not be repeated here.
下面对本申请实施例的方法进行说明。本申请实施例提供一种编辑报文的方法,如图3所示,该编辑报文的方法可以包括S301-S305。The methods of the embodiments of the present application will be described below. An embodiment of the present application provides a method for editing a message. As shown in FIG. 3 , the method for editing a message may include S301-S305.
S301、第一编辑单元接收第一报文。S301. A first editing unit receives a first message.
其中,第一报文包括第一命令序列和第一数据净荷,第一命令序列包含于第一报文的头部。第一报文还包括第一命令序列头。示例性的,结合图2,假如图2所示的 报文的数据结构为第一报文的数据结构,则图2所示的PE_CMD_LEN、DMA_CMD_LEN、RSV为第一命令序列头,PE CMDs(例如PE CMD1、PE CMD2、PE CMD3、……PE CMDn)为第一命令序列,NHP、ORG PKT为第一数据净荷。具体对于第一命令序列、第一命令序列头和第一数据净荷的介绍,可以参考上述对图2的说明,此处不予赘述。The first packet includes a first command sequence and a first data payload, and the first command sequence is included in the header of the first packet. The first message also includes a first command sequence header. Exemplarily, in conjunction with Fig. 2, if the data structure of the message shown in Fig. 2 is the data structure of the first message, then PE_CMD_LEN, DMA_CMD_LEN, and RSV shown in Fig. 2 are the first command sequence header, and PE CMDs (for example, PE CMD1, PE CMD2, PE CMD3, ... PE CMDn) are the first command sequence, and NHP and ORG PKT are the first data payload. For the introduction of the first command sequence, the first command sequence header, and the first data payload, reference may be made to the above description of FIG. 2 , which will not be repeated here.
在本申请实施例中,第一命令序列包括按照第一预设顺序排列的多个编辑命令。该第一预设顺序用于指示第一命令序列中多个编辑命令排列的先后顺序,与报文编辑器中不同功能类型的编辑单元的先后顺序相同。In this embodiment of the present application, the first command sequence includes a plurality of editing commands arranged in a first preset order. The first preset sequence is used to indicate the sequence of the arrangement of multiple editing commands in the first command sequence, which is the same as the sequence of editing units of different function types in the message editor.
示例性的,结合图1B,假如报文编辑器中包括依次排列的添加/删除/替换单元(即图1B中的PEU1)、计算并替换TCP TIMESTAMP单元(即图1B中的PEU3)和计算并添加CRC32单元(即图1B中的PEU4),即添加/删除/替换编辑单元为报文编辑器中的第一个编辑单元。假如第一报文序列包括添加/删除/替换命令、计算并添加CRC32命令和计算并替换TCP TIMESTAMP命令,微码则可以将第一报文序列中的多个编辑命令的排序调整为添加/删除/替换命令、计算并替换TCP TIMESTAMP命令和计算并添加CRC32命令。例如,结合图2,第一报文序列包括按照第一预设顺序排列的添加/删除/替换命令(即图2中的PE CMD1)、计算并替换TCP TIMESTAMP命令(即图2中的PE CMD2)、计算并添加CRC32命令(即图2中的PE CMD3)。Exemplarily, in conjunction with Fig. 1B, if the message editor includes sequentially arranged add/delete/replace units (that is, PEU1 in Fig. 1B ), calculate and replace the TCP TIMESTAMP unit (that is, PEU3 in Fig. 1B ), and calculate and merge Adding a CRC32 unit (ie, PEU4 in FIG. 1B ), that is, adding/deleting/replacing an editing unit, is the first editing unit in the message editor. If the first packet sequence includes add/delete/replace commands, calculate and add CRC32 commands, and calculate and replace TCP TIMESTAMP commands, the microcode can adjust the ordering of multiple edit commands in the first packet sequence to add/delete /Replace command, Calculate and replace TCP TIMESTAMP command and Calculate and add CRC32 command. For example, in conjunction with Fig. 2, the first packet sequence includes add/delete/replace commands (ie, PE CMD1 in Fig. 2 ) arranged in a first preset order, calculate and replace the TCP TIMESTAMP command (ie, PE CMD2 in Fig. 2 ) ), calculate and add the CRC32 command (ie PE CMD3 in Figure 2).
可以理解的是,由于编辑单元只可以截取位于命令序列头部的编辑命令。因此,将第一命令序列中多个编辑命令按照报文编辑器中不同功能类型的编辑单元的先后顺序进行排序,可以使报文编辑器执行第一命令序列中的每个编辑命令,从而保障报文编辑器完成对报文的编辑。It can be understood that, since the editing unit can only intercept the editing command located at the head of the command sequence. Therefore, sorting the multiple editing commands in the first command sequence according to the order of editing units of different functional types in the message editor enables the message editor to execute each editing command in the first command sequence, thereby ensuring that The message editor completes the editing of the message.
在一些实施例中,第一编辑单元可以接收来自多个编辑单元中第三编辑单元的第一报文,该第一报文是第三编辑单元处理后的报文。具体的,该第一报文可以是第三编辑单元编辑后的报文,该第一报文也可以是第三编辑单元未编辑的报文,本申请实施例对此不作限定。例如,第三编辑单元在接收到报文a之后,编辑该报文a,得到报文b(即第一报文),并向第一编辑单元发送报文b。又例如,第三编辑单元在接收到报文a之后,未编辑该报文a,而是直接向第一编辑单元发送报文a(即第一报文)。In some embodiments, the first editing unit may receive a first message from a third editing unit of the plurality of editing units, where the first message is a message processed by the third editing unit. Specifically, the first message may be a message edited by the third editing unit, or the first message may be a message that has not been edited by the third editing unit, which is not limited in this embodiment of the present application. For example, after receiving the message a, the third editing unit edits the message a to obtain the message b (ie, the first message), and sends the message b to the first editing unit. For another example, after receiving the message a, the third editing unit does not edit the message a, but directly sends the message a (ie, the first message) to the first editing unit.
在另一些实施例中,第一编辑单元可以接收来自报文编辑器的上游器件的第一报文。若第一编辑单元接收的是来自报文编辑器的上游器件的第一报文,则该第一编辑单元为报文编辑器中的第一个编辑单元,该报文编辑器的上游器件可以为DBM,该第一报文可以为上述DBM按照报文编辑器要求拼接的待编辑报文(原始报文的编辑命令和原始报文)。In other embodiments, the first editing unit may receive the first message from the upstream device of the message editor. If the first editing unit receives the first message from the upstream device of the message editor, the first editing unit is the first editing unit in the message editor, and the upstream device of the message editor can If it is a DBM, the first message may be a message to be edited (an editing command of the original message and the original message) spliced by the above-mentioned DBM according to the requirements of the message editor.
S302、第一检测单元判断第一编辑单元的标识与第一编辑命令的标识是否相同。S302. The first detection unit determines whether the identifier of the first editing unit is the same as the identifier of the first editing command.
其中,第一编辑命令是第一命令序列中的第一个编辑命令。例如,结合图2,假如图2所示的PE CMDs为第一命令序列,则PE CMD1是PE CMDs中的第一个编辑命令。也就是说,PE CMD1为第一编辑命令。Wherein, the first editing command is the first editing command in the first command sequence. For example, in conjunction with FIG. 2, if the PE CMDs shown in FIG. 2 are the first command sequence, then PE CMD1 is the first edit command in the PE CMDs. That is, PE CMD1 is the first edit command.
一种可能的实现方式,第一检测单元判断第一检测单元的OPCD与第一命令序列的前4比特的数据是否相同。若第一编辑单元的标识与第一编辑命令的标识相同,第一编辑单元则可以编辑第一报文。具体的,第一编辑单元可以执行S303。若第一编辑 单元的标识与第一编辑命令的标识不相同,第一编辑单元则不会编辑第一报文。具体的,第一编辑单元可以执行S304。In a possible implementation manner, the first detection unit determines whether the OPCD of the first detection unit is the same as the data of the first 4 bits of the first command sequence. If the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit can edit the first message. Specifically, the first editing unit may execute S303. If the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit will not edit the first message. Specifically, the first editing unit may execute S304.
S303、若第一编辑单元的标识与第一编辑命令的标识相同,第一编辑单元则从第一命令序列中截取第一编辑命令,并根据第一编辑命令编辑第一数据净荷,得到第二报文。S303. If the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit intercepts the first editing command from the first command sequence, and edits the first data payload according to the first editing command to obtain the first editing command. Two messages.
示例性的,假如第一编辑单元的OPCD为4'h2,且第一编辑单元的OPCD为4'h2,第一编辑单元则从第一命令序列中截取第一编辑命令,并根据第一编辑命令编辑第一数据净荷,得到第二报文。Exemplarily, if the OPCD of the first editing unit is 4'h2, and the OPCD of the first editing unit is 4'h2, the first editing unit intercepts the first editing command from the first command sequence, and according to the first editing The command edits the first data payload to obtain the second packet.
在本申请实施例中,第二报文包括截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷。In this embodiment of the present application, the second packet includes the first command sequence after the interception of the first editing command and the edited first data payload.
可以理解的是,在第一编辑单元从第一命令序列中截取第一编辑命令之后,该第一编辑命令对应的编辑命令会发生改变。在第一编辑单元从第一命令序列中截取第一编辑命令之后,该第一编辑命令与第一编辑单元从第一命令序列中截取的编辑命令的下一个编辑命令对应。并且,第一编辑单元可以根据从第一命令序列中截取的第一编辑命令,编辑第一数据净荷。这样一来,在第一编辑单元编辑第一报文之后,第一报文发生改变,即第一编辑单元可以得到截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷。It can be understood that, after the first editing unit intercepts the first editing command from the first command sequence, the editing command corresponding to the first editing command will change. After the first editing unit intercepts the first editing command from the first command sequence, the first editing command corresponds to the next editing command of the editing command intercepted by the first editing unit from the first command sequence. Also, the first editing unit may edit the first data payload according to the first editing command intercepted from the first command sequence. In this way, after the first editing unit edits the first packet, the first packet is changed, that is, the first editing unit can obtain the first command sequence after intercepting the first editing command and the edited first data payload .
以下结合图4和图5,对第一编辑单元编辑第一报文,得到第二报文的过程进行介绍。示例性的,如图4所示,第一命令序列包括:编辑命令a、编辑命令b、编辑命令c和编辑命令d,第一命令序列的第一编辑命令为编辑命令a,第一数据净荷为数据净荷a。若第一编辑单元的标识与编辑命令a的标识相同,第一编辑单元则从第一命令序列中截取编辑命令a,并根据编辑命令a配置第一编辑单元的编辑参数(例如OFFSET、LEN等)。之后,第一编辑单元编辑数据净荷a,得到截取后的命令序列和编辑后的数据净荷。如图5所示,截取后的命令序列包括:编辑命令b、编辑命令c和编辑命令d,截取后的命令序列的第一编辑命令为编辑命令b,数据净荷b为第一编辑单元根据编辑命令a编辑数据净荷a得到的。The following describes the process of editing the first packet by the first editing unit to obtain the second packet with reference to FIG. 4 and FIG. 5 . Exemplarily, as shown in FIG. 4 , the first command sequence includes: editing command a, editing command b, editing command c, and editing command d, the first editing command of the first command sequence is editing command a, and the first data net The payload is the data payload a. If the identifier of the first editing unit is the same as the identifier of the editing command a, the first editing unit intercepts the editing command a from the first command sequence, and configures the editing parameters (eg OFFSET, LEN, etc.) of the first editing unit according to the editing command a ). After that, the first editing unit edits the data payload a to obtain the command sequence after interception and the edited data payload. As shown in Figure 5, the command sequence after interception includes: editing command b, editing command c and editing command d, the first editing command of the command sequence after intercepting is editing command b, and the data payload b is the first editing unit according to Edit command a is obtained by editing the data payload a.
S304、若第一编辑单元的标识与第一编辑命令的标识不相同,第一编辑单元则向第二编辑单元发送第一报文,由第二编辑单元处理第一报文。S304. If the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit sends the first message to the second editing unit, and the second editing unit processes the first message.
示例性的,假如第一编辑单元的OPCD为4'h2,且第一编辑单元的OPCD为4'h8,第一编辑单元则不会编辑第一报文,而是向第二编辑单元发送第一报文,由第二编辑单元处理第一报文。Exemplarily, if the OPCD of the first editing unit is 4'h2 and the OPCD of the first editing unit is 4'h8, the first editing unit will not edit the first message, but will send the first message to the second editing unit. A message, the first message is processed by the second editing unit.
在一些实施例中,第一编辑单元包括多个处理模块,该多个处理模块用于处理接收的报文。第一编辑单元向第二编辑单元发送第一报文时,第一报文可以经过第一编辑单元中的多个处理模块,即第一报文经过完整的第一编辑单元。然而,由于第一编辑单元的标识与第一编辑命令的标识不相同,第一编辑单元并不编辑该第一报文。因此,第一报文经过第一编辑单元中的多个处理模块,会延长第一报文经过第一编辑单元的时间,导致报文编辑器编辑报文的速率降低。In some embodiments, the first editing unit includes a plurality of processing modules for processing the received message. When the first editing unit sends the first message to the second editing unit, the first message may pass through multiple processing modules in the first editing unit, that is, the first message passes through the complete first editing unit. However, since the identification of the first editing unit is different from the identification of the first editing command, the first editing unit does not edit the first message. Therefore, when the first packet passes through the plurality of processing modules in the first editing unit, the time for the first packet to pass through the first editing unit is prolonged, resulting in a decrease in the rate at which the packet editor edits the packet.
为了减少第一报文经过第一编辑单元的时间。第一编辑单元可以在接收到第一报文之后,根据第一报文得到第一编辑单元的状态值集合。该第一编辑单元的状态值集 合用于指示第一报文是否经过完整的第一编辑单元。第一编辑单元可以根据状态值集合,判断第一报文是否经过完整的第一编辑单元。In order to reduce the time for the first packet to pass through the first editing unit. After receiving the first message, the first editing unit may obtain the state value set of the first editing unit according to the first message. The set of state values of the first editing unit is used to indicate whether the first message has passed through the complete first editing unit. The first editing unit may determine whether the first packet has passed through the complete first editing unit according to the state value set.
示例性的,如图6所示,PEU包括:Parser_TTS_CMD模块、CALC_TTS模块、REP_TTS模块和OUTPUT_CTRL模块。状态值集合包括:TTS_CMD_EN、VLD_FF1和VLD_FF2。其中,Parser_TTS_CMD模块用于从命令序列中截取与本编辑单元的标识相同的编辑命令,并将该编辑命令的参数存储下来。当报文经过时,Parser_TTS_CMD模块根据编辑的OFS等产生CALC_TTS模块的编辑请求,并向CALC_TTS模块和REP_TTS模块提供编辑参数。CALC_TTS模块用于计算需要替换到报文中的时间戳(timestamp,TS),然后向REP_TTS模块发送TS。REP_TTS模块在OFS所指示的位置将CALC_TTS模块计算的TS替换至报文HDR中。之后,OUTPUT_CTRL用于输出数据。TTS_CMD_EN用于指示是否需要编辑timestamp,VLD_FF1用于指示CALC_TTS模块是否正在处理数据,VLD_FF2用于指示REP_TTS模块是否正在处理数据。Exemplarily, as shown in FIG. 6 , the PEU includes: a Parser_TTS_CMD module, a CALC_TTS module, a REP_TTS module and an OUTPUT_CTRL module. The set of status values includes: TTS_CMD_EN, VLD_FF1 and VLD_FF2. Among them, the Parser_TTS_CMD module is used to intercept the editing command with the same identification as the editing unit from the command sequence, and store the parameters of the editing command. When the message passes, the Parser_TTS_CMD module generates an editing request for the CALC_TTS module according to the edited OFS, etc., and provides editing parameters to the CALC_TTS module and the REP_TTS module. The CALC_TTS module is used to calculate the timestamp (timestamp, TS) that needs to be replaced in the message, and then sends the TS to the REP_TTS module. The REP_TTS module replaces the TS calculated by the CALC_TTS module into the message HDR at the position indicated by the OFS. After that, OUTPUT_CTRL is used to output data. TTS_CMD_EN is used to indicate whether the timestamp needs to be edited, VLD_FF1 is used to indicate whether the CALC_TTS module is processing data, and VLD_FF2 is used to indicate whether the REP_TTS module is processing data.
若TTS_CMD_EN指示不需要编辑timestamp、VLD_FF1指示CALC_TTS模块未在处理数据(即处于空闲状态)和VLD_FF2指示REP_TTS模块未在处理数据(即处于空闲状态)时,该PUE接收的报文不需要经过Parser_TTS_CMD模块、CALC_TTS模块、REP_TTS模块,可以直接通过OUTPUT_CTRL模块发送至下一个编辑单元。也就是说,若该PEU不需要编辑该报文,且该PEU处于空闲状态时,则该报文不需要完整经过该PEU。If TTS_CMD_EN indicates that the timestamp does not need to be edited, VLD_FF1 indicates that the CALC_TTS module is not processing data (that is, is in an idle state), and VLD_FF2 indicates that the REP_TTS module is not processing data (that is, is in an idle state), the packets received by the PUE do not need to pass through the Parser_TTS_CMD module. , CALC_TTS module, REP_TTS module, can be directly sent to the next editing unit through the OUTPUT_CTRL module. That is, if the PEU does not need to edit the message, and the PEU is in an idle state, the message does not need to pass through the PEU completely.
可以理解的是,通过减少报文经过编辑单元内部的处理模块,可以减少报文经过编辑单元的时间,从而提高报文编辑器编辑报文的速率。It can be understood that by reducing the number of processing modules inside the editing unit, the time for the message to pass through the editing unit can be reduced, thereby increasing the rate at which the message editor edits the message.
若TTS_CMD_EN指示需要编辑timestamp,和/或,VLD_FF1指示CALC_TTS模块正在处理数据,和/或,VLD_FF2指示REP_TTS模块正在处理数据时,该PUE接收的报文需要经过Parser_TTS_CMD模块、CALC_TTS模块、REP_TTS模块和OUTPUT_CTRL模块。也就是说,若该PEU需要编辑该报文,或者该PEU正在处理数据,则该报文需要完整经过该PEU。If TTS_CMD_EN indicates that the timestamp needs to be edited, and/or VLD_FF1 indicates that the CALC_TTS module is processing data, and/or VLD_FF2 indicates that the REP_TTS module is processing data, the packets received by the PUE need to pass through the Parser_TTS_CMD module, CALC_TTS module, REP_TTS module and OUTPUT_CTRL module. That is, if the PEU needs to edit the message, or the PEU is processing data, the message needs to pass through the PEU completely.
可以理解的是,若该PEU需要编辑该报文,则该报文需要经过编辑单元的多个处理模块,使PEU编辑报文。若该PEU正在处理数据,则说明该PEU正在编辑另一条报文。由于报文编辑器是串行编辑报文,即报文编辑器只能依次编辑每一条报文。因此,该报文需要完整经过该编辑单元,从而避免报文编辑器编辑报文的顺序发生错乱。It can be understood that, if the PEU needs to edit the message, the message needs to go through multiple processing modules of the editing unit, so that the PEU edits the message. If the PEU is processing data, it means that the PEU is editing another message. Since the message editor edits messages serially, that is, the message editor can only edit each message in sequence. Therefore, the message needs to pass through the editing unit completely, so as to avoid disorder in the sequence of editing the message by the message editor.
S305、第一编辑单元向第二编辑单元发送第二报文,由第二编辑单元处理第二报文。S305: The first editing unit sends the second message to the second editing unit, and the second editing unit processes the second message.
在一些实施例中,该第二编辑单元可以是多个编辑单元中、预先设定的第一编辑单元的下一个编辑单元。也就是说,在第一编辑单元得到第二报文之后,第一编辑单元可以向与其相邻的下一个编辑单元发送第二报文。例如,结合图1B,假如第一编辑单元为PEU1,则第二编辑单元为PEU2。PEU1可以向PEU2发送报文。又例如,结合图1B,假如第一编辑单元为PEU2,则第二编辑单元为PEU3。PEU2可以向PEU3发送报文。In some embodiments, the second editing unit may be the next editing unit of the preset first editing unit among the plurality of editing units. That is, after the first editing unit obtains the second message, the first editing unit may send the second message to the next editing unit adjacent to it. For example, referring to FIG. 1B, if the first editing unit is PEU1, the second editing unit is PEU2. PEU1 can send packets to PEU2. For another example, referring to FIG. 1B , if the first editing unit is PEU2, the second editing unit is PEU3. PEU2 can send packets to PEU3.
可以理解的是,当该报文编辑器只处理一种业务场景的报文时,由于同一种业务 场景的报文所需要的不同功能类型的编辑单元的数量相似。因此,开发人员可以根据业务场景,合理配置报文编辑器中的多个编辑单元的数量及顺序,减少报文经过的无效编辑单元(不需要对报文进行编辑的编辑单元)的数量,提高报文编辑器编辑报文的速率。It can be understood that when the message editor only processes messages of one service scenario, the number of editing units of different functional types required by the messages of the same service scenario is similar. Therefore, developers can reasonably configure the number and sequence of multiple editing units in the message editor according to business scenarios, reduce the number of invalid editing units (editing units that do not need to edit messages) through which messages pass, and improve The rate at which the packet editor edits packets.
然而,若报文编辑器可以处理多种不同的业务场景的报文,由于不同业务场景的报文所需要的功能类型的编辑单元不同,所需要的不同功能类型的编辑单元的数量也不相同。因此,报文编辑器中可能存在较多不同功能类型的编辑单元,且编辑单元的数量也较多。这样一来,当报文编辑器编辑一条报文时,该报文可能会经过较多的无效编辑单元,导致报文编辑器编辑报文的速率降低。However, if the message editor can process messages of a variety of different business scenarios, the number of required editing units of different functional types is also different because the messages of different business scenarios require different editing units of different functional types. . Therefore, there may be more editing units with different function types in the message editor, and the number of editing units is also larger. In this way, when the message editor edits a message, the message may pass through many invalid editing units, which reduces the rate at which the message editor edits the message.
在另一些实施例,为了减少报文经过的无效编辑单元的数量,提高报文编辑器编辑报文的速率。第一编辑单元可以包括MUX模块,第二编辑单元为MUX模块指定的第一编辑单元的下一个编辑单元。该MUX模块可以向指定的编辑单元发送报文。也就是说,在第一编辑单元得到第二报文之后,第一编辑单元可以向与其不相邻的编辑单元发送第二报文。In other embodiments, in order to reduce the number of invalid editing units that the message passes through, the rate at which the message editor edits the message is increased. The first editing unit may include a MUX module, and the second editing unit is the next editing unit of the first editing unit specified by the MUX module. The MUX module can send messages to the designated editing unit. That is, after the first editing unit obtains the second message, the first editing unit may send the second message to the editing unit that is not adjacent to it.
示例性的,报文编辑器包括多个编辑单元,部分编辑单元可以配置为发送给MUX模块。如图7所示,PE包括:CPS、PEU1、PEU2、PEU3、PEU4、PEU5、PEU6和PEU7。其中,PEU1配置为发送给MUX1,PEU3配置为发送给MUX2。例如,当PEU1为第一编辑单元,PEU1得到第二报文,并通过MUX1向PEU3(即第二编辑单元)发送第二报文。又例如,当PEU3为第一编辑单元,PEU3得到第二报文,并通过MUX2向PEU7(即第二编辑单元)发送第二报文。Exemplarily, the message editor includes a plurality of editing units, and some of the editing units may be configured to be sent to the MUX module. As shown in FIG. 7 , the PEs include: CPS, PEU1, PEU2, PEU3, PEU4, PEU5, PEU6, and PEU7. Among them, PEU1 is configured to be sent to MUX1, and PEU3 is configured to be sent to MUX2. For example, when PEU1 is the first editing unit, PEU1 obtains the second packet, and sends the second packet to PEU3 (ie, the second editing unit) through MUX1. For another example, when PEU3 is the first editing unit, PEU3 obtains the second packet, and sends the second packet to PEU7 (ie, the second editing unit) through MUX2.
需要说明的是,开发人员可以根据报文编辑器需要处理的业务场景的报文,为部分编辑单元配置MUX模块,以及MUX模块所指定的下一个编辑单元(MUX模块的配置);或者,开发人员可以根据报文编辑器需要处理的业务场景的报文,为报文编辑器配置MUX模块(即MUX模块不在编辑单元中),以及MUX模块所指定的下一个编辑单元(MUX模块的配置)。具体对于为哪些编辑单元配置MUX模块,以及MUX模块的配置,本申请实施例对此不作限定。It should be noted that developers can configure the MUX module for some editing units and the next editing unit (configuration of the MUX module) specified by the MUX module according to the message of the business scenario that the message editor needs to process; Personnel can configure the MUX module for the message editor (that is, the MUX module is not in the editing unit) and the next editing unit specified by the MUX module (configuration of the MUX module) according to the message of the business scenario that the message editor needs to process. . Specifically, for which editing units are configured with the MUX module and the configuration of the MUX module, this embodiment of the present application does not limit this.
可以理解的是,通过在编辑单元配置MUX模块,编辑单元就可以向指定的编辑单元发送报文。这样一来,报文编辑器可以控制报文所经过的编辑单元,减少报文经过的无效编辑单元,从而提高报文编辑器编辑报文的速率。It can be understood that by configuring the MUX module in the editing unit, the editing unit can send a message to the designated editing unit. In this way, the message editor can control the editing units that the message passes through, and reduce the invalid editing units that the message passes through, thereby increasing the rate at which the message editor edits the message.
此外,在第一编辑单元向第二编辑单元发送第二报文之后,第二编辑单元可以接收该第二报文。并且,第二编辑单元可以判断第二编辑单元的标识与第二报文中的第一编辑命令的标识是否相同。若第二编辑单元的标识与第二报文中的第一编辑命令的标识相同,第二编辑单元则编辑该第二报文,得到第五报文(可以参考上述S303的介绍,此处不予赘述)。之后,第二编辑单元可以向第四编辑单元发送第五报文,由第四编辑单元处理第五报文。其中,该第四编辑单元是多个编辑单元中、预先设定的第二编辑单元的下一个编辑单元。或者,该第二编辑单元还包括MUX模块,第四编辑单元为MUX模块指定的、第二编辑单元的下一个编辑单元。对于上述过程的具体介绍,可以参考S301-304,此处不予赘述。In addition, after the first editing unit sends the second message to the second editing unit, the second editing unit may receive the second message. Furthermore, the second editing unit may determine whether the identifier of the second editing unit is the same as the identifier of the first editing command in the second message. If the identifier of the second editing unit is the same as the identifier of the first editing command in the second message, the second editing unit edits the second message to obtain a fifth message (refer to the above description of S303, not here to repeat). Afterwards, the second editing unit may send the fifth message to the fourth editing unit, and the fourth editing unit processes the fifth message. Wherein, the fourth editing unit is the next editing unit of the preset second editing unit among the plurality of editing units. Alternatively, the second editing unit further includes a MUX module, and the fourth editing unit is the next editing unit of the second editing unit specified by the MUX module. For the specific introduction of the above process, reference may be made to S301-304, which will not be repeated here.
若第二编辑单元的标识与第二报文中的第一编辑命令的标识不相同,第二编辑单 元则不编辑该第二报文,而是向第四编辑单元发送该第二报文,由第四编辑单元处理第二报文。If the identifier of the second editing unit is different from the identifier of the first editing command in the second message, the second editing unit does not edit the second message, but sends the second message to the fourth editing unit, The second message is processed by the fourth editing unit.
可以理解的是,由于报文编辑器包括多个编辑单元。因此,报文编辑器可以通过上述方案,由多个编辑单元串行编辑报文,从而完成对报文的编辑。并且,报文编辑器包括多个编辑单元,且多个编辑单元的功能类型不完全相同,使得报文编辑器编辑多种业务的报文。即多种业务可以复用编辑功能相同的编辑单元。相对于为每一种业务设计一个报文编辑器,本申请实施例的方案能够提高编辑单元的利用率。对芯片而言,可以减芯片的面积和功耗。It is understandable that since the message editor includes a plurality of editing units. Therefore, the message editor can edit the message serially by a plurality of editing units through the above solution, so as to complete the editing of the message. Moreover, the message editor includes multiple editing units, and the functional types of the multiple editing units are not identical, so that the message editor edits messages of various services. That is, multiple services can reuse editing units with the same editing function. Compared with designing a message editor for each service, the solution of the embodiment of the present application can improve the utilization rate of the editing unit. For the chip, the area and power consumption of the chip can be reduced.
基于上述技术方案,在第一编辑单元的标识与第一编辑命令的标识相同的情况下,第一编辑单元只根据第一编辑命令编辑第一报文(第一命令序列和第一数据净荷)。也就是说,多个编辑单元中,多个编辑单元的标识与编辑命令序列中的多个编辑命令的标识存在对应关系。并且,第一编辑单元只需要编辑一次第一报文,无需对第一报文进行多次编辑。之后,第一编辑单元将截取第一编辑命令之后的第一命令序列和编辑后的第一数据净荷(即第二报文)发送至第二编辑单元,由第二编辑单元处理第二报文。Based on the above technical solution, when the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit only edits the first packet (the first command sequence and the first data payload) according to the first editing command ). That is, among the multiple editing units, the identifiers of the multiple editing units have a corresponding relationship with the identifiers of the multiple editing commands in the editing command sequence. Moreover, the first editing unit only needs to edit the first message once, and does not need to edit the first message multiple times. After that, the first editing unit sends the first command sequence after intercepting the first editing command and the edited first data payload (ie, the second message) to the second editing unit, and the second editing unit processes the second message. arts.
本申请中的报文编辑器包括多个编辑单元,该多个编辑单元可以串行编辑一个报文。例如,第一编辑单元编辑完一个报文(如第一报文)后,可将编辑后的报文(如第二报文)发送至第二编辑单元,由第二编辑单元编辑继续编辑该报文。如此,第二报文发送至第二编辑单元后,第一编辑单元便处于空闲状态。此时,第一编辑单元便可以编辑新的报文。这样一来,报文编辑器可以同时编辑多条报文,提高了编辑报文的速率。The message editor in this application includes a plurality of editing units, and the plurality of editing units can edit a message in series. For example, after the first editing unit edits a message (such as the first message), it can send the edited message (such as the second message) to the second editing unit, and the second editing unit edits and continues to edit the message. message. In this way, after the second message is sent to the second editing unit, the first editing unit is in an idle state. At this point, the first editing unit can edit the new message. In this way, the message editor can edit multiple messages at the same time, which improves the speed of editing messages.
例如,在第一编辑单元接收第一报文之后,第一编辑单元还可以接收第三报文,该报文编辑器可以同时编辑第二报文和第三报文。如图8所示,为本申请实施例提供的另一种编辑报文的方法流程图,该编辑报文的方法可以包括S801-S805。For example, after the first editing unit receives the first message, the first editing unit may further receive the third message, and the message editor may edit the second message and the third message at the same time. As shown in FIG. 8 , a flowchart of another method for editing a message provided by an embodiment of the present application, the method for editing a message may include S801-S805.
S801、第一编辑单元接收第三报文。S801. The first editing unit receives a third message.
其中,第三报文包括第二命令序列和第二数据净荷,第二命令序列包括按照第二预设顺序排列的多个编辑命令,第二命令序列包含于第三报文的头部。The third packet includes a second command sequence and a second data payload, the second command sequence includes a plurality of editing commands arranged in a second preset order, and the second command sequence is included in the header of the third packet.
需要说明的是,部分对于S801的介绍,可以参考本申请实施例对S301的描述,此处不予赘述。It should be noted that, for part of the introduction of S801, reference may be made to the description of S301 in this embodiment of the present application, which will not be repeated here.
在一些实施例中,第一编辑单元可以在第一编辑单元接收第一报文之后,第一编辑单元向第二编辑单元发送第一报文/第二报文之前,接收第三报文,并将第三报文放入缓存队列中。In some embodiments, the first editing unit may receive the third message after the first editing unit receives the first message and before the first editing unit sends the first message/second message to the second editing unit, And put the third packet into the buffer queue.
可以理解的是,在第一编辑单元接收第一报文之后,第一编辑单元向第二编辑单元发送第一报文/第二报文之前,由于第一编辑单元正在处理第一报文。因此,第一编辑单元暂时无法处理第三报文。It can be understood that, after the first editing unit receives the first message, before the first editing unit sends the first message/second message to the second editing unit, the first editing unit is processing the first message. Therefore, the first editing unit cannot process the third message temporarily.
在另一些实施例中,在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元可以接收第三报文。In other embodiments, after the first editing unit sends the second message to the second editing unit, the first editing unit may receive the third message.
可以理解的是,在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元无需处理报文,第一编辑单元处于空闲状态。因此,第一编辑单元可以处理接收的 第三报文。具体的,第一编辑单元可以执行S802-S805。It can be understood that, after the first editing unit sends the second message to the second editing unit, the first editing unit does not need to process the message, and the first editing unit is in an idle state. Therefore, the first editing unit can process the received third message. Specifically, the first editing unit may execute S802-S805.
S802、第一编辑单元判断第一编辑单元的标识与第二编辑命令的标识是否相同。S802. The first editing unit determines whether the identifier of the first editing unit is the same as the identifier of the second editing command.
其中,第二编辑命令是第二命令序列中的第一个编辑命令。Wherein, the second editing command is the first editing command in the second command sequence.
一种可能的实现方式,第一检测单元判断第一检测单元的OPCD与第二命令序列的前4比特的数据是否相同。若第一编辑单元的标识与第二编辑命令的标识相同,第二编辑单元则可以编辑第三报文。具体的,第一编辑单元可以执行S803。若第一编辑单元的标识与第二编辑命令的标识不相同,第一编辑单元则不会编辑第三报文。具体的,第一编辑单元可以执行S804。In a possible implementation manner, the first detection unit determines whether the OPCD of the first detection unit is the same as the data of the first 4 bits of the second command sequence. If the identifier of the first editing unit is the same as the identifier of the second editing command, the second editing unit can edit the third message. Specifically, the first editing unit may execute S803. If the identifier of the first editing unit is different from the identifier of the second editing command, the first editing unit will not edit the third message. Specifically, the first editing unit may execute S804.
S803、若第一编辑单元的标识与第二编辑命令的标识相同,第二编辑单元则从第二命令序列中截取第二编辑命令,并根据第二编辑命令编辑第二数据净荷,得到第四报文。S803. If the identifier of the first editing unit is the same as the identifier of the second editing command, the second editing unit intercepts the second editing command from the second command sequence, and edits the second data payload according to the second editing command to obtain the first editing command. Four messages.
其中,第四报文包括截取第二编辑命令之后的第二命令序列和编辑后的第二数据净荷。Wherein, the fourth message includes the second command sequence after intercepting the second editing command and the edited second data payload.
需要说明的是,具体对于S803的介绍,可以参考本申请实施例对S303的描述,此处不予赘述。It should be noted that, for the specific introduction of S803, reference may be made to the description of S303 in this embodiment of the present application, which will not be repeated here.
可以理解的是,在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元无需处理报文,第一编辑单元处于空闲状态。因此,若第一编辑单元的标识与第二编辑命令的标识相同,第一编辑单元则可以编辑接收的第三报文。It can be understood that, after the first editing unit sends the second message to the second editing unit, the first editing unit does not need to process the message, and the first editing unit is in an idle state. Therefore, if the identifier of the first editing unit is the same as the identifier of the second editing command, the first editing unit can edit the received third message.
S804、若第一编辑单元的标识与第二编辑命令的标识不相同,第一编辑单元则向第二编辑单元发送第三报文,由第二编辑单元处理第三报文。S804. If the identifier of the first editing unit is different from the identifier of the second editing command, the first editing unit sends a third message to the second editing unit, and the second editing unit processes the third message.
需要说明的是,具体对于S804的介绍,可以参考本申请实施例对S304的描述,此处不予赘述。It should be noted that, for the specific introduction of S804, reference may be made to the description of S304 in this embodiment of the present application, which will not be repeated here.
S805、第一编辑单元向第二编辑单元发送第四报文,由第二编辑单元处理第四报文。S805: The first editing unit sends a fourth packet to the second editing unit, and the second editing unit processes the fourth packet.
需要说明的是,具体对于S805的介绍,可以参考本申请实施例对S305的描述,此处不予赘述。It should be noted that, for the specific introduction of S805, reference may be made to the description of S305 in this embodiment of the present application, which is not repeated here.
基于上述技术方案,由于在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元处于空闲状态。因此,在第一编辑单元向第二编辑单元发送第二报文之后,第一编辑单元可以编辑接收到的第三报文。这样一来,报文编辑器可以同时编辑多条报文(第一编辑单元编辑第三报文,第二编辑单元编辑第二报文),从而提高编辑报文的速率。之后,第一编辑单元编辑第三报文得到第四报文,并向第二编辑单元发送第四报文,使第二编辑单元处理第四报文。由于报文编辑器包括多个编辑单元。因此,报文编辑器可以通过上述方式,由多个编辑单元串行编辑报文,以完成对报文的编辑。Based on the above technical solution, after the first editing unit sends the second message to the second editing unit, the first editing unit is in an idle state. Therefore, after the first editing unit sends the second message to the second editing unit, the first editing unit can edit the received third message. In this way, the message editor can edit multiple messages at the same time (the first editing unit edits the third message, and the second editing unit edits the second message), thereby increasing the speed of editing messages. After that, the first editing unit edits the third message to obtain the fourth message, and sends the fourth message to the second editing unit, so that the second editing unit processes the fourth message. Since the message editor includes multiple editing units. Therefore, the message editor can edit the message serially by a plurality of editing units in the above manner, so as to complete the editing of the message.
下面结合具体实施例,介绍本申请实施例提供的一种设计报文编辑器的方法。示例性的,假如本申请实施例中的报文编辑器支持L2NIC、ROCEv1、RoCEv2和TCP四种业务的报文编辑。The following describes a method for designing a message editor provided by an embodiment of the present application with reference to specific embodiments. Exemplarily, it is assumed that the packet editor in this embodiment of the present application supports packet editing of four services: L2NIC, ROCEv1, RoCEv2, and TCP.
在该实施例中,报文编辑器需要编辑L2NIC、ROCEv1、RoCEv2和TCP四种业务的报文。其中,报文编辑器编辑L2NIC业务的报文需要4个HDR_CMD类型的编辑单元和4个CS_CMD类型的编辑单元;报文编辑器编辑ROCEv1业务的报文需要3 个HDR_CMD类型的编辑单元和1个CRC_CMD类型的编辑单元;报文编辑器编辑ROCEv2业务的报文需要1个HDR_CMD类型的编辑单元、1个CRC_CMD类型的编辑单元和3个CS_CMD类型的编辑单元;报文编辑器编辑TCP业务的报文需要2个HDR_CMD类型的编辑单元、1个TTS_CMD类型的编辑单元和4个CS_CMD类型的编辑单元。In this embodiment, the packet editor needs to edit packets of four services: L2NIC, ROCEv1, RoCEv2, and TCP. Among them, the packet editor needs 4 HDR_CMD type editing units and 4 CS_CMD type editing units to edit L2NIC service packets; the packet editor needs 3 HDR_CMD type editing units and 1 editing unit to edit ROCEv1 service packets Editing unit of CRC_CMD type; the packet editor needs one HDR_CMD type editing unit, one CRC_CMD type editing unit, and three CS_CMD type editing units to edit the packets of the ROCEv2 service; the packet editor needs to edit the packets of the TCP service. The text requires 2 HDR_CMD type editing units, 1 TTS_CMD type editing unit and 4 CS_CMD type editing units.
请参考表3,其示出了报文编辑器编辑L2NIC、ROCEv1、RoCEv2和TCP四种业务的报文所需要的编辑单元的类型,以及编辑单元的数量。Please refer to Table 3, which shows the types of editing units and the number of editing units required by the message editor to edit the messages of the four services of L2NIC, ROCEv1, RoCEv2 and TCP.
表3table 3
Figure PCTCN2020132850-appb-000005
Figure PCTCN2020132850-appb-000005
综上,本申请实施例中设计的报文编辑器包括4个HDR_CMD类型的编辑单元、1个CRC_CMD类型的编辑单元、1个TTS_CMD类型的编辑单元和4个CS_CMD类型的编辑单元。To sum up, the message editor designed in this embodiment of the present application includes four HDR_CMD type editing units, one CRC_CMD type editing unit, one TTS_CMD type editing unit, and four CS_CMD type editing units.
具体的,假如报文编辑器需要支持L2NIC、ROCEv1、RoCEv2和TCP四种业务的报文编辑时,该报文编辑器可以设计为如图9所示的报文编辑器。其中,MUX模块需要根据不同的业务场景进行配置。也就是说,部分业务场景中会对MUX模块进行配置,即报文不会经过报文编辑器中的每一个编辑单元;另一部分业务场景中不会对MUX模块进行配置,即报文会依次经过每一个编辑单元。Specifically, if the packet editor needs to support packet editing of four services of L2NIC, ROCEv1, RoCEv2 and TCP, the packet editor can be designed as a packet editor as shown in FIG. 9 . Among them, the MUX module needs to be configured according to different business scenarios. That is to say, in some business scenarios, the MUX module will be configured, that is, the message will not pass through each editing unit in the message editor; in other business scenarios, the MUX module will not be configured, that is, the message will be sequentially Go through each editing unit.
需要说明的是,报文编辑器中的编辑单元必须支持所有业务需要的编辑功能,但是对于某个业务中的特定报文而言,并不需要该业务的所有编辑功能。例如:L2NIC业务需要CS_CMD类型的编辑单元。但是,对于L2NIC业务中的ARP报文,则不需要CS_CMD类型的编辑单元。It should be noted that the editing unit in the message editor must support editing functions required by all services, but for a specific message in a service, all editing functions of the service are not required. For example, the L2NIC service requires an editing unit of type CS_CMD. However, for the ARP packets in the L2NIC service, the editing unit of the CS_CMD type is not required.
下面结合图9,以一个只支持三级HDR_CMD类型的编辑单元编辑的报文为例,介绍报文编辑器编辑该报文的过程。In the following, with reference to FIG. 9 , a process of editing the message by the message editor is described by taking a message that only supports editing by an editing unit of the third-level HDR_CMD type as an example.
示例性的,如图10所示,其示出了PKT1经过三次编辑得到NEW PKT4的过程。Exemplarily, as shown in Figure 10, it shows the process of obtaining NEW PKT4 through three edits of PKT1.
具体的,请参考表4,其介绍了报文编辑器编辑报文PKT1的过程。Specifically, please refer to Table 4, which introduces the process of editing the message PKT1 by the message editor.
表4Table 4
Figure PCTCN2020132850-appb-000006
Figure PCTCN2020132850-appb-000006
Figure PCTCN2020132850-appb-000007
Figure PCTCN2020132850-appb-000007
需要说明的是,结合上述公式二可知,在本申请上述实施例中,编辑命令序列和数据净荷分别只占用一拍总线宽度情况下的短包,最大包率可以达到报文编辑器工作时钟频率的1/2。It should be noted that, in combination with the above formula 2, it can be seen that in the above-mentioned embodiment of the present application, the editing command sequence and the data payload only occupy a short packet in the case of a bus width, and the maximum packet rate can reach the working clock of the message editor. 1/2 of the frequency.
此外,若短包包率大于报文编辑器工作时钟频率的1/2,本申请实施例中的CP模块分析完编辑命令长度后,不把编辑命令和报文数据分成两段发送。采用总线拼接的方案,通过带外信号指示总线中有多少字节是编辑命令,多少字节是报文。之后,每个编辑单元可支持编辑命令和报文数据拼拍。In addition, if the short packet rate is greater than 1/2 of the working clock frequency of the message editor, the CP module in the embodiment of the present application does not divide the editing command and the message data into two segments to send after analyzing the length of the editing command. The scheme of bus splicing is adopted, and out-of-band signals are used to indicate how many bytes in the bus are editing commands and how many bytes are messages. After that, each editing unit can support editing commands and message data stitching.
这样一来,编辑命令和PKT总共只占用一拍总线宽度情况下的短包,最大包率可以达到编辑器工作时钟频率。但是,若采用总线拼接的方案,会增加设计的复杂度。因此,实际应用中,建议在满足性能的情况下,优先选择实现简单和成本低的方案(即最大包率可以达到报文编辑器工作时钟频率的1/2的方案)。In this way, the editing command and PKT only occupy a short packet in the case of a bus width, and the maximum packet rate can reach the working clock frequency of the editor. However, if the scheme of bus splicing is adopted, the complexity of the design will be increased. Therefore, in practical applications, it is recommended to choose the solution with simple implementation and low cost (that is, the solution whose maximum packet rate can reach 1/2 of the working clock frequency of the message editor) under the condition of satisfying performance.
上述主要从编辑单元的角度对本申请实施例提供的方案进行了介绍。可以理解的是,编辑单元为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请所公开的实施例描述的各示例的一种编辑报文的方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。 某个功能究竟以硬件还是编辑单元软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions provided by the embodiments of the present application from the perspective of the editing unit. It can be understood that, in order to realize the above functions, the editing unit includes corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that the steps of a method for editing a message of each example described in conjunction with the embodiments disclosed in this application can be implemented in hardware or in a combination of hardware and computer software. Whether a function is performed by hardware or by the way that the editing unit software drives the hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对编辑报文的装置进行功能模块或者功能单元的划分,例如,可以对应各个功能划分各个功能模块或者功能单元,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块或者功能单元的形式实现。其中,本申请实施例中对模块或者单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, the device for editing a message may be divided into functional modules or functional units according to the foregoing method examples. For example, each functional module or functional unit may be divided corresponding to each function, or two or more functions may be integrated. in a processing module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules or functional units. Wherein, the division of modules or units in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
请参考图11,其示出本申请实施例提供的一种编辑报文的装置的示意图。该编辑报文的装置可以是上述报文编辑器或者编辑单元中,用于实现本申请实施例的方法的功能模块。如图11所示,该编辑报文的装置可以包括:接收模块1101、处理模块1102和发送模块1103。Please refer to FIG. 11 , which shows a schematic diagram of an apparatus for editing a message provided by an embodiment of the present application. The device for editing a message may be a functional module in the foregoing message editor or editing unit for implementing the method of the embodiment of the present application. As shown in FIG. 11 , the apparatus for editing a message may include: a receiving module 1101 , a processing module 1102 and a sending module 1103 .
其中,接收模块1101用于编辑单元执行:接收报文。例如,接收模块1101用于支持编辑单元执行上述方法实施例中的S301和S801,和/或用于本文所描述的技术的其它过程。Among them, the receiving module 1101 is used for the editing unit to perform: receive a message. For example, the receiving module 1101 is used to support the editing unit to perform S301 and S801 in the above method embodiments, and/or other processes for the techniques described herein.
处理模块1102用于编辑单元执行:判断编辑单元是否编辑该报文,并编辑报文。例如,处理模块1102用于支持编辑单元执行上述方法实施例中的S302,S303,S802和S803,和/或用于本文所描述的技术的其它过程。The processing module 1102 is used for the editing unit to execute: judging whether the editing unit edits the message, and edits the message. For example, the processing module 1102 is used to support the editing unit to perform S302, S303, S802 and S803 in the above method embodiments, and/or other processes for the techniques described herein.
发送模块1103用于编辑单元执行:发送处理完成的报文。例如,发送模块1103用于支持编辑单元执行上述方法实施例中的S305,S304,S804和S805,和/或用于本文所描述的技术的其它过程。The sending module 1103 is used for the editing unit to execute: sending the processed message. For example, the sending module 1103 is configured to support the editing unit to perform S305, S304, S804 and S805 in the above method embodiments, and/or other processes for the techniques described herein.
本申请实施例还提供一种报文编辑器,该报文编辑器包括多个编辑单元,该报文编辑器可以执行上述方法实施例中编辑单元执行的各个功能或者步骤。Embodiments of the present application further provide a message editor, where the message editor includes a plurality of editing units, and the message editor can execute various functions or steps performed by the editing units in the foregoing method embodiments.
本申请实施例还提供一种芯片系统,如图12所示,该芯片系统包括至少一个处理器1201和至少一个接口电路1202。处理器1201和接口电路1202可通过线路互联。例如,接口电路1202可用于从其它装置接收信号。又例如,接口电路1202可用于向其它装置(例如处理器1201)发送信号。示例性的,接口电路1202可读取存储器中存储的指令,并将该指令发送给处理器1201。当所述指令被处理器1201执行时,可使得编辑报文的装置执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application further provides a chip system. As shown in FIG. 12 , the chip system includes at least one processor 1201 and at least one interface circuit 1202 . The processor 1201 and the interface circuit 1202 may be interconnected by wires. For example, interface circuitry 1202 may be used to receive signals from other devices. As another example, the interface circuit 1202 may be used to send signals to other devices (eg, the processor 1201). Exemplarily, the interface circuit 1202 may read the instructions stored in the memory and send the instructions to the processor 1201 . When the instructions are executed by the processor 1201, the device for editing a message can be made to execute the steps in the above embodiments. Certainly, the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述编辑报文的装置上运行时,使得该编辑报文的装置执行上述方法实施例中编辑单元执行的各个功能或者步骤。An embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are executed on the above-mentioned apparatus for editing a message, the apparatus for editing a message is caused to perform the editing in the foregoing method embodiment. The individual functions or steps performed by the unit.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中编辑单元执行的各个功能或者步骤。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, enables the computer to execute each function or step performed by the editing unit in the above method embodiments.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块, 以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

  1. 一种编辑报文的方法,其特征在于,应用于报文编辑器,所述报文编辑器包括多个编辑单元,所述多个编辑单元包括第一编辑单元和第二编辑单元,所述方法包括:A method for editing a message, characterized in that it is applied to a message editor, the message editor comprising a plurality of editing units, the plurality of editing units including a first editing unit and a second editing unit, the Methods include:
    所述第一编辑单元接收第一报文,所述第一报文包括第一命令序列和第一数据净荷,所述第一命令序列包括按照第一预设顺序排列的多个编辑命令,所述第一命令序列包含于所述第一报文的头部;the first editing unit receives a first message, the first message includes a first command sequence and a first data payload, the first command sequence includes a plurality of editing commands arranged in a first preset order, the first command sequence is included in the header of the first message;
    若所述第一编辑单元的标识与第一编辑命令的标识相同,所述第一编辑单元则从所述第一命令序列中截取所述第一编辑命令,并根据所述第一编辑命令编辑所述第一数据净荷,得到第二报文;其中,所述第一编辑命令是所述第一命令序列中的第一个编辑命令,所述第二报文包括截取所述第一编辑命令之后的所述第一命令序列和编辑后的第一数据净荷;If the identifier of the first editing unit is the same as the identifier of the first editing command, the first editing unit intercepts the first editing command from the first command sequence, and edits the first editing command according to the first editing command The first data payload obtains a second message; wherein, the first editing command is the first editing command in the first command sequence, and the second message includes intercepting the first editing the first command sequence after the command and the edited first data payload;
    所述第一编辑单元向所述第二编辑单元发送所述第二报文,由所述第二编辑单元处理所述第二报文。The first editing unit sends the second message to the second editing unit, and the second editing unit processes the second message.
  2. 根据权利要求1所述的方法,其特征在于,在所述第一编辑单元接收第一报文之后,所述方法还包括:The method according to claim 1, wherein after the first editing unit receives the first message, the method further comprises:
    所述第一编辑单元接收第三报文,所述第三报文包括第二命令序列和第二数据净荷,所述第二命令序列包括按照第二预设顺序排列的多个编辑命令,所述第二命令序列包含于所述第三报文的头部;the first editing unit receives a third message, the third message includes a second command sequence and a second data payload, the second command sequence includes a plurality of editing commands arranged in a second preset order, the second command sequence is included in the header of the third message;
    其中,在所述第一编辑单元向所述第二编辑单元发送所述第二报文之后,所述方法还包括:Wherein, after the first editing unit sends the second message to the second editing unit, the method further includes:
    若所述第一编辑单元的标识与第二编辑命令的标识相同,所述第一编辑单元则从所述第二命令序列中截取所述第二编辑命令,并根据所述第二编辑命令编辑所述第二数据净荷,得到第四报文;其中,所述第二编辑命令是所述第二命令序列中的第一个编辑命令,所述第四报文包括截取所述第二编辑命令之后的所述第二命令序列和编辑后的第二数据净荷;If the identifier of the first editing unit is the same as the identifier of the second editing command, the first editing unit intercepts the second editing command from the second command sequence, and edits the second editing command according to the second editing command The second data payload obtains a fourth message; wherein, the second editing command is the first editing command in the second command sequence, and the fourth message includes intercepting the second editing command the second command sequence after the command and the edited second data payload;
    所述第一编辑单元向所述第二编辑单元发送所述第四报文,由所述第二编辑单元处理所述第四报文。The first editing unit sends the fourth message to the second editing unit, and the second editing unit processes the fourth message.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一编辑单元接收第一报文,包括:The method according to claim 1 or 2, wherein the first editing unit receives the first message, comprising:
    所述第一编辑单元接收来自所述多个编辑单元中第三编辑单元的所述第一报文,所述第一报文是所述第三编辑单元处理后的报文;或者,The first editing unit receives the first message from a third editing unit in the plurality of editing units, where the first message is a message processed by the third editing unit; or,
    所述第一编辑单元接收来自所述报文编辑器的上游器件的所述第一报文。The first editing unit receives the first message from an upstream device of the message editor.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    若所述第一编辑单元的标识与所述第一编辑命令的标识不同,所述第一编辑单元向所述第二编辑单元透传所述第一报文,由所述第二编辑单元处理所述第一报文。If the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit transparently transmits the first message to the second editing unit, and the second editing unit processes it the first message.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第二编辑单元是所述多个编辑单元中、预先设定的所述第一编辑单元的下一个编辑单元;或者,The method according to any one of claims 1-4, wherein the second editing unit is the next editing unit of the preset first editing unit in the plurality of editing units; or,
    所述第一编辑单元还包括MUX模块,所述第二编辑单元为所述MUX模块指定的、所述第一编辑单元的下一个编辑单元。The first editing unit further includes a MUX module, and the second editing unit is the next editing unit of the first editing unit specified by the MUX module.
  6. 一种编辑报文的装置,其特征在于,所述编辑报文的装置包括:A device for editing a message, wherein the device for editing a message comprises:
    接收模块,用于接收第一报文,所述第一报文包括第一命令序列和第一数据净荷,所述第一命令序列包括按照第一预设顺序排列的多个编辑命令,所述第一命令序列包含于所述第一报文的头部;a receiving module, configured to receive a first message, where the first message includes a first command sequence and a first data payload, the first command sequence includes a plurality of editing commands arranged in a first preset order, so The first command sequence is included in the header of the first message;
    处理模块,用于若第一编辑单元的标识与第一编辑命令的标识相同,则从所述第一命令序列中截取所述第一编辑命令,并根据所述第一编辑命令编辑所述第一数据净荷,得到第二报文;其中,所述第一编辑命令是所述第一命令序列中的第一个编辑命令,所述第二报文包括截取所述第一编辑命令之后的所述第一命令序列和编辑后的第一数据净荷;A processing module, configured to intercept the first editing command from the first command sequence if the identifier of the first editing unit is the same as the identifier of the first editing command, and edit the first editing command according to the first editing command. A data payload to obtain a second message; wherein, the first editing command is the first editing command in the first command sequence, and the second message includes the first editing command after intercepting the first editing command. the first command sequence and the edited first data payload;
    发送模块,用于向第二编辑单元发送所述第二报文,由所述第二编辑单元处理所述第二报文。A sending module, configured to send the second message to a second editing unit, and the second editing unit processes the second message.
  7. 根据权利要求6所述的编辑报文的装置,其特征在于,The device for editing a message according to claim 6, wherein,
    所述接收模块,还用于接收第三报文,所述第三报文包括第二命令序列和第二数据净荷,所述第二命令序列包括按照第二预设顺序排列的多个编辑命令,所述第二命令序列包含于所述第三报文的头部;The receiving module is further configured to receive a third message, where the third message includes a second command sequence and a second data payload, and the second command sequence includes a plurality of edits arranged in a second preset order command, the second command sequence is included in the header of the third packet;
    所述处理模块,还用于若所述第一编辑单元的标识与第二编辑命令的标识相同,则从所述第二命令序列中截取所述第二编辑命令,并根据所述第二编辑命令编辑所述第二数据净荷,得到第四报文;其中,所述第二编辑命令是所述第二命令序列中的第一个编辑命令,所述第四报文包括截取所述第二编辑命令之后的所述第二命令序列和编辑后的第二数据净荷;The processing module is further configured to intercept the second editing command from the second command sequence if the identification of the first editing unit is the same as the identification of the second editing command, and edit the second editing command according to the second editing command. command to edit the second data payload to obtain a fourth packet; wherein, the second edit command is the first edit command in the second command sequence, and the fourth packet includes intercepting the first edit command. The second command sequence after the editing command and the edited second data payload;
    所述发送模块,还用于向所述第二编辑单元发送所述第四报文,由所述第二编辑单元处理所述第四报文。The sending module is further configured to send the fourth message to the second editing unit, and the second editing unit processes the fourth message.
  8. 根据权利要求6或7所述的编辑报文的装置,其特征在于,The device for editing a message according to claim 6 or 7, wherein,
    所述接收模块,具体用于接收来自所述多个编辑单元中第三编辑单元的所述第一报文,所述第一报文是所述第三编辑单元处理后的报文;或者,The receiving module is specifically configured to receive the first message from a third editing unit in the plurality of editing units, where the first message is a message processed by the third editing unit; or,
    所述接收模块,还具体用于接收来自所述报文编辑器的上游器件的所述第一报文。The receiving module is further specifically configured to receive the first message from the upstream device of the message editor.
  9. 根据权利要求6-8中任一项所述的编辑报文的装置,其特征在于,The device for editing a message according to any one of claims 6-8, wherein,
    所述发送模块,还用于若所述第一编辑单元的标识与所述第一编辑命令的标识不同,向所述第二编辑单元透传所述第一报文,由所述第二编辑单元处理所述第一报文。The sending module is further configured to transparently transmit the first message to the second editing unit if the identifier of the first editing unit is different from the identifier of the first editing command, and the second editing unit will send the message to the second editing unit. The unit processes the first message.
  10. 根据权利要求6-9中任一项所述的编辑报文的装置,其特征在于,所述第二编辑单元是所述多个编辑单元中、预先设定的所述第一编辑单元的下一个编辑单元;或者,The device for editing a message according to any one of claims 6-9, wherein the second editing unit is a lower part of the preset first editing unit among the plurality of editing units an editing unit; or,
    所述第一编辑单元还包括MUX模块,所述第二编辑单元为所述MUX模块指定的、所述第一编辑单元的下一个编辑单元。The first editing unit further includes a MUX module, and the second editing unit is the next editing unit of the first editing unit specified by the MUX module.
  11. 一种报文编辑器,其特征在于,所述报文编辑器包括多个编辑单元,所述报文编辑器用于执行权利要求1-5中任一项所述的方法。A message editor, characterized in that the message editor includes a plurality of editing units, and the message editor is configured to execute the method of any one of claims 1-5.
  12. 一种芯片系统,其特征在于,所述芯片系统应用于编辑报文的装置;所述芯片系统包括一个或多个接口电路和一个或多个处理器;所述接口电路和所述处理器通过线路互联;所述接口电路用于从所述编辑报文的装置的存储器接收信号,并向所述 处理器发送所述信号,所述信号包括所述存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,所述报编辑报文的装置执行如权利要求1-5中任一项所述的方法。A chip system, characterized in that the chip system is applied to a device for editing messages; the chip system includes one or more interface circuits and one or more processors; the interface circuits and the processors pass through line interconnection; the interface circuit is configured to receive a signal from the memory of the device for editing a message and send the signal to the processor, the signal including the computer instructions stored in the memory; when the processing When the computer executes the computer instructions, the device for editing a message executes the method according to any one of claims 1-5.
  13. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在编辑报文的装置上运行时,使得所述编辑报文的装置执行如权利要求1-5中任一项所述的方法。A computer storage medium, characterized in that it includes computer instructions, when the computer instructions are executed on the device for editing a message, the device for editing a message is made to execute as described in any one of claims 1-5 Methods.
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-5中任一项所述的方法。A computer program product, characterized in that, when the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1-5.
PCT/CN2020/132850 2020-11-30 2020-11-30 Message editing method and device WO2022110174A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080106442.8A CN116458143A (en) 2020-11-30 2020-11-30 Method and device for editing message
PCT/CN2020/132850 WO2022110174A1 (en) 2020-11-30 2020-11-30 Message editing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/132850 WO2022110174A1 (en) 2020-11-30 2020-11-30 Message editing method and device

Publications (1)

Publication Number Publication Date
WO2022110174A1 true WO2022110174A1 (en) 2022-06-02

Family

ID=81755194

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/132850 WO2022110174A1 (en) 2020-11-30 2020-11-30 Message editing method and device

Country Status (2)

Country Link
CN (1) CN116458143A (en)
WO (1) WO2022110174A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116346746A (en) * 2023-05-12 2023-06-27 之江实验室 Message processing method for multistage programmable editing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105308927A (en) * 2014-05-30 2016-02-03 华为技术有限公司 Packet editing method and related device
US20190129889A1 (en) * 2016-08-04 2019-05-02 Hancom Inc. Document cooperation supporting apparatus for supporting simultaneous edit of document, and operating method thereof
CN109729117A (en) * 2017-10-30 2019-05-07 华为技术有限公司 A kind of method of Message processing, chip system and computer storage medium
CN111818098A (en) * 2020-09-01 2020-10-23 广东省新一代通信与网络创新研究院 Message editing method and device and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105308927A (en) * 2014-05-30 2016-02-03 华为技术有限公司 Packet editing method and related device
US20190129889A1 (en) * 2016-08-04 2019-05-02 Hancom Inc. Document cooperation supporting apparatus for supporting simultaneous edit of document, and operating method thereof
CN109729117A (en) * 2017-10-30 2019-05-07 华为技术有限公司 A kind of method of Message processing, chip system and computer storage medium
CN111818098A (en) * 2020-09-01 2020-10-23 广东省新一代通信与网络创新研究院 Message editing method and device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116346746A (en) * 2023-05-12 2023-06-27 之江实验室 Message processing method for multistage programmable editing
CN116346746B (en) * 2023-05-12 2023-08-15 之江实验室 Message processing method for multistage programmable editing

Also Published As

Publication number Publication date
CN116458143A (en) 2023-07-18

Similar Documents

Publication Publication Date Title
US8694595B2 (en) Low latency, high bandwidth data communications between compute nodes in a parallel computer
US8082424B2 (en) Determining when a set of compute nodes participating in a barrier operation on a parallel computer are ready to exit the barrier operation
JP5054818B2 (en) Interface device, communication system, nonvolatile memory device, communication mode switching method, and integrated circuit
US7797445B2 (en) Dynamic network link selection for transmitting a message between compute nodes of a parallel computer
US20080022079A1 (en) Executing an allgather operation with an alltoallv operation in a parallel computer
US20080263320A1 (en) Executing a Scatter Operation on a Parallel Computer
US9882801B2 (en) Providing full point-to-point communications among compute nodes of an operational group in a global combining network of a parallel computer
US10810155B2 (en) Configuring compute nodes in a parallel computer using remote direct memory access (‘RDMA’)
US7805546B2 (en) Chaining direct memory access data transfer operations for compute nodes in a parallel computer
CN110661725A (en) Techniques for reordering network packets on egress
US11449456B2 (en) System and method for scheduling sharable PCIe endpoint devices
US20090031002A1 (en) Self-Pacing Direct Memory Access Data Transfer Operations for Compute Nodes in a Parallel Computer
US20240106754A1 (en) Load Balancing Method for Multi-Thread Forwarding and Related Apparatus
CN112749113A (en) Data interaction method, system, device and medium
WO2022110174A1 (en) Message editing method and device
CN114020529A (en) Backup method and device of flow table data, network equipment and storage medium
GB2377138A (en) Ring Bus Structure For System On Chip Integrated Circuits
US7010579B1 (en) Direct data routing system
CN115495406A (en) Message transmission method, device, equipment and storage medium based on PCIe
US8054857B2 (en) Task queuing methods and systems for transmitting frame information over an I/O interface
US20060088046A1 (en) Queue resource sharing for an input/output controller
US9350658B2 (en) FIFO affinity for multiple ports
CN117743252A (en) Communication method between heterogeneous Soc subsystems based on Mailbox
CN115221098A (en) Communication method and device among multi-core processor cores, electronic equipment and medium
JP2009223918A (en) Input-output control device

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202080106442.8

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20963062

Country of ref document: EP

Kind code of ref document: A1