CN116458143A - Method and device for editing message - Google Patents
Method and device for editing message Download PDFInfo
- Publication number
- CN116458143A CN116458143A CN202080106442.8A CN202080106442A CN116458143A CN 116458143 A CN116458143 A CN 116458143A CN 202080106442 A CN202080106442 A CN 202080106442A CN 116458143 A CN116458143 A CN 116458143A
- Authority
- CN
- China
- Prior art keywords
- editing
- message
- editing unit
- command
- unit
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Abstract
The embodiment of the application provides a method and a device for editing a message, which relate to the technical field of chip design and can improve the rate of editing the message by a message editor. The specific scheme comprises the following steps: the first editing unit may receive a first message including a first command sequence and a first data payload. Under the condition that the identification of the first editing unit is the same as the identification 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; the first editing command is a first editing command in the first command sequence, and the second message comprises the first command sequence after the first editing command is intercepted and a first data payload after editing. Then, the first editing unit may send a second message to the second editing unit, and the second editing unit processes the second message.
Description
The embodiment of the application relates to the technical field of chip design, in particular to a method and a device for editing a message.
As technology advances, many businesses (e.g., autopilots, financial transactions, etc.) have increasingly placed higher demands on network latency and bandwidth. In the process of running the service, the message editor edits the rate of the message of the service, which can affect the network delay and bandwidth of the service.
Typically, there may be multiple edit commands (e.g., check commands, delete commands, etc.) in a single message. In a common message editing method, a message editor needs to execute a plurality of editing commands to edit the message for a plurality of times so as to complete the processing of the message.
However, in the above method, the message editor must edit one message multiple times before the next message can be edited. That is, when two messages need to be edited, the message editor can only edit each message in series, that is, can only edit one message after editing the other message, and the speed of editing the messages is low.
Disclosure of Invention
The application provides a method for editing messages and electronic equipment, wherein a message editor can edit a plurality of messages at the same time, so that the rate of editing the messages is improved.
In a first aspect, the present application provides a method for editing a message, where the method may be applied to a message editor, where the message editor includes a plurality of editing units, where the plurality of editing units includes a first editing unit and a second editing unit.
The first editing unit may 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 according to a first preset order, and the first command sequence is included in a header of the first message. Under the condition that the identification of the first editing unit is the same as the identification 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 the second message. The first editing command is a first editing command in the first command sequence, and the second message comprises the first command sequence after the first editing command is intercepted and a first data payload after editing. Then, the first editing unit may send a second message to the second editing unit, and the second editing unit processes the second message.
Based on the above technical solution, in the case that the identification of the first editing unit is the same as the identification of the first editing command, the first editing unit edits the first message (the first command sequence and the first data payload) only according to the first editing command. That is, among the plurality of editing units, the identifications of the plurality of editing units have a correspondence relationship with the identifications of the plurality of editing commands in the editing command sequence. And the first editing unit only needs to edit the first message once, and does not need to edit the first message for multiple times. And then, the first editing unit sends the first command sequence after intercepting the first editing command and the edited first data payload (namely the second message) to the second editing unit, and the second editing unit processes the second message.
The message editor in the application comprises a plurality of editing units, and the plurality of editing units can edit one message in series. For example, after the first editing unit edits a message (e.g., a first message), the edited message (e.g., a second message) may be sent to the second editing unit, and the second editing unit continues to edit the message. Thus, 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 the new message. Thus, the message editor can edit a plurality of messages at the same time, and the message editing rate is improved.
With reference to the first aspect, in one possible design manner, the method further includes: the first editing unit may receive a third message, where 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, if the identification of the first editing unit is the same as the identification 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; the second editing command is the first editing command in the second command sequence, and the fourth message comprises the second command sequence after the second editing command is intercepted and the second data payload after editing. Then, the first editing unit sends a fourth message to the second editing unit, and the second editing unit processes the fourth message.
It will be appreciated that the first editing unit is in an idle state since it is after the first editing unit sends the second message to the second editing unit. Thus, after the first editing unit sends the second message to the second editing unit, the first editing unit may edit the received third message. Thus, the message editor can edit a plurality of messages (the first editing unit edits the third message and the second editing unit edits the second message) at the same time, thereby improving the rate of editing the messages. And then the first editing unit edits the third message to obtain a 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 comprises a plurality of editing units. Therefore, the message editor can edit the message in series by a plurality of editing units in the mode so as to finish editing the message.
With reference to the first aspect, in another possible design manner, the method for receiving the first message by the first editing unit includes: the first editing unit can receive a first message from a third editing unit in the plurality of editing units, wherein the first message is a message processed by the third editing unit; alternatively, the first editing unit may receive the first message from the upstream device of the message editor.
That is, the first editing unit may receive the message processed by the third editing unit, or may receive an original message that is not edited and is sent from an upstream device (e.g., a chip message buffer manager (Data Buffer Manager, DBM)) of the message editor.
With reference to the first aspect, in another possible design manner, the method further includes: if the identification of the first editing unit is different from the identification of the first editing command, the first editing unit can transmit the first message to the second editing unit, and the second editing unit processes the first message.
That is, among the plurality of editing units, the identifications of the plurality of editing units have a correspondence relationship with the identifications of the plurality of editing commands in the editing command sequence. When the first editing unit is different from the first editing command, the first editing unit does not edit the first message, but sends the first message to the second editing unit, and the second editing unit processes the first message.
In combination with the first aspect, in another possible design manner, the second editing unit may be a next editing unit of the first editing units, which is preset in the plurality of editing units.
The message editor comprises an editing unit a, an editing unit b and an editing unit c which are sequentially arranged. The editing unit a is a first editing unit in the message editor, the editing unit b is a second editing unit, and the editing unit c is a third editing unit. When the first editing unit is the editing unit a, the second editing unit is the editing unit b. That is, after the editing unit a processes the message, the processed message is sent to the editing unit b.
In combination with the first aspect, in another possible design manner, 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.
The message editor comprises an editing unit a, an editing unit b and an editing unit c which are sequentially arranged. The editing unit a is a first editing unit in the message editor, the editing unit b is a second editing unit, and the editing unit c is a third editing unit. When the first editing unit is editing unit a, the MUX module may take editing unit c as the second editing unit. That is, after the editing unit a processes the message, the processed message is sent to the editing unit c.
Thus, after the first editing unit processes the message, the first editing unit may send the message to the editing unit (i.e., the second editing unit) corresponding to the first editing command in the current command sequence, and the second editing unit edits the message. The message can be prevented from passing through a plurality of editing units which do not need to edit the message, the time for transmitting the message is reduced, and the message editing rate of a message editor is improved.
In a second aspect, the present application provides an apparatus for editing a message. The device for editing the message comprises: the device comprises a receiving module, a processing module and a sending module.
The receiving module is used for receiving a first message, the first message comprises a first command sequence and a first data payload, the first command sequence comprises a plurality of editing commands arranged according to a first preset sequence, and the first command sequence is contained in the head of the first message.
The processing module is used for intercepting 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 editing the first data payload according to the first editing command to obtain a second message; the first editing command is a first editing command in the first command sequence, and the second message comprises the first command sequence after the first editing command is intercepted and a first data payload after editing.
And the sending module is used for sending the second message to the second editing unit, and the second message is processed by the second editing unit.
With reference to the second aspect, in one 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, 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 packet. The processing module is further configured to intercept the second editing command from the second command sequence if the identifier of the first editing unit is the same as the identifier of the second editing command, and edit the second data payload according to the second editing command to obtain a fourth message; the second editing command is the first editing command in the second command sequence, and the fourth message comprises the second command sequence after the second editing command is intercepted and the second data payload after editing. 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.
With reference to the second aspect, in another possible design, the receiving module is specifically configured to receive a first packet from a third editing unit of the plurality of editing units, where the first packet is a packet 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.
With reference to the second aspect, in another possible design, the sending module is further configured to, if the identifier of the first editing unit is different from the identifier of the first editing command, pass the first message through the first editing unit to the second editing unit, and process the first message by the second editing unit.
With reference to the second aspect, in another possible design, the second editing unit is a next editing unit of the first editing units set in advance from among the plurality of editing units; alternatively, the first editing unit further includes a MUX module, and the second editing unit is a next editing unit of the first editing unit designated by the MUX module.
In a third aspect, the present application provides a message editor comprising a plurality of editing units, the message editor being capable of performing the method of the first aspect and any one of its possible designs.
In a fourth aspect, the present application provides a chip system, where the chip system is applied to a device for editing a message. The system-on-chip includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a wire. The interface circuit is for receiving a signal from a memory of a device for editing a message and for sending the signal to a processor, the signal comprising computer instructions stored in the memory. When the processor executes the computer instructions, the means for editing the message performs the method as described in the first aspect and any one of its possible designs.
In a fifth aspect, the present application provides a computer storage medium comprising computer instructions which, when run on a device for editing a message, cause the device for editing a message to perform a method as described in the first aspect and any one of its possible designs.
In a sixth aspect, the present application provides a computer program product which, when run on a computer, causes the computer to perform the method according to the first aspect and any one of its possible designs.
It may be appreciated that the benefits achieved by the apparatus for editing a message according to the second aspect and any one of the possible designs thereof, the message editor according to the third aspect, the chip system according to the fourth aspect, the computer storage medium according to the fifth aspect, and the computer program product according to the sixth aspect may refer to the benefits as in the first aspect and any one of the possible designs thereof, and are not repeated herein.
Fig. 1A is a schematic diagram of a communication system architecture according to an embodiment of the present application;
FIG. 1B is a schematic diagram of a message editor according to an embodiment of the present disclosure;
Fig. 1C is a schematic diagram of a communication system architecture according to an embodiment of the present application;
fig. 2 is a schematic diagram of a data structure of a message according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for editing a message according to an embodiment of the present application;
fig. 4 is an example schematic diagram of a message data structure provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of another example of a message data structure according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an editing unit according to an embodiment of the present application;
FIG. 7 is a schematic diagram of another message editor according to an embodiment of the present disclosure;
FIG. 8 is a flowchart of another method for editing a message according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of another message editor according to an embodiment of the present disclosure;
fig. 10 is a schematic diagram of an example of an edit message according to an embodiment of the present application;
fig. 11 is a schematic diagram of a device for editing a message according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a chip system according to an embodiment of the present application.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The character "/" in the present application generally indicates that the front-rear association object is an "or" relationship. For example, A/B may be understood as A or B.
The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
Furthermore, references to the terms "comprising" and "having" and any variations thereof in the description of the present application are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules but may include other steps or modules not listed or inherent to such process, method, article, or apparatus.
In addition, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "e.g." should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present concepts in a concrete fashion.
As technology advances, many businesses (e.g., autopilots, financial transactions, etc.) have increasingly placed higher demands on network latency and bandwidth. In the process of running the service, the message editor edits the rate of the message of the service, which can affect the network delay and bandwidth of the service.
In some solutions, there is one editing unit in the message editor. The editing unit can be called for multiple times to serially execute multiple editing commands in one message so as to complete editing of the message. The maximum packet rate of the message editor editing the message (the rate of editing the message per second) can be estimated by the following formula:
where ClockFrequency represents the clock frequency at which the editor operates, 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 edit unit is invoked. TotalPktLen represents the message length, including the total length of the microcode generated NHP and the PA written ORG PKT. BusWidth is the edit bus bit width. Celling (TotalPktLen/BusWidth, 1) represents 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 one message multiple times before it can start editing the next message. That is, when two messages need to be edited, the message editor can only edit each message in series, that is, can only edit one message after editing the other message, and the speed of editing the messages is low.
Therefore, the embodiment of the application provides a method for editing a message. In the method, a message editor comprises a plurality of editing units, and the plurality of editing units comprise a first editing unit and a second editing unit. The first editing unit can receive the first message and edit the first message to obtain the second message. And then, the first editing unit sends a second message to the second editing unit, and the second editing unit edits the second message.
In this way, the first editing unit sends the obtained second editing message to the second editing unit after editing the first message. Thus, 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 may edit the received new message when the second editing unit processes the second message. Thus, the message editor can edit a plurality of messages at the same time, thereby improving the rate of editing the messages. The method for editing the message can be applied to the process of editing the message by a message editor.
In some embodiments, the scheme provided by the embodiment of the application can be applied to an application scenario in which the intelligent network card chip processes data between a host and a network device. In this application scenario, one side of the intelligent Network card chip is connected to a Host (Host), and the other side of the intelligent Network card chip is connected to a Network device (Network). Illustratively, as shown in fig. 1A, one side of the intelligent 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 intelligent network card chip is connected to the network device through a medium access control (Media Access Control, MAC). The functional blocks of the intelligent network card chip shown in fig. 1A are described below.
And the PCIE/DMA module can be used for receiving and transmitting data between the intelligent network card chip and the host.
And the MAC module can be used for receiving and transmitting data between the intelligent network card chip and the network equipment.
A Packet Analyzer (PA) 0 may be configured to receive a Packet (hereinafter may be referred to as an original Packet) received by the MAC module from the network device, and perform type analysis on the Packet, so as to complete partial protocol verification, processing, and so on. The PA1 may be configured to receive a packet (hereinafter may be referred to as an original packet) received by the PCIE/DMA module from the network device, perform type analysis on the original packet, and complete partial protocol verification and processing. And, PA0 and PA1 may send the parsing result, the checking result, and the original message to the DBM.
The DBM comprises a message buffer for storing original messages and editing commands. Specifically, after receiving the parsing result, the verification result, and the original message sent by PA0 and PA1, the DBM may store the original message in a random access memory (Random Access Memory, RAM), and send a pointer and description information of the original message to a message dispatcher (Ingress Scheduler, ISCH). Also, the DBM may also receive requests from the ISCH and send the header (including the edit command) and the parsing result to Microcode (Processor Unit, PU)/(Microcode). The DBM can then receive the PU/micro code request and store the editing commands of the message into RAM. Then, the DBM may receive a request from an output message Scheduler (ESCH), splice an editing command of an original message and the original message into a message to be edited according to a data structure of a message required by a message Editor (PE), and send the message to be edited to the PE0/PE1.
ISCH is used to manage processor resources and order the original messages based on port and priority etc. And then, the ISCH dispatches the original message to the microcode according to a preset dispatching algorithm. And, ISCH sends notification message to DBM, make DBM send message header and analysis result to microcode.
PU/Microcode is a processor unit that consists of multiple threads. The processor unit runs microcode that is used to process multiple protocol messages. The microcode is specifically used for analyzing the original message according to the protocol, processing the original message to generate an editing command of the original message, and adjusting the arrangement sequence of the editing command. And, the microcode may initiate a request to the DBM, store an edit command in DMB, etc.
The ESCH may sort the messages to be edited based on the ports and the priorities, and schedule the messages to be edited according to a preset scheduling algorithm. The ESCH then sends the scheduling results to the DBM.
PE0/PE1 is responsible for editing messages to be edited.
Specifically, the PE1 is responsible for editing a message to be edited, which is 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 comprises a plurality of editing units,
Illustratively, as shown in FIG. 1B, the PE includes a message separation (CMD PKT Separator, CPS) module, a plurality of message editing units (Packet Editor Unit, PEU). Illustratively, the plurality of PEUs includes: PEU1, PEU2, PEU3 and PEU4.
The CPS module is used for analyzing the message to be edited and dividing the message to be edited into an editing command and a data payload. Each PEU is configured to complete 1 edit command in the message to be edited. The functional types of some PEUs may be the same among the PEUs, or the functional types of the PEUs may be different, which is not limited in the embodiment of the present application. For example, PEU1 and PEU2 may execute an add/delete/replace command (hdr_cmd), and PEU1 and PEU2 are edit units having an add/delete/replace data function; PEU3 can execute the command (tts_cmd) to calculate and replace TCP TIMESTAMP, and PEU3 is an editing unit having the function of calculating and replacing TCP TIMESTAMP; PEU4 may execute a command (CRC 32_cmd) to calculate the add CRC32, and PEU4 is an edit unit having a function to calculate the add CRC 32. Alternatively, PEU1, PEU2, PEU3, and PEU4 are all editing units having a function of adding/deleting/replacing data.
It should be noted that, the maximum packet rate of the message edited by the message editor shown in fig. 1B (the rate of editing the message per second) can be estimated by the following formula:
Where ClockFrequency represents the clock frequency at which the editor operates, in GHz. TotalCmdLen denotes the total length of the edit command, including 4B PKT_CMD_HDR,PE_CMD and the length of DMA CMD. TotalPktLen represents the message length, including the total length of the microcode generated NHP and the PA written ORG PKT. BusWidth is the edit bus bit width. Celling (TotalCmdLen/BusWidth, 1) represents the number of bus beats taken by the edit command. Celling (TotalPktLen/BusWidth, 1) represents the number of bus beats occupied by the message to be edited.
In the embodiment of the present application, the sequence of the plurality of editing units in the message editor is preset by a developer according to the service scenario.
In other embodiments, the solutions provided in the embodiments of the present application may also be applied to an application scenario where a network processor chip processes data between network devices. In the application scenario, both sides of the intelligent network card chip are connected with a network device. The network devices on both sides may be the same type of network device or different types of network devices, which is not limited in the embodiment of the present application.
For example, as shown in fig. 1C, one side of the intelligent Network card chip is connected to Network a through PCIE/DMA, and the other side of the intelligent Network card chip is connected to Network B through MAC. For a specific description of the functional module shown in fig. 1B, reference may be made to the description of the functional module shown in fig. 1A, which is not repeated here.
It should be noted that, the application scenario of the above intelligent network card chip for processing data between the host and the network device, and the application scenario of the network processor chip for processing data between the network device and the network device are merely illustrative of the application scenario of the embodiment of the present application, which is not limited.
The network device and the host in the embodiments of the present application may be a tablet computer, a mobile phone, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, a vehicle-mounted device, or the like, and the specific forms of the network device and the host are not particularly limited.
The execution main body of the method for editing the message provided by the application can be a device for editing the message, and the execution device can be a message editor shown in fig. 1B. Meanwhile, the execution device can also be a central processing unit (Central Processing Unit, CPU) of the message editor or an editing unit for editing the message in the message editor. In the embodiment of the present application, a method for editing a message by using an editing unit as an example is described.
Before describing the method of the embodiment of the present application, a description is first given of a data structure of a message to be edited (for example, a first message, a second message, etc.) provided by the embodiment of the present application.
Specifically, as shown in fig. 2, the message to be edited includes: PE command length PE_CMD_LEN, DMA command length DMA_CMD_LEN, RSV (reserved field for 4 byte alignment or future expansion), PE command PE CMDs (PE CMD1, PE CMD2, PE CMD 3, …, PE CMD n), DMA CMD, new header/data Payload (NHP), original data Payload (ORG PKT). Wherein PE_CMD_LEN, DMA_CMD_LEN, RSV, PE CMDs, DMA CMD, NHP are written into DBM by microcode; ORG PKT is written by PA into DBM.
For example, please refer to table 1, which shows an illustration of a data structure for a message to be edited.
TABLE 1
It should be noted that, the PE CMD1, the PE CMD2, the PE …, and the PE CMDn may be edit commands having the same function type, or edit commands having different function types, which is not limited in the embodiment of the present application. Each edit command has a unique identification (OPCODE, OPCD). The identification is used to indicate the function type of the edit command.
For example, please refer to table 2, which shows an illustration of HDR CMD.
TABLE 2
As can be derived from table 2, when opcd=4' h2, the edit command is hdr_cmd; HDR CMD is a variable length command, cmd_len indicates the total length of the HDR CMD, ILEN indicates the length of the variable length IDAT. For another example, when opcd=0x8 of the edit command, the edit command is TTS CMD. For another example, when opcd=4' h6 of the edit command, the edit command is CRC32CMD. For a description of the correspondence between the edit command and the OPCD, reference may be made to the prior art or hdr_cmd, which will not be described herein.
The method of the embodiment of the present application is 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, the first editing unit receives a first message.
The first message comprises a first command sequence and a first data payload, and the first command sequence is contained in the head of the first message. The first message also includes a first command sequence header. For example, referring to fig. 2, if the data structure of the packet shown in fig. 2 is the data structure of the first packet, the pe_cmd_len, dma_cmd_len, and RSV shown in fig. 2 are the first command sequence header, the PE CMDs (e.g., PE CMD1, PE CMD2, PE CMD3, and … … PE CMDn) are the first command sequence, and the NHP and ORG PKT are the first data payload. For the description of the first command sequence, the first command sequence header, and the first data payload, reference may be made to the description of fig. 2, which is not repeated here.
In an 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 for indicating the sequence of the arrangement of the plurality of editing commands in the first command sequence and is the same as the sequence of the editing units with different function types in the message editor.
Illustratively, in connection with FIG. 1B, if the message editor includes an add/delete/replace unit (i.e., PEU1 in FIG. 1B), a calculate and replace TCP TIMESTAMP unit (i.e., PEU3 in FIG. 1B), and a calculate and add CRC32 unit (i.e., PEU4 in FIG. 1B) in sequence, the add/delete/replace edit unit is the first edit 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 TCP TIMESTAMP command, the microcode may adjust the ordering of the plurality of edit commands in the first message sequence to an add/delete/replace command, a calculate and replace TCP TIMESTAMP command, and a calculate and add CRC32 command. For example, in connection with fig. 2, the first message sequence includes an add/delete/replace command (i.e., PE CMD1 in fig. 2), a calculate and replace TCP TIMESTAMP command (i.e., PE CMD2 in fig. 2), and a calculate and add CRC32 command (i.e., PE CMD3 in fig. 2) arranged in a first predetermined order.
It will be appreciated that since the editing unit can only intercept editing commands located at the head of the command sequence. Therefore, the plurality of editing commands in the first command sequence are ordered according to the sequence of the editing units with different function types in the message editor, so that the message editor can execute each editing command in the first command sequence, and the message editor is ensured to finish editing the message.
In some embodiments, the first editing unit may receive a first message from a third editing unit of the plurality of editing units, the first message being 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 not edited by the third editing unit, which is not limited in the embodiment of the present application. For example, after receiving the message a, the third editing unit edits the message a to obtain a message b (i.e., 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 (i.e., the first message) to the first editing unit.
In other embodiments, the first editing unit may receive the 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 a 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 (an editing command of an original message and the original message) that is spliced by the DBM according to a requirement of the message editor.
S302, the first detection unit judges whether the identification of the first editing unit is identical with the identification of the first editing command.
Wherein the first edit command is a first edit command in the first command sequence. For example, in connection 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, the PE CMD1 is the first edit command.
In one 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 identification of the first editing unit is the same as the identification of the first editing command, the first editing unit can edit the first message. Specifically, the first editing unit may perform S303. If 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. Specifically, the first editing unit may perform S304.
S303, if the identification of the first editing unit is the same as the identification 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.
For example, 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 edits the first data payload according to the first editing command to obtain the second message.
In this embodiment of the present application, the second packet includes a first command sequence after intercepting the first editing command and a first data payload after editing.
It will be appreciated that after the first editing unit intercepts the first editing command from the first command sequence, the editing command to which the first editing command corresponds will change. After the first editing unit intercepts the first editing command from the first command sequence, the first editing command corresponds to a next editing command of the editing commands intercepted by the first editing unit from the first command sequence. And, the first editing unit may edit the first data payload according to a first editing command intercepted from the first command sequence. Thus, after the first editing unit edits the first message, the first message changes, that is, the first editing unit may obtain the first command sequence after intercepting the first editing command and the edited first data payload.
The following describes a process of editing the first message by the first editing unit to obtain the second message with reference to fig. 4 and fig. 5. Illustratively, as shown in FIG. 4, 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 identification of the first editing unit is the same as the identification of the editing command a, the first editing unit intercepts the editing command a from the first command sequence, and configures editing parameters (such as OFFSET, LEN, etc.) of the first editing unit according to the editing command a. Then, the first editing unit edits the data payload a to obtain the intercepted command sequence and the edited data payload. As shown in fig. 5, the intercepted command sequence includes: the first editing command of the intercepted command sequence is an editing command b, and the data payload b is obtained by the first editing unit according to the editing command a for editing the data payload a.
S304, if the identification of the first editing unit is different from the identification 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.
For example, 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 processes the first message.
In some embodiments, the first editing unit includes a plurality of processing modules for processing the received messages. When the first editing unit sends the first message to the second editing unit, the first message may pass through a plurality of 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 not the same as the identification of the first editing command, the first editing unit does not edit the first message. Therefore, the first message passes through the plurality of processing modules in the first editing unit, so that the time for the first message to pass through the first editing unit can be prolonged, and the rate of editing the message by the message editor is reduced.
In order to reduce the time for the first message to pass through the first editing unit. The first editing unit may obtain a state value set of the first editing unit according to the first message after receiving the first message. The status value set of the first editing unit is used for indicating whether the first message passes through the complete first editing unit. The first editing unit may determine, according to the state value set, whether the first message passes through the complete first editing unit.
Exemplary, 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 state values includes: tts_cmd_en, vld_ff1 and vld_ff2. The Parser_TTS_CMD module is used for intercepting an editing command which is the same as the identification of the editing unit from the command sequence and storing parameters of the editing command. When the message passes through, the Parser_TTS_CMD module generates an editing request of the CALC_TTS module according to the edited OFS and the like, and provides editing parameters for the CALC_TTS module and the REP_TTS module. The calc_tts module is used to calculate the Time Stamp (TS) that needs to be replaced into the message, and then send 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. Output_ctrl is then used to OUTPUT data. Tts_cmd_en is used to indicate whether or not timestamp needs to be edited, vld_ff1 is used to indicate whether or not the calc_tts module is processing data, and vld_ff2 is used to indicate whether or not the rep_tts module is processing data.
If tts_cmd_en indicates that editing is not required, timestamp, VLD _ff1 indicates that the calc_tts module is not processing data (i.e. is in an idle state), and vld_ff2 indicates that the rep_tts module is not processing data (i.e. is in an idle state), the packet 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. 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 appreciated that by reducing the number of processing modules in the message passing through 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.
If tts_cmd_en indicates that 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 packet received by the PUE needs to go 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.
It can be understood 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 is indicated that the PEU is editing another message. Because the message editor is a serial editing message, that is, the message editor can only edit each message in turn. Therefore, the message needs to completely pass through the editing unit, so that the disorder of the sequence of the message edited by the message editor is avoided.
S305, the first editing unit sends a second message to the second editing unit, and the second editing unit processes the second message.
In some embodiments, the second editing unit may be a next editing unit of the plurality of editing units, the first editing unit being set in advance. 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 thereto. For example, in connection with fig. 1B, if the first editing unit is PEU1, the second editing unit is PEU2.PEU1 can send a message to PEU2. For another example, in connection with fig. 1B, if the first editing unit is PEU2, the second editing unit is PEU3.PEU2 can send a message to PEU3.
It will be appreciated that when the message editor processes messages of only one service scenario, the number of edit units of different function types required for messages of the same service scenario is similar. Therefore, a developer can reasonably configure the number and the sequence of a plurality of editing units in the message editor according to the service scene, reduce the number of invalid editing units (editing units which do not need to edit the message) for the message to pass, and improve the message editing speed of the message editor.
However, if the message editor can process messages of multiple different service scenarios, the number of required editing units of different function types is different due to different editing units of the function types required for the messages of different service scenarios. Therefore, there may be more editing units with different function types in the message editor, and the number of editing units is also larger. Thus, when the message editor edits a message, the message may pass through more invalid editing units, resulting in a reduced rate of editing the message by the message editor.
In other embodiments, the message editor increases the rate at which messages are edited in order to reduce the number of invalid editing units that the message passes through. The first editing unit may include a MUX module, and the second editing unit is a next editing unit of the first editing unit designated by the MUX module. The MUX module may send a message to a designated editing unit. That is, after the first editing unit obtains the second message, the first editing unit may send the second message to editing units not adjacent thereto.
Illustratively, the message editor includes a plurality of editing units, some of which may be configured to send to the MUX module. As shown in fig. 7, the PE includes: CPS, PEU1, PEU2, PEU3, PEU4, PEU5, PEU6, and PEU7. Wherein 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 message, and sends the second message to PEU3 (i.e., the second editing unit) through MUX 1. 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.
It should be noted that, a developer may configure a MUX module for a portion of the editing units according to the message of the service scenario that needs to be processed by the message editor, and a next editing unit (configuration of the MUX module) specified by the MUX module; alternatively, the developer may configure the MUX module for the message editor (i.e., 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 service scenario that the message editor needs to process. The embodiments of the present application are not limited in particular as to which editing units are configured with the MUX module, and the configuration of the MUX module.
It will be appreciated that by configuring the MUX module at the editing unit, the editing unit can send messages to the designated editing unit. Thus, the message editor can control the editing unit through which the message passes, and reduce the invalid editing unit through which the message passes, thereby improving the rate of editing the message by the message editor.
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. And, 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 description of S303 and will not be repeated here). Then, the second editing unit may send a fifth message to the fourth editing unit, and the fourth editing unit processes the fifth message. The fourth editing unit is a 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 a next editing unit of the second editing unit designated by the MUX module. For a specific description of the above procedure, reference may be made to S301-304, which are not repeated here.
If the identification of the second editing unit is different from the identification 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, and the fourth editing unit processes the second message.
It will be appreciated that since the message editor comprises a plurality of editing units. Therefore, the message editor can edit the message by the plurality of editing units in series through the scheme, thereby completing the editing of the message. And the message editor comprises a plurality of editing units, and the function types of the editing units are not identical, so that the message editor edits messages of various services. I.e. multiple services can multiplex editing units with the same editing function. Compared with the design of a message editor for each service, the scheme of the embodiment of the 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, in the case that the identification of the first editing unit is the same as the identification of the first editing command, the first editing unit edits the first message (the first command sequence and the first data payload) only according to the first editing command. That is, among the plurality of editing units, the identifications of the plurality of editing units have a correspondence relationship with the identifications of the plurality of editing commands in the editing command sequence. And the first editing unit only needs to edit the first message once, and does not need to edit the first message for multiple times. And then, the first editing unit sends the first command sequence after intercepting the first editing command and the edited first data payload (namely the second message) to the second editing unit, and the second editing unit processes the second message.
The message editor in the application comprises a plurality of editing units, and the plurality of editing units can edit one message in series. For example, after the first editing unit edits a message (e.g., a first message), the edited message (e.g., a second message) may be sent to the second editing unit, and the second editing unit edits the message to continue editing the message. Thus, 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 the new message. Thus, the message editor can edit a plurality of messages at the same time, and the message editing rate is improved.
For example, after the first editing unit receives the first message, the first editing unit may also receive a third message, and the message editor may edit the second message and the third message simultaneously. As shown in fig. 8, another method for editing a message provided in an embodiment of the present application may include S801-S805.
S801, the first editing unit receives a third message.
The third message comprises a second command sequence and a second data payload, the second command sequence comprises a plurality of editing commands arranged according to a second preset sequence, and the second command sequence is contained in the head of the third message.
It should be noted that, for the description of S801, reference may be made to the description of S301 in the embodiment of the present application, which is not 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/the second message to the second editing unit, the third message is placed in the buffer queue.
It will be appreciated that after the first editing unit receives the first message, the first editing unit is processing the first message before sending the first message/the second message to the second editing unit. Therefore, the first editing unit is temporarily unable to process the third message.
In other embodiments, the first editing unit may receive the third message after the first editing unit sends the second message to the second editing unit.
It will be appreciated 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. Thus, the first editing unit may process the received third message. Specifically, the first editing unit may perform S802-S805.
S802, the first editing unit judges whether the identification of the first editing unit is identical with the identification of the second editing command.
Wherein the second edit command is the first edit command in the second command sequence.
In one 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 identification of the first editing unit is the same as the identification of the second editing command, the second editing unit can edit the third message. Specifically, the first editing unit may perform S803. If the identification of the first editing unit is different from the identification of the second editing command, the first editing unit does not edit the third message. Specifically, the first editing unit may perform S804.
S803, if the identification of the first editing unit is the same as the identification 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.
The fourth message comprises a second command sequence after intercepting the second editing command and a second data payload after editing.
It should be noted that, for the description of S803 specifically, reference may be made to the description of S303 in this embodiment, which is not repeated here.
It will be appreciated 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 may edit the received third message.
S804, if the identification of the first editing unit is different from the identification 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.
It should be noted that, for the description of S804, reference may be made to the description of S304 in the embodiment of the present application, which is not repeated here.
S805, the first editing unit sends a fourth message to the second editing unit, and the second editing unit processes the fourth message.
It should be noted that, for the description of S805, reference may be made to the description of S305 in the 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. Thus, after the first editing unit sends the second message to the second editing unit, the first editing unit may edit the received third message. Thus, the message editor can edit a plurality of messages (the first editing unit edits the third message and the second editing unit edits the second message) at the same time, thereby improving the rate of editing the messages. And then the first editing unit edits the third message to obtain a 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 comprises a plurality of editing units. Therefore, the message editor can edit the message in series by a plurality of editing units in the mode so as to finish editing the message.
The following describes a method for designing a message editor according to an embodiment of the present application with reference to specific embodiments. For example, if the message editor in the embodiment of the present application supports message editing for four services of L2NIC, ROCEv1, ROCEv2 and TCP.
In this embodiment, the message editor needs to edit the messages of the four services L2NIC, ROCEv1, ROCEv2 and TCP. The message editor needs 4 edit units of HDR_CMD type and 4 edit units of CS_CMD type for editing the message of the L2NIC service; the message editor needs 3 edit units of HDR_CMD type and 1 edit unit of CRC_CMD type for editing the message of ROCEv1 service; the message editor needs 1 edit unit of HDR_CMD type, 1 edit unit of CRC_CMD type and 3 edit units of CS_CMD type for editing the message of ROCEv2 service; the message editor needs 2 editing units of hdr_cmd type, 1 editing unit of tts_cmd type and 4 editing units of cs_cmd type to edit the message of the TCP service.
Referring to table 3, the types of editing units and the number of editing units required by the message editor to edit messages of four services of L2NIC, ROCEv1, ROCEv2 and TCP are shown.
TABLE 3 Table 3
In summary, the message editor designed in the embodiment of the present application includes 4 editing units of hdr_cmd type, 1 editing unit of crc_cmd type, 1 editing unit of tts_cmd type, and 4 editing units of cs_cmd type.
Specifically, if the message editor needs to support the message editing of the four services of L2NIC, ROCEv1, ROCEv2 and TCP, the message editor may be designed as the message editor shown in fig. 9. The MUX module needs to be configured according to different service scenarios. That is, the MUX module is configured in a part of the service scenario, that is, the message does not pass through each editing unit in the message editor; in another part of the service scene, the MUX module is not configured, i.e., the message passes through each editing unit in turn.
It should be noted that the editing unit in the message editor must support all editing functions required by all services, but not all editing functions of a service are required for a specific message in the service. For example: the L2NIC service requires an editing unit of the cs_cmd type. However, for ARP messages in L2NIC traffic, no editing unit of cs_cmd type is required.
In the following, a process of editing a message by a message editor will be described taking as an example a message edited by an editing unit that only supports three levels of HDR CMD types.
Exemplary, as shown in fig. 10, it shows a process in which PKT1 is edited three times to obtain NEW PKT 4.
Specifically, please refer to table 4, which describes the process of editing the message PKT1 by the message editor.
TABLE 4 Table 4
It should be noted that, in combination with the formula two, in the above embodiment of the present application, the editing command sequence and the data payload occupy only a short packet under the condition of one beat of bus width, and the maximum packet rate can reach 1/2 of the working clock frequency of the message editor.
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 for transmission after analyzing the editing command length. By adopting a bus splicing scheme, the out-of-band signal indicates how many bytes in the bus are editing commands and how many bytes are messages. Thereafter, each editing unit may support editing commands and message data collages.
Thus, the editing command and the PKT occupy only short packets under the condition of one beat of bus width in total, and the maximum packet rate can reach the working clock frequency of the editor. However, if the bus splicing scheme is adopted, the complexity of design is increased. Therefore, in practical applications, it is recommended to choose a solution that is simple and low-cost to implement (i.e. a solution where the maximum packet rate can reach 1/2 of the working clock frequency of the message editor) in case of satisfying the performance.
The above description has been made mainly from the viewpoint of the editing unit. It will be appreciated that the editing unit, in order to implement the above-mentioned functions, comprises corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative method steps described in connection with the embodiments disclosed herein are capable of being implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or as software-driven hardware for an editing unit depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
According to the embodiment of the application, the function modules or the function units of the message editing device can be divided according to the method example, for example, each function module or each function unit can be divided corresponding to each function, and two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware, or in software functional modules or functional units. The division of the modules or units in the embodiments of the present application is merely a logic function division, and other division manners may be implemented in practice.
Fig. 11 is a schematic diagram of an apparatus for editing a message according to an embodiment of the present application. The device for editing the message may be a functional module in the message editor or the editing unit for implementing the method in the embodiment of the application. As shown in fig. 11, the apparatus for editing a message may include: a receiving module 1101, a processing module 1102 and a transmitting module 1103.
Wherein, the receiving module 1101 is configured to perform: and receiving the message. For example, the receiving module 1101 is configured to support the editing unit to perform S301 and S801 in the method embodiments described above, and/or other processes for the techniques described herein.
The processing module 1102 is configured to perform: judging whether the editing unit edits the message or not, and editing the message. For example, the processing module 1102 is configured to support the editing unit to perform S302, S303, S802, and S803 in the method embodiments described above, and/or other processes for the techniques described herein.
The sending module 1103 is configured to perform: and sending the message with the processed completion. For example, the sending module 1103 is configured to support the editing unit to perform S305, S304, S804, and S805 in the above-described method embodiments, and/or other processes for the techniques described herein.
The embodiment of the application also provides a message editor, which comprises a plurality of editing units, and can execute the functions or steps executed by the editing units in the embodiment of the method.
Embodiments of the present application also provide a chip system, as shown in fig. 12, that 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 circuit 1202 may be used to receive signals from other devices. For another example, interface circuit 1202 may be used to send signals to other devices (e.g., processor 1201). The interface circuit 1202 may, for example, read instructions stored in memory and send the instructions to the processor 1201. The instructions, when executed by the processor 1201, may cause the apparatus for editing a message to perform the steps of the embodiments described above. Of course, the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
The embodiment of the application also provides a computer storage medium, which comprises computer instructions, when the computer instructions run on the device for editing the message, the device for editing the message executes the functions or steps executed by the editing unit in the embodiment of the method.
The present application also provides a computer program product which, when run on a computer, causes the computer to perform the functions or steps performed by the editing unit in the method embodiments described above.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform 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 ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the 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)
- A method of editing a message, the method being applied to a message editor, the message editor comprising a plurality of editing units, the plurality of editing units comprising a first editing unit and a second editing unit, the method comprising:the first editing unit receives a first message, wherein the first message comprises a first command sequence and a first data payload, the first command sequence comprises a plurality of editing commands arranged according to a first preset sequence, and the first command sequence is contained in the head of the first message;if the identification of the first editing unit is the same as the identification of a 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 a first editing command in the first command sequence, and the second message includes the first command sequence after intercepting the first editing command and a first data payload after editing;The first editing unit sends the second message to the second editing unit, and the second editing unit processes the second message.
- The method of claim 1, wherein after the first editing unit receives the first message, the method further comprises:the first editing unit receives a third message, wherein the third message comprises a second command sequence and a second data payload, the second command sequence comprises a plurality of editing commands arranged according to a second preset sequence, and the second command sequence is contained in the head of the third message;wherein after the first editing unit sends the second message to the second editing unit, the method further comprises:if the identification of the first editing unit is the same as the identification of a second editing command, the first editing unit intercepts the second editing command from the second command sequence, edits the second data payload according to the second editing command, and obtains a fourth message; wherein the second editing command is a first editing command in the second command sequence, and the fourth message includes the second command sequence after intercepting the second editing command and a second data payload after editing;The first editing unit sends the fourth message to the second editing unit, and the second editing unit processes the fourth message.
- The method according to claim 1 or 2, wherein the first editing unit receives a first message, comprising:the first editing unit receives the first message from a third editing unit in the plurality of editing units, wherein the first message is the message processed by the third editing unit; or alternatively, the process may be performed,the first editing unit receives the first message from an upstream device of the message editor.
- A method according to any one of claims 1-3, characterized in that the method further comprises:and if the identification of the first editing unit is different from the identification 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.
- The method according to any one of claims 1 to 4, wherein the second editing unit is a next editing unit of the plurality of editing units, which is preset to the first editing unit; or alternatively, the process may be performed,The first editing unit further comprises a MUX module, and the second editing unit is a next editing unit of the first editing unit, which is designated by the MUX module.
- The device for editing the message is characterized by comprising the following components:the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a first message, the first message comprises a first command sequence and a first data payload, the first command sequence comprises a plurality of editing commands arranged according to a first preset sequence, and the first command sequence is contained in the head of the first message;the processing module is used for intercepting 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 editing the first data payload according to the first editing command to obtain a second message; wherein the first editing command is a first editing command in the first command sequence, and the second message includes the first command sequence after intercepting the first editing command and a first data payload after editing;and the sending module is used for sending the second message to a second editing unit, and the second editing unit processes the second message.
- The apparatus for editing a message as recited in claim 6, wherein,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, the second command sequence includes a plurality of editing commands arranged according to a second preset sequence, and the second command sequence is included in a header of the third packet;the processing module is further configured to intercept the second editing command from the second command sequence if the identifier of the first editing unit is the same as the identifier of the second editing command, and edit the second data payload according to the second editing command to obtain a fourth message; wherein the second editing command is a first editing command in the second command sequence, and the fourth message includes the second command sequence after intercepting the second editing command and a second data payload after editing;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.
- The apparatus 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 alternatively, the process may be performed,The receiving module is further specifically configured to receive the first message from an upstream device of the message editor.
- The apparatus for editing a message according to any of claims 6 to 8, wherein,the sending module is further configured to, if the identifier of the first editing unit is different from the identifier of the first editing command, transparently transmit the first message to the second editing unit, and process the first message by the second editing unit.
- The apparatus for editing a message according to any one of claims 6 to 9, wherein the second editing unit is a next editing unit of the plurality of editing units, which is preset to the first editing unit; or alternatively, the process may be performed,the first editing unit further comprises a MUX module, and the second editing unit is a next editing unit of the first editing unit, which is designated by the MUX module.
- A message editor, characterized in that the message editor comprises a plurality of editing units for performing the method of any of the claims 1-5.
- The chip system is characterized in that the chip system is applied to a message editing device; the system-on-chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a circuit; the interface circuit is used for receiving signals from a memory of the message editing device and sending the signals to the processor, wherein the signals comprise computer instructions stored in the memory; the apparatus for editing messages performs the method of any of claims 1-5 when the processor executes the computer instructions.
- A computer storage medium comprising computer instructions which, when run on a device for editing a message, cause the device for editing a message to perform the method of any of claims 1-5.
- A computer program product, characterized in that the computer program product, when run on a computer, causes the computer to perform the method according to any of claims 1-5.
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 |
---|---|
CN116458143A true CN116458143A (en) | 2023-07-18 |
Family
ID=81755194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202080106442.8A Pending CN116458143A (en) | 2020-11-30 | 2020-11-30 | Method and device for editing message |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116458143A (en) |
WO (1) | WO2022110174A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116346746B (en) * | 2023-05-12 | 2023-08-15 | 之江实验室 | Message processing method for multistage programmable editing |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015180130A1 (en) * | 2014-05-30 | 2015-12-03 | 华为技术有限公司 | Packet editing method and related device |
KR101826625B1 (en) * | 2016-08-04 | 2018-02-07 | 주식회사 한글과컴퓨터 | Document collaborative support apparatus supporting simultaneous editing of document and operating method thereof |
CN109729117B (en) * | 2017-10-30 | 2020-10-27 | 华为技术有限公司 | Message processing method, chip system and computer storage medium |
CN111818098B (en) * | 2020-09-01 | 2020-12-11 | 广东省新一代通信与网络创新研究院 | Message editing method and device and computer readable storage medium |
-
2020
- 2020-11-30 CN CN202080106442.8A patent/CN116458143A/en active Pending
- 2020-11-30 WO PCT/CN2020/132850 patent/WO2022110174A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2022110174A1 (en) | 2022-06-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7724740B1 (en) | Computer system and network interface supporting class of service queues | |
US7894480B1 (en) | Computer system and network interface with hardware based rule checking for embedded firewall | |
US20080270630A1 (en) | Hardware control interface for IEEE standard 802.11 including transmission control interface component | |
US9479464B1 (en) | Computer system and network interface with hardware based packet filtering and classification | |
US7313104B1 (en) | Wireless computer system with latency masking | |
CN111163018B (en) | Network equipment and method for reducing transmission delay thereof | |
US9652420B2 (en) | Hardware control interface for IEEE standard 802.11 | |
US11671678B2 (en) | Method and device, equipment, and storage medium for data processing | |
EP4350515A1 (en) | Load balancing method for multi-thread forwarding, and related apparatus | |
CN113630889A (en) | Method for dynamically changing minimum candidate resource ratio in mode 2 resource selection | |
CN112527709A (en) | PCIe expansion exchange system, method, electronic equipment and storage medium | |
CN116458143A (en) | Method and device for editing message | |
CN115904259A (en) | Processing method and related device for NVMe (non-volatile memory) standard instruction | |
CN112243258A (en) | Method and device for determining user perception rate | |
WO2019153297A1 (en) | Data transmission method, apparatus, computer device and storage medium | |
CN111193650A (en) | Node receiving and dispatching control device based on SAE AS5643 standard | |
US20090129355A1 (en) | Apparatus of transmitting packets of wireless local network and method for using the same | |
US7069557B2 (en) | Network processor which defines virtual paths without using logical path descriptors | |
EP4075743A1 (en) | Secure computing control method, data packet processing method and device and system thereof | |
CN114071683B (en) | Data transmission method and device and electronic equipment | |
US20240107457A1 (en) | Method and apparatus for information reception, receiving device, storage medium and program product | |
CN114071569B (en) | Data transmission method and device and electronic equipment | |
US10701001B2 (en) | Wireless communication circuit with scheduling circuit in MAC layer | |
US20140344829A1 (en) | Data processing method of shared resource allocated to multi-core processor, electronic apparatus with multi-core processor and data output apparatus | |
CN111124987A (en) | PCIE-based data transmission control system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |