A method and device for editing a message

By introducing multiple editing units into the message editor, and passing the message to the next editing unit after one editing unit completes processing, the problem of low editing rate of the message editor in the existing technology is solved, and simultaneous Efficient processing of editing multiple messages.

CN116458143BActive Publication Date: 2024-10-15HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080106442.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2024-10-15
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

The existing message editor has a low speed when editing multiple messages, because it must be edited serially, and each message can only be edited after completing the next one, resulting in low efficiency.

Method used

Design a message editor that contains multiple editing units. By passing the edited message to the next editing unit for processing, new messages can be edited when one editing unit is idle, thus realizing multiple editing units. The way to edit messages serially.

Benefits of technology

The editing speed of the message editor is improved, multiple messages can be edited at the same time, the number of messages passing through invalid editing units is reduced, and the transmission time is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116458143B_ABST
    Figure CN116458143B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for editing a message, which relates to the field of chip design technology and can improve the rate at which a message editor edits a message. The specific scheme includes: a first editing unit can receive a first message, and the first message includes a first command sequence and a first data payload. 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 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 command sequence after intercepting the first editing command and the edited first data payload. Afterwards, the first editing unit can send a second message to the second editing unit, and the second editing unit processes the second message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of chip design technology, and in particular, to a method and device for editing a message. Background Art

[0002] With the advancement of technology, many services (such as autonomous driving, financial transactions, etc.) have higher and higher requirements for network latency and bandwidth. In the process of running a service, the rate at which a message editor edits a service's message can affect the network latency and bandwidth of the service.

[0003] Generally, a message may contain multiple editing commands (such as a verification command, a deletion command, etc.). In a commonly used message editing method, a message editor needs to execute multiple editing commands and edit the message multiple times to complete processing of the message.

[0004] However, in the above method, the message editor must edit a message multiple times before starting to edit the next message. That is, when there are two messages to be edited, the message editor can only edit each message serially, that is, it can only edit another message after editing one message, and the rate of editing messages is low. Summary of the invention

[0005] The present application provides a method for editing a message and an electronic device, wherein the message editor can edit multiple messages at the same time, thereby improving the rate of editing the messages.

[0006] In a first aspect, the present application provides a method for editing a message, which can be applied to a message editor, wherein the message editor includes a plurality of editing units, and the plurality of editing units include a first editing unit and a second editing unit.

[0007] The first editing unit can receive a first message, which includes a first command sequence and a first data payload. The first command sequence includes multiple editing commands arranged in a first preset order, and the first command sequence is included in the header of the first message. 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 to obtain a second message. Among them, 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. Afterwards, the first editing unit can send a second message to the second editing unit, and the second editing unit processes the second message.

[0008] 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 message (the first command sequence and the first data payload) according to the first editing command. That is to say, among the multiple editing units, there is a corresponding relationship between the identifiers of the multiple editing units and 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 there is no need to edit the first message multiple times. Afterwards, the first editing unit will intercept the first command sequence after the first editing command and the edited first data payload (i.e., the second message) and send them to the second editing unit, and the second editing unit will process the second message.

[0009] The message editor in the present application includes multiple editing units, and the multiple editing units can edit a message in series. For example, after the first editing unit edits a message (such as the first message), the edited message (such as the second message) can be sent to the second editing unit, and the second editing unit continues to edit the 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 time, the first editing unit can edit a new message. In this way, the message editor can edit multiple messages at the same time, which increases the rate of editing messages.

[0010] In combination with the first aspect, in a possible design, the method further includes: the first editing unit can receive 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, and the second command sequence is included in the header of the third message. 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 the second command sequence after intercepting the second editing command and the edited second data payload. Then, the first editing unit sends a fourth message to the second editing unit, and the second editing unit processes the fourth message.

[0011] It can be understood that, since the first editing unit is in an idle state after sending the second message to the second editing unit, the first editing unit can edit the received third message after sending the second message to the second editing unit. 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 improving the rate of editing messages. Afterwards, 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 messages serially by multiple editing units in the above manner to complete the editing of the messages.

[0012] In combination with the first aspect, in another possible design method, the above-mentioned "first editing unit can receive a first message" method includes: the first editing unit can receive a first message from a third editing unit among multiple editing units, and the first message is a message processed by the third editing unit; or, the first editing unit can receive a first message from an upstream device of the message editor.

[0013] That is to say, the first editing unit can receive both the message processed by the third editing unit and the unedited original message sent by the upstream device of the message editor (eg, chip message buffer manager (DBM)).

[0014] In combination with the first aspect, in another possible design, the above method also 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 message to the second editing unit, and the second editing unit processes the first message.

[0015] That is to say, among the multiple editing units, the identifiers of the multiple editing units correspond to 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 send it to the second editing unit, which will process the first message.

[0016] In combination with the first aspect, in another possible design, the second editing unit may be the next editing unit of a preset first editing unit among multiple editing units.

[0017] Exemplarily, the message editor includes editing unit a, editing unit b and editing unit c 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, after editing unit a processes the message, it sends the processed message to editing unit b.

[0018] In combination with the first aspect, in another possible design, the first editing unit further includes a MUX module, and the second editing unit is a next editing unit of the first editing unit specified by the MUX module.

[0019] Exemplarily, the message editor includes editing unit a, editing unit b and editing unit c 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 MUX module can use editing unit c as the second editing unit. That is, after editing unit a processes the message, it will send the processed message to editing unit c.

[0020] In this way, after the first editing unit processes the message, the first editing unit can send the message to the editing unit corresponding to the first editing command in the current command sequence (i.e., the second editing unit), and the second editing unit edits the message. This can avoid the message passing through multiple editing units that do not need to edit the message, reduce the time for transmitting the message, and improve the rate at which the message editor edits the message.

[0021] In a second aspect, the present application provides a device for editing a message, which includes: a receiving module, a processing module, and a sending module.

[0022] The receiving module is used to 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, and the first command sequence is included in the header of the first message.

[0023] A processing module is used 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 data payload according to the first editing command 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 command sequence after intercepting the first editing command and the edited first data payload.

[0024] The sending module is used to send the second message to the second editing unit, and the second editing unit processes the second message.

[0025] In combination with the second aspect, in a possible design, the receiving module is further used to receive 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, and the second command sequence is included in the header of the third message. The processing module is further used 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 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 the second command sequence after intercepting the second editing command and the edited second data payload. The sending module is further used to send a fourth message to the second editing unit, and the second editing unit processes the fourth message.

[0026] In combination with the second aspect, in another possible design, the receiving module is specifically used to receive a first message from a third editing unit among multiple editing units, where the first message is a message processed by the third editing unit; or, the receiving module is also specifically used to receive a first message from an upstream device of the message editor.

[0027] In combination with the second aspect, in another possible design, the sending module is also used to, 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 the first message.

[0028] In combination with the second aspect, in another possible design, the second editing unit is the next editing unit of a predetermined first editing unit among multiple editing units; or, the first editing unit also includes a MUX module, and the second editing unit is the next editing unit of the first editing unit specified by the MUX module.

[0029] In a third aspect, the present application provides a message editor, which includes multiple editing units and can execute the method described in the first aspect and any possible design thereof.

[0030] In a fourth aspect, the present application provides a chip system, which is applied to a device 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 a line. The interface circuit receives a signal from a memory of the device for editing the message and sends the signal to the processor, where the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the device for editing the message executes the method described in the first aspect and any possible design thereof.

[0031] In a fifth aspect, the present application provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on a device for editing a message, the device for editing a message executes the method described in the first aspect and any possible design thereof.

[0032] In a sixth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof.

[0033] It can be understood that the beneficial effects that can be achieved by the device for editing messages described in the second aspect and any possible design thereof, the message editor described in the third aspect, the chip system described in the fourth aspect, the computer storage medium described in the fifth aspect, and the computer program product described in the sixth aspect can be referred to as the beneficial effects in the first aspect and any possible design thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1A A schematic diagram of the composition of a communication system architecture provided in an embodiment of the present application;

[0035] Figure 1B A schematic diagram of the structure of a message editor provided in an embodiment of the present application;

[0036] Figure 1C A schematic diagram of the composition of a communication system architecture provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of a data structure of a message provided in an embodiment of the present application;

[0038] Figure 3 A flow chart of a method for editing a message provided in an embodiment of the present application;

[0039] Figure 4 An example schematic diagram of a message data structure provided in an embodiment of the present application;

[0040] Figure 5 A schematic diagram of another example of a message data structure provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of the structure of an editing unit provided in an embodiment of the present application;

[0042] Figure 7 A schematic diagram of the structure of another message editor provided in an embodiment of the present application;

[0043] Figure 8A flowchart of another method for editing a message provided in an embodiment of the present application;

[0044] Fig. 9 A schematic diagram of the structure of another message editor provided in an embodiment of the present application;

[0045] Fig.10 A schematic diagram of an example of editing a message provided in an embodiment of the present application;

[0046] Fig.11 A schematic diagram of the composition of a device for editing a message provided in an embodiment of the present application;

[0047] Fig.12 A schematic diagram of the structural composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] In this application, the character " / " generally indicates that the objects before and after are in an "or" relationship. For example, A / B can be understood as A or B.

[0050] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0051] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.

[0052] In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present concepts in a specific way.

[0053] With the advancement of technology, many services (such as autonomous driving, financial transactions, etc.) have higher and higher requirements for network latency and bandwidth. In the process of running a service, the rate at which a message editor edits a service's message can affect the network latency and bandwidth of the service.

[0054] In some solutions, there is an editing unit in the message editor. The editing unit can be called multiple times to serially execute multiple editing commands in a message to complete the editing of the message. The maximum packet rate (the rate of editing messages per second) of the message editor can be estimated by the following formula:

[0055]

[0056] Among them, ClockFrequency represents the clock frequency of the editor, in GHz. M represents the number of clock cycles required for the editing unit to execute a single editing command. N represents the number of times the editing unit is called. TotalPktLen represents the message length, including the total length of the NHP generated by the microcode and the ORG PKT written by the PA. BusWidth is the editing bus width. Celling (TotalPktLen / BusWidth, 1) represents the number of bus beats occupied by the message to be edited.

[0057] However, in the above scheme, an editing unit in the message editor must edit a message multiple times before starting to edit the next message. That is, when there are two messages to be edited, the message editor can only edit each message in series, that is, it can only edit another message after editing one message, and the rate of editing messages is low.

[0058] To this end, an embodiment of the present application provides a method for editing a message. In the 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 can receive a first message and edit the first message to obtain a second message. Afterwards, the first editing unit sends the second message to the second editing unit, and the second editing unit edits the second message.

[0059] In this way, after editing the first message, the first editing unit sends the obtained second edited 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 improving the rate of editing messages. The method for editing messages provided in the embodiment of the present application can be applied to the process of editing messages by the message editor.

[0060] In some embodiments, the solution provided by the embodiments of the present application can be applied to an application scenario where 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 the host (Host), and the other side of the smart network card chip is connected to the network device (Network). For example, Figure 1A As shown in Figure 1, one side of the smart NIC 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 NIC chip is connected to the network device through a media access control (Media Access Control, MAC). Figure 1A The functional modules of the smart network card chip shown are introduced.

[0061] The PCIE / DMA module can be used to receive and send data between the smart network card chip and the host.

[0062] The MAC module can be used to receive and send data between the smart network card chip and the network device.

[0063] Packet Analyzer (PA) 0 can be used to receive the message (hereinafter referred to as the original message) received by the MAC module from the network device, and perform type analysis on the message, complete some protocol verification and processing, etc. 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, complete some protocol verification and processing, etc. In addition, PA0 and PA1 can send the analysis results, verification results and original messages to DBM.

[0064] The DBM includes a message buffer for storing original messages and editing commands. Specifically, after receiving the parsing results, verification results and original messages sent by PA0 and PA1, the DBM can store the original messages in a random access memory (RAM) and send the pointer and description information of the original messages to the message scheduler (ISCH). In addition, the DBM can also receive a request from the ISCH and send the message header (including the editing command) and the parsing result to the microcode (PU) / (Microcode). Then, the DBM can receive a request from the PU / Microcode and store the editing command of the message in the RAM. Next, the DBM can receive a request from the egress scheduler (ESCH), splice the editing command of the original message and the original message into a message to be edited according to the data structure of the message required by the packet editor (PE), and send the message to be edited to PE0 / PE1.

[0065] ISCH is used to manage processor resources and sort the original messages based on ports and priorities. After that, ISCH dispatches the original messages to the microcode according to the preset scheduling algorithm. In addition, ISCH sends a notification message to DBM, so that DBM sends the message header and parsing results to the microcode.

[0066] PU / Microcode is a processor unit composed of multiple threads. Microcode runs in the processor unit, and the microcode is used to process multiple protocol messages. The microcode is specifically used to analyze the original message according to the protocol, process the original message to generate the editing command of the original message, and adjust the arrangement order of the editing command. In addition, the microcode can initiate a request to the DBM to store the editing command in the DMB, etc.

[0067] ESCH can sort the messages to be edited based on the port and priority, and schedule the messages to be edited according to the preset scheduling algorithm. After that, ESCH sends the scheduling result to DBM.

[0068] PE0 / PE1 is responsible for editing the message to be edited.

[0069] Specifically, PE1 is responsible for editing the message to be edited and sent to the network device, and sending the edited message to MAC. PE0 is responsible for editing the message to be edited and sent to the host side, and sending the edited message to PCIE / DMA. PE0 / PE1 includes multiple editing units.

[0070] For example, Figure 1BAs shown, the PE includes a CMD PKT Separator (CPS) module and multiple Packet Editor Units (PEUs). Exemplarily, the multiple PEUs include: PEU1, PEU2, PEU3 and PEU4.

[0071] Among them, the CPS module is used to parse the message to be edited, and divide the message to be edited into an editing command and a data payload. Each PEU is used to complete one editing command in the message to be edited. Among multiple PEUs, some PEUs may have the same function type, or the function types of multiple PEUs may be different, which is not limited in the embodiments of the present application. For example, PEU1 and PEU2 can execute the add / delete / replace command (HDR_CMD), then PEU1 and PEU2 are editing units with the function of adding / deleting / replacing data; PEU3 can execute the command to calculate and replace TCP TIMESTAMP (TTS_CMD), then PEU3 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 the function of adding / deleting / replacing data.

[0072] It should be noted that Figure 1B The maximum packet rate (rate of editing messages per second) of the message editor shown can be estimated by the following formula:

[0073]

[0074] Among them, ClockFrequency represents the clock frequency of the editor, in GHz. TotalCmdLen represents the total length of the editing command, including the length of 4B PKT_CMD_HDR, PE_CMD and DMA_CMD. TotalPktLen represents the message length, including the total length of NHP generated by microcode and ORG PKT written by PA. BusWidth is the editing bus width. Celling (TotalCmdLen / BusWidth, 1) represents the number of bus beats occupied by the editing command. Celling (TotalPktLen / BusWidth, 1) represents the number of bus beats occupied by the message to be edited.

[0075] In an embodiment of the present application, the order of multiple editing units in the message editor is pre-set by the developer according to the business scenario.

[0076] In other embodiments, the solution provided in the embodiment of the present application can also be applied to the application scenario where the network processor chip processes data between network devices. In this application scenario, a network device is connected to both sides of the smart network card chip. The network devices on both sides can be the same type of network devices or different types of network devices, which is not limited in the embodiment of the present application.

[0077] For example, Figure 1C As shown in the figure, one side of the smart NIC chip is connected to Network A through PCIE / DMA, and the other side of the smart NIC chip is connected to Network B through MAC. Figure 1B For an introduction to the functional modules, please refer to the above Figure 1A The introduction of the functional modules in will not be repeated here.

[0078] It should be noted that the above application scenarios of the smart network card chip processing data between the host and the network device, and the application scenarios of the network processor chip processing data between network devices are just examples of the application scenarios of the embodiments of the present application, and the embodiments of the present application do not limit this.

[0079] The network devices and hosts in the embodiments of the present application may be tablet computers, mobile phones, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) and virtual reality (VR) devices, vehicle-mounted devices, and the embodiments of the present application do not impose any special restrictions on the specific forms of the network devices and hosts.

[0080] The execution subject of the method for editing a message provided in the present application may be a device for editing a message, and the execution device may be Figure 1B The message editor shown. At the same time, the execution device can also be the central processing unit (CPU) of the message editor, or the editing unit in the message editor for editing the message. In the embodiment of the present application, the method of editing the message executed by the editing unit is taken as an example to illustrate the method of editing the message provided in the embodiment of the present application.

[0081] Before introducing the method of the embodiment of the present application, the data structure of the message to be edited (such as the first message, the second message, etc.) provided by the embodiment of the present application is first introduced.

[0082] Specifically, Figure 2 As shown, 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 (PECMD 1, PE CMD 2, PE CMD 3, ..., PE CMD n), DMACMD, new message 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.

[0083] For example, please refer to Table 1, which shows the description of the data structure of the message to be edited.

[0084] Table 1

[0085]

[0086] It should be noted that PE CMD1, PE CMD2, ..., PE CMDn may be editing commands with the same functional type, or may be editing commands with different functional types, which is not limited in the present embodiment. Each editing command has a unique identifier (OPCODE, OPCD). The identifier is used to indicate the functional type of the editing command.

[0087] For example, please refer to Table 2, which shows the description of HDR_CMD.

[0088] Table 2

[0089]

[0090] 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 editing command is 0x8, the editing command is TTS CMD. For another example, when the OPCD of the editing command is 4'h6, the editing command is CRC32CMD. For the specific introduction of the correspondence between the editing command and OPCD, please refer to the prior art or HDR_CMD, which will not be repeated here.

[0091] The following is an explanation of the method of the embodiment of the present application. The embodiment of the present application provides a method for editing a message, such as Figure 3As shown, the method for editing a message may include S301-S305.

[0092] S301. A first editing unit receives a first message.

[0093] The first message includes a first command sequence and a first data payload, and the first command sequence is included in the header of the first message. The first message also includes a first command sequence header. Exemplarily, in combination Figure 2 ,if Figure 2 The data structure of the message shown is the data structure of the first message, then Figure 2 The PE_CMD_LEN, DMA_CMD_LEN, and RSV shown are the first command sequence header, PE CMDs (such as PE CMD1, PE CMD2, PE CMD3, ... PE CMDn) are the first command sequence, and NHP and ORGPKT are the first data payload. For a specific introduction to the first command sequence, the first command sequence header, and the first data payload, please refer to the above description. Figure 2 The description is not repeated here.

[0094] In an embodiment of the present application, the first command sequence includes multiple editing commands arranged in a first preset order. The first preset order is used to indicate the order in which the multiple editing commands in the first command sequence are arranged, which is the same as the order of editing units of different functional types in the message editor.

[0095] Exemplary, combined Figure 1B , if the message editor includes add / delete / replace units arranged in sequence (i.e. Figure 1B PEU1 in ), calculate and replace the TCP TIMESTAMP unit (ie Figure 1B PEU3 in ) and calculate and add the CRC32 unit (i.e. Figure 1B PEU4 in the message editor), that is, the add / delete / replace editing unit is the first editing unit in the message editor. If the first message sequence includes an add / delete / replace command, a calculate and add CRC32 command, and a calculate and replace TCPTIMESTAMP command, the microcode can adjust the order of the multiple editing commands in the first message sequence to add / delete / replace commands, calculate and replace TCP TIMESTAMP commands, and calculate and add CRC32 commands. For example, combined with Figure 2 , the first message sequence includes add / delete / replace commands arranged in a first preset order (i.e. Figure 2 PE CMD1 in ), calculate and replace the TCP TIMESTAMP command (ie Figure 2 PE CMD2 in), calculate and add CRC32 command (ie Figure 2 PE CMD3 in).

[0096] It is understandable that, since the editing unit can only intercept the editing command at the head of the command sequence, the multiple editing commands in the first command sequence are sorted according to the order of the editing units of different functional types in the message editor, so that the message editor can execute each editing command in the first command sequence, thereby ensuring that the message editor completes the editing of the message.

[0097] In some embodiments, the first editing unit may receive a first message from a third editing unit among multiple editing units, and 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, and the first message may also be a message not edited by the third editing unit, which is not limited in the embodiments of the present application. For example, after receiving message a, the third editing unit edits message a to obtain message b (i.e., the first message), and sends message b to the first editing unit. For another example, after receiving message a, the third editing unit does not edit message a, but directly sends message a (i.e., the first message) to the first editing unit.

[0098] In some other embodiments, the first editing unit may receive a first message from an upstream device of the message editor. If the first editing unit receives a first message from an upstream device of the message editor, the first editing unit is the first editing unit in the message editor, the upstream device of the message editor may be a DBM, and the first message may be a message to be edited (the editing command of the original message and the original message) spliced ​​by the DBM according to the requirements of the message editor.

[0099] 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.

[0100] The first editing command is the first editing command in the first command sequence. Figure 2 ,if Figure 2 The PE CMDs shown are the first command sequence, and PE CMD1 is the first edit command in PE CMDs. In other words, PECMD1 is the first edit command.

[0101] In a possible implementation, the first detection unit determines whether the OPCD of the first detection unit is the same as the first 4 bits of data 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 can execute S303. If the identifier of the first editing unit is not the same as the identifier of the first editing command, the first editing unit will not edit the first message. Specifically, the first editing unit can execute S304.

[0102] 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 a second message.

[0103] Exemplarily, if 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 edits the first data payload according to the first editing command to obtain the second message.

[0104] In the embodiment of the present application, the second message includes the first command sequence after intercepting the first editing command and the edited first data payload.

[0105] It is understandable 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. In addition, the first editing unit can 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 message, the first message changes, that is, the first editing unit can obtain the first command sequence after intercepting the first editing command and the edited first data payload.

[0106] The following combination Figure 4 and Figure 5 , the process of the first editing unit editing the first message to obtain the second message is introduced. For example, Figure 4 As shown, the first command sequence includes: edit command a, edit command b, edit command c and edit command d. The first edit command of the first command sequence is edit command a, and the first data payload is data payload a. If the identifier of the first edit unit is the same as the identifier of edit command a, the first edit unit intercepts edit command a from the first command sequence and configures the editing parameters of the first edit unit (such as OFFSET, LEN, etc.) according to edit command a. Afterwards, the first edit unit edits data payload a to obtain the intercepted command sequence and the edited data payload. Figure 5 As shown, the intercepted command sequence includes: editing command b, editing command c and editing command d, the first editing command of the intercepted command sequence is editing command b, and data payload b is obtained by the first editing unit editing data payload a according to editing command a.

[0107] S304: If the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit sends a first message to the second editing unit, and the second editing unit processes the first message.

[0108] 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 send the first message to the second editing unit, and the second editing unit will process the first message.

[0109] In some embodiments, the first editing unit includes multiple processing modules, which are used to process received messages. When the first editing unit sends a first message to the second editing unit, the first message can pass through multiple processing modules in the first editing unit, that is, the first message passes through the entire first editing unit. However, since the identifier of the first editing unit is different from the identifier of the first editing command, the first editing unit does not edit the first message. Therefore, the first message passing through multiple processing modules in the first editing unit will extend the time it takes for the first message to pass through the first editing unit, resulting in a decrease in the rate at which the message editor edits the message.

[0110] In order to reduce the time for the first message to pass through the first editing unit. After receiving the first message, the first editing unit can obtain a state value set of the first editing unit according to the first message. The state value set 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 can determine whether the first message has passed through the complete first editing unit according to the state value set.

[0111] For example, Figure 6As shown, PEU includes: Parser_TTS_CMD module, CALC_TTS module, REP_TTS module and OUTPUT_CTRL module. The state value set 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 identifier as the current 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, and provides editing parameters to the CALC_TTS module and the REP_TTS module. The CALC_TTS module is used to calculate the 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 with the message HDR at the position indicated by the OFS. Afterwards, 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.

[0112] 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 (i.e., it is in an idle state), and VLD_FF2 indicates that the REP_TTS module is not processing data (i.e., it is in an idle state), the message received by the PUE does not need to pass through the Parser_TTS_CMD module, the CALC_TTS module, and the REP_TTS module, and can be directly sent to the next editing unit through the OUTPUT_CTRL module. In other words, 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.

[0113] It can be understood that by reducing the number of processing modules that the message passes through the editing unit, the time that the message passes through the editing unit can be reduced, thereby increasing the rate at which the message editor edits the message.

[0114] 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 message received by the PUE needs to pass through the Parser_TTS_CMD module, CALC_TTS module, REP_TTS module and OUTPUT_CTRL module. In other words, if the PEU needs to edit the message, or the PEU is processing data, the message needs to pass through the PEU completely.

[0115] It is understandable that if the PEU needs to edit the message, the message needs to pass 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 the message serially, that is, the message editor can only edit each message in sequence. Therefore, the message needs to pass through the editing unit completely to avoid confusion in the order in which the message editor edits the message.

[0116] S305: The first editing unit sends a second message to the second editing unit, and the second editing unit processes the second message.

[0117] In some embodiments, the second editing unit may be a preset next editing unit of the first editing unit among multiple 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. Figure 1B , if the first editing unit is PEU1, then the second editing unit is PEU2. PEU1 can send a message to PEU2. For another example, Figure 1B , if the first editing unit is PEU2, then the second editing unit is PEU3. PEU2 can send messages to PEU3.

[0118] It is understandable that when the message editor only processes messages of one business scenario, since the number of editing units of different functional types required for messages of the same business scenario is similar, the developer can reasonably configure the number and order of multiple editing units in the message editor according to the business scenario, reduce the number of invalid editing units (editing units that do not need to edit the message) that the message passes through, and improve the rate at which the message editor edits the message.

[0119] However, if the message editor can process messages of multiple different business scenarios, since messages of different business scenarios require different editing units of different functional types, the number of editing units of different functional types required is also different. Therefore, there may be many editing units of different functional types in the message editor, and the number of editing units is also large. In this way, when the message editor edits a message, the message may pass through many invalid editing units, resulting in a decrease in the rate at which the message editor edits the message.

[0120] In other embodiments, in order to reduce the number of invalid editing units that the message passes through and improve the rate at which the message editor edits the message, 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 may send the message to the specified editing unit. That is, after the first editing unit obtains the second message, the first editing unit may send the second message to an editing unit that is not adjacent to it.

[0121] Exemplarily, the message editor includes multiple editing units, and some editing units can be configured to send to the MUX module. Figure 7 As shown, PE includes: CPS, PEU1, PEU2, PEU3, PEU4, PEU5, PEU6 and PEU7. Among them, PEU1 is configured to send to MUX1, and PEU3 is configured to send to MUX2. For example, when PEU1 is the first editing unit, PEU1 obtains the second message and sends the second message to PEU3 (i.e., the second editing unit) through MUX1. For another example, when PEU3 is the first editing unit, PEU3 obtains the second message and sends the second message to PEU7 (i.e., the second editing unit) through MUX2.

[0122] It should be noted that the developer can configure the MUX module for some editing units according to the messages of the business scenarios that the message editor needs to process, as well as the next editing unit specified by the MUX module (the configuration of the MUX module); or, the developer can configure the MUX module for the message editor according to the messages of the business scenarios that the message editor needs to process (that is, the MUX module is not in the editing unit), as well as the next editing unit specified by the MUX module (the configuration of the MUX module). The embodiments of the present application do not limit which editing units are configured with the MUX module and the configuration of the MUX module.

[0123] It is understandable that by configuring the MUX module in the editing unit, the editing unit can send messages to the designated editing unit. In this way, the message editor can control the editing units through which the message passes, reduce the invalid editing units through which the message passes, and thus increase the rate at which the message editor edits the message.

[0124] In addition, after the first editing unit sends the second message to the second editing unit, the second editing unit can receive the second message. And the second editing unit can 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 the fifth message (refer to the introduction of S303 above, which will not be repeated here). Afterwards, the second editing unit can send the fifth message to the fourth editing unit, and the fourth editing unit will process the fifth message. Among them, the fourth editing unit is the next editing unit of the pre-set second editing unit among multiple editing units. Alternatively, the second editing unit also 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 a detailed introduction to the above process, please refer to S301-304, which will not be repeated here.

[0125] 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, which processes the second message.

[0126] It is understandable that, since the message editor includes multiple editing units. Therefore, the message editor can edit the message in series by multiple editing units through the above scheme, thereby completing the editing of the message. In addition, the message editor includes multiple editing units, and the functional types of the multiple editing units are not exactly the same, so that the message editor edits messages of multiple 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.

[0127] 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 message (the first command sequence and the first data payload) according to the first editing command. That is to say, among the multiple editing units, there is a corresponding relationship between the identifiers of the multiple editing units and 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 there is no need to edit the first message multiple times. Afterwards, the first editing unit will intercept the first command sequence after the first editing command and the edited first data payload (i.e., the second message) and send them to the second editing unit, and the second editing unit will process the second message.

[0128] The message editor in the present application includes multiple editing units, and the multiple editing units can edit a message in series. For example, after the first editing unit edits a message (such as the first message), the edited message (such as the second message) can be sent to the second editing unit, and the second editing unit will continue to edit the 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 time, the first editing unit can edit a new message. In this way, the message editor can edit multiple messages at the same time, which increases the rate of editing messages.

[0129] For example, after the first editing unit receives the first message, the first editing unit may also receive the third message, and the message editor may edit the second message and the third message at the same time. Figure 8 As shown, it is a flow chart of another method for editing a message provided in an embodiment of the present application. The method for editing a message may include S801-S805.

[0130] S801. The first editing unit receives a third message.

[0131] 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, and the second command sequence is included in the header of the third message.

[0132] It should be noted that, for part of the introduction to S801, reference can be made to the description of S301 in the embodiment of the present application, which will not be repeated here.

[0133] 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 / the second message to the second editing unit, and put the third message into the cache queue.

[0134] It is understandable that 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, the first editing unit is processing the first message, so the first editing unit is temporarily unable to process the third message.

[0135] In some other embodiments, after the first editing unit sends the second message to the second editing unit, the first editing unit may receive a third message.

[0136] It is understandable 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 can execute S802-S805.

[0137] 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.

[0138] The second editing command is the first editing command in the second command sequence.

[0139] In a possible implementation, the first detection unit determines whether the OPCD of the first detection unit is the same as the first 4 bits of data 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 can execute S803. If the identifier of the first editing unit is not the same as the identifier of the second editing command, the first editing unit will not edit the third message. Specifically, the first editing unit can execute S804.

[0140] 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 a fourth message.

[0141] The fourth message includes the second command sequence after the second editing command is intercepted and the edited second data payload.

[0142] It should be noted that, for the specific introduction of S803, reference may be made to the description of S303 in the embodiment of the present application, which will not be repeated here.

[0143] It is understandable 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 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.

[0144] 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.

[0145] It should be noted that, for the specific introduction of S804, reference may be made to the description of S304 in the embodiment of the present application, which will not be repeated here.

[0146] S805. The first editing unit sends a fourth message to the second editing unit, and the second editing unit processes the fourth message.

[0147] It should be noted that, for the specific introduction of S805, reference may be made to the description of S305 in the embodiment of the present application, which will not be repeated here.

[0148] Based on the above technical solution, since the first editing unit is in an idle state after sending the second message to the second editing unit, the first editing unit can edit the received third message after sending the second message to the second editing unit. 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 improving the rate of editing messages. Afterwards, 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 messages serially by multiple editing units in the above manner to complete the editing of the messages.

[0149] In the following, a method for designing a message editor provided by an embodiment of the present application is introduced in conjunction with a specific embodiment. For example, if the message editor in the embodiment of the present application supports message editing of four services: L2NIC, ROCEv1, RoCEv2 and TCP.

[0150] In this embodiment, the message editor needs to edit messages of four services, namely, L2NIC, ROCEv1, RoCEv2 and TCP. Among them, the message editor needs 4 HDR_CMD type editing units and 4 CS_CMD type editing units to edit messages of L2NIC services; the message editor needs 3 HDR_CMD type editing units and 1 CRC_CMD type editing unit to edit messages of ROCEv1 services; the message editor needs 1 HDR_CMD type editing unit, 1 CRC_CMD type editing unit and 3 CS_CMD type editing units to edit messages of ROCEv2 services; the message editor needs 2 HDR_CMD type editing units, 1 TTS_CMD type editing unit and 4 CS_CMD type editing units to edit messages of TCP services.

[0151] 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 messages of four services: L2NIC, ROCEv1, RoCEv2 and TCP.

[0152] Table 3

[0153]

[0154] In summary, the message editor designed in the embodiment of the present application includes 4 HDR_CMD type editing units, 1 CRC_CMD type editing unit, 1 TTS_CMD type editing unit and 4 CS_CMD type editing units.

[0155] Specifically, if the message editor needs to support message editing for four services, namely L2NIC, ROCEv1, RoCEv2, and TCP, the message editor can be designed as follows: Fig. 9 The message editor shown in the figure. The MUX module needs to be configured according to different business scenarios. That is, the MUX module will be configured in some business scenarios, 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 pass through each editing unit in turn.

[0156] It should be noted that the editing unit in the message editor must support the editing functions required by all services, but for a specific message in a certain service, not all editing functions of the service are required. For example, the L2NIC service requires a CS_CMD type editing unit. However, for the ARP message in the L2NIC service, a CS_CMD type editing unit is not required.

[0157] Combine the following Fig. 9 , taking a message that only supports editing by the third-level HDR_CMD type editing unit as an example, the process of editing the message by the message editor is introduced.

[0158] For example, Fig.10 As shown, it shows the process of PKT1 being edited three times to obtain NEW PKT4.

[0159] For details, please refer to Table 4, which introduces the process of editing message PKT1 by the message editor.

[0160] Table 4

[0161]

[0162]

[0163] It should be noted that, in combination with the above formula 2, it can be seen that in the above embodiment of the present application, the editing command sequence and the data payload each only occupy a short packet of one beat of the bus width, and the maximum packet rate can reach 1 / 2 of the working clock frequency of the message editor.

[0164] In addition, if the short packet rate is greater than 1 / 2 of the message editor's working clock frequency, the CP module in the embodiment of the present application does not send the editing command and message data in two segments after analyzing the editing command length. A bus splicing solution is adopted, and an out-of-band signal is 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 splicing.

[0165] In this way, the editing command and PKT only occupy a short packet of one beat of bus width, and the maximum packet rate can reach the editor working clock frequency. However, if the bus splicing solution is adopted, the complexity of the design will be increased. Therefore, in practical applications, it is recommended to give priority to the solution with simple implementation and low cost (that is, the solution with a maximum packet rate of 1 / 2 of the message editor working clock frequency) while meeting the performance requirements.

[0166] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the editing unit. It is understandable that, in order to realize the above functions, the editing unit includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the method steps of editing messages in each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or the editing unit software driving the hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0167] The embodiment of the present application can divide the device for editing messages into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation.

[0168] Please refer to Fig.11 , which shows a schematic diagram of a device for editing a message provided in an embodiment of the present application. The device for editing a message may be a functional module in the above-mentioned message editor or editing unit for implementing the method of the embodiment of the present application. Fig.11 As shown, the device for editing a message may include: a receiving module 1101 , a processing module 1102 and a sending module 1103 .

[0169] The receiving module 1101 is used for the editing unit to perform: receiving a message. For example, the receiving module 1101 is used to support the editing unit to perform S301 and S801 in the above method embodiment, and / or other processes of the technology described herein.

[0170] The processing module 1102 is used for the editing unit to execute: determine whether the editing unit edits the message, and edit the message. For example, the processing module 1102 is used to support the editing unit to execute S302, S303, S802 and S803 in the above method embodiment, and / or other processes for the technology described herein.

[0171] The sending module 1103 is used for the editing unit to execute: sending the processed message. For example, the sending module 1103 is used to support the editing unit to execute S305, S304, S804 and S805 in the above method embodiment, and / or other processes for the technology described herein.

[0172] An embodiment of the present application also provides a message editor, which includes multiple editing units. The message editor can execute each function or step executed by the editing unit in the above method embodiment.

[0173] The present application also provides a chip system, such as Fig.12 As shown, the chip system includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 can be interconnected via lines. For example, the interface circuit 1202 can be used to receive signals from other devices. For another example, the interface circuit 1202 can be used to send signals to other devices (such as processor 1201). Exemplarily, the interface circuit 1202 can read instructions stored in the memory and send the instructions to the processor 1201. When the instruction is executed by the processor 1201, the device for editing the message can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0174] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned device for editing messages, the device for editing messages executes each function or step executed by the editing unit in the above-mentioned method embodiment.

[0175] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the editing unit in the above method embodiment.

[0176] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0177] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0178] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0179] 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 separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0180] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0181] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in 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

1. A method for editing a message, characterized in that: Applied to a message editor, the message editor includes a plurality of editing units, the plurality of editing units include a first editing unit and a second editing unit, the method includes: 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, and the first command sequence is included in a 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 data payload according to the first editing command 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 command sequence after the first editing command is intercepted 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. The method according to claim 1, characterized in that After the first editing unit receives the first message, the method further includes: 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, and the second command sequence is included in a header of the third message; 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 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 the second command sequence after the second editing command is intercepted 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. The method according to claim 1 or 2, characterized in that: The first editing unit receives a first message, including: The first editing unit receives the first message from a third editing unit among the multiple editing units, and 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. The method according to claim 1 or 2, characterized in that: 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 the first message.

5. The method according to claim 1 or 2, characterized in that: The second editing unit is a preset next editing unit of the first editing unit among the plurality of editing units; or The first editing unit also includes a MUX module, and the second editing unit is a next editing unit of the first editing unit specified by the MUX module.

6. A device for editing a message, characterized in that: The device for editing a message comprises: A receiving module, configured to receive a first message, wherein the first message includes a first command sequence and a first data payload, wherein the first command sequence includes a plurality of editing commands arranged in a first preset order, and the first command sequence is included in a header of the first message; a processing module, configured to, if the identifier of the first editing unit is the same as the identifier of the first editing command, intercept the first editing command from the first command sequence, and edit the first data payload according to the first editing command 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 command sequence after intercepting the first editing command and the edited first data payload; A sending module is used to send the second message to the second editing unit, and the second editing unit processes the second message.

7. The device for editing a message according to claim 6, characterized in that: The receiving module is further used to receive a third message, wherein 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, and the second command sequence is included in a header of the third message; 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, 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 the second command sequence after the second editing command is intercepted and the edited second data payload; The sending module is further used to send the fourth message to the second editing unit, and the second editing unit processes the fourth message.

8. The device for editing a message according to claim 6 or 7, characterized in that: The receiving module is specifically configured to receive the first message from a third editing unit, 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 an upstream device of the apparatus for editing the message.

9. The device for editing a message according to claim 6 or 7, characterized in that: The sending module is further used 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 processes the first message.

10. The device for editing a message according to claim 6 or 7, characterized in that: The second editing unit is a preset next editing unit of the first editing unit; or, The first editing unit also includes a MUX module, and the second editing unit is a next editing unit of the first editing unit specified by the MUX module.

11. A message editor, characterized in that: The message editor comprises a plurality of editing units, and the message editor is used to execute the method according to any one of claims 1 to 5.

12. 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 circuit and the processor are interconnected via lines; the interface circuit is used to receive a signal from a memory of the device for editing messages and send the signal to the processor, the signal including computer instructions stored in the memory; when the processor executes the computer instructions, the device for editing messages executes the method as described in any one of claims 1-5.

13. A computer storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on a device for editing a message, the device for editing a message executes the method as claimed in any one of claims 1 to 5.

14. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 5.