CN100479432C - Text edition circuit and method - Google Patents

Text edition circuit and method Download PDF

Info

Publication number
CN100479432C
CN100479432C CNB2005101002823A CN200510100282A CN100479432C CN 100479432 C CN100479432 C CN 100479432C CN B2005101002823 A CNB2005101002823 A CN B2005101002823A CN 200510100282 A CN200510100282 A CN 200510100282A CN 100479432 C CN100479432 C CN 100479432C
Authority
CN
China
Prior art keywords
message
message editing
look
module
editing instruction
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.)
Expired - Fee Related
Application number
CNB2005101002823A
Other languages
Chinese (zh)
Other versions
CN1949736A (en
Inventor
石磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2005101002823A priority Critical patent/CN100479432C/en
Publication of CN1949736A publication Critical patent/CN1949736A/en
Application granted granted Critical
Publication of CN100479432C publication Critical patent/CN100479432C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a message editing circuit, comprising message input end, message transmission engine module, message editing module and message output end, connected in sequence, where message editing instruction set is constructed in the message transmission engine module, and a look-up table is constructed in the message editing module. And the invention also relates to a message editing method, where input message firstly enters a transmission engine and is transmitted by transmission table, it uses the message editing instruction set to analyze and generate message editing instructions, and the message editing module makes message editing instruction translation in contrast with the lool-up table and executes message editing action and makes bit sequence regulation and then outputs the edited message. And the look-up table can be implemented by dual port RAM, the contents of the look-up table is configured by CPU, and the look-up table can also be implemented by ROM and is updated, regularly. And the invention simplifies message editing action, and can save large numbers of required resources for logic determination and implement programmable message editing, and has good extensibility.

Description

A kind of text edition circuit and method
Technical field
The present invention relates to data processing technique, specifically is a kind of text edition circuit and method.
Background technology
The message editing module is the key modules of data characteristic chip, realizes the editting function to message, and along with the continuous development of data service, the complexity of message editing is more and more higher, and the message editing type that needs to support gets more and more.Such as the data characteristic chip of realizing that mpls transmits, the mpls forwarding is based on the label exchange, transmits route according to label decision message, and this chip need add the operation of label, deletion label and switch label to message, therefore, message editing is the indispensable feature of this chip.
Present text edition circuit as shown in Figure 1, comprises message input, message forwarding engine module, message editing module and message output that order links to each other.Be one in the message message forwarding engine module and transmit, comprise message editing action logic translation module, message editing action Executive Module and position preface adjusting module in the message editing module.
Corresponding message editing method mainly is that logical translation is carried out in the message editing action, carries out the message editing action then, logical translation is carried out in editor's action of message need carry out logic determines.Its realization mechanism is as depicted in figs. 1 and 2:
Treat that editing data enters text edition circuit, obtain the message forwarding behavior, for example carry out label forwarding according to transmitting, perhaps according to vlan, MAC Address forwarding etc.;
Message editing action logic translation module carries out logical translation to the message forwarding behavior, its concrete operations are to utilize a series of condition judgment statement to judge, thereby obtain the message editing action, this action can be that data fifo and new of adding content ram are read generic sequence;
Message editing action Executive Module is controlled data fifo and is added reading of content ram according to the generic sequence of reading that translation obtains, and promptly carries out message editing;
Position preface adjusting module reading of data from fifo, because message adds and deletion has caused vacancy on data/address bus, as shown in Figure 3, such as data/address bus 32bit, having only high 16bit is valid data, therefore need adjust,, guarantee the first-in first-out order of message simultaneously to eliminate byte or bit vacancy.
At last, export editing data.
In this message editing method, message editing action logic translater carries out logical translation to the message editing action, need take a large amount of logical resources, because will carry out logic determines respectively to each message editing action, and because message editing has changed the structure of original message, must adjust accordingly status signal positions such as packet header indications, also need to calculate the position of new packet header indication, therefore, when the message editing type increases, the resources of chip that consumes rises at double, has increased the complexity of system greatly;
Simultaneously, a kind of message editing of every increase action, needing increases corresponding interpretation logic, and existing method do not possess the ability that dynamically updates, and therefore, the extensibility of the message editing action being carried out logical translation is relatively poor;
In addition, the complexity that message editing action logic translater carries out logical translation to message editing action is higher, need take a plurality of clock cycle could realize, has reduced the efficient of system to the message processing.
Summary of the invention
The objective of the invention is to reduce the processing complexity of message editing, save logical resource, improve the efficient that message is handled, and make message editing have good autgmentability.
According to above-mentioned purpose, the invention provides a kind of text edition circuit, comprise message input, message forwarding engine module, message editing module and message output that order links to each other, message forwarding engine module is analyzed incoming message according to transmitting with the message editing instruction set, generation message editing instruction, the message editing module receives the message editing instruction, message is edited after the output of message output according to look-up table.
Wherein, message forwarding engine module comprises:
Transmit, obtain the message forwarding behavior;
Message editing instruction generation module is converted into the message editing instruction according to the message editing instruction set with described message forwarding behavior.
The message editing module message editing module of described text edition circuit comprises again:
Message editing instruction translation module is translated edit instruction according to look-up table;
Message editing instruction Executive Module according to the instruction of the message editing after the described translation, is carried out the interpolation and the deletion action of message;
Position preface adjusting module carries out a preface adjustment to the message behind the editor, eliminates byte or bit vacancy.
Based on described goal of the invention, the present invention also provides a kind of message editing method, comprises the steps:
A, structure message editing instruction set and look-up table;
B, forwarding engine module are analyzed the message of input according to transmitting with the message editing instruction set, generate the message editing instruction;
C, message editing module receive the message editing instruction, find corresponding explanatory content in described look-up table, according to described explanatory content message are edited.
Step C specifically comprises the steps: again
According to look-up table translation message editing instruction;
Carry out the message editing instruction after translating;
Message behind the editor is carried out a preface adjustment.
The structure of described message editing instruction set is message editing to be decomposed into add and peel off two actions and encode.
Described look-up table explanatory content comprises that message adds indication, adds content indication and message deletion indication.
The look-up table explanatory content further comprises: the content that the positional information of regeneration packet header index signal and script need logic determines.
The content of described message editing instruction set and look-up table utilizes two-port RAM to realize, is configured by CPU, realizes the able to programme of message editing.
Described message editing instruction set and look-up table can also realize that the mode of utilizing new table to replace old table is added new message editing command information by ROM.
The analysis that the present invention utilizes the message editing instruction set to carry out the message editing instruction generates, and various message editing action normalization can be simplified editor's action, helps the execution of message editing action, and supports a large amount of message editing types, and extensibility is good; Utilize look-up table to explain the message editing instruction, realize the translation of message editing instruction, can save the resource that a large amount of logic determines need, help improving message editing speed, and look-up table can programme arbitrarily, thereby make message editing have more flexibility; Adopt the mode of message editing instruction set, can support a large amount of message editing types.The text edition circuit of this kind framework and message editing method have the efficient height, save resource, extendible advantage.
Description of drawings
Fig. 1 is the text edition circuit figure of prior art;
Fig. 2 is the message editing method of prior art;
Fig. 3 is that the position preface of prior art is adjusted schematic diagram;
Fig. 4 is text edition circuit figure of the present invention;
Fig. 5 is a message editing flow chart of the present invention;
Fig. 6 is a message editing module work sheet of the present invention.
Embodiment
With embodiment the present invention program is described in further detail with reference to the accompanying drawings below.
As shown in Figure 4, among the present invention program, the structure of text edition circuit is as follows:
Text edition circuit comprises message forwarding engine module and message editing module.
Message forwarding engine module comprises Label Forwarding Information Base and message editing instruction generation module again;
The message editing module comprises message editing instruction translation module message editing instruction Executive Module and position preface adjusting module again.
Wherein, message editing instruction generation module is provided with the message editing instruction set; Be provided with look-up table in the message editing instruction translation module.
The message editing instruction set is according to the characteristics structure of message editing, the example that is compiled as with the mpls message, the editor of mpls message comprises interpolation, deletion and the replacement of label, by searching the Label Forwarding Information Base in the forwarding engine, obtain the action of mpls message forwarding, mpls message such as 2 layers of label, the message forwarding behavior of looking into the Label Forwarding Information Base acquisition is the top-level tab exchange, the level of abstraction of this information is higher, be unfavorable for the identification of hardware circuit, need instruct generation module to provide more specifically message editing instruction by message editing.
The aufbauprinciple of message editing instruction is as follows:
The top-level tab switching motion of 2 layers of mpls message can be decomposed into following 2 actions:
1, peels off old content, comprise link layer header and top-level tab;
2, add new content, comprise new link layer header and new top-level tab.
The action of mpls message forwarding can be decomposed into interpolation (push) and peel off (pop) operation like this, because different type of message editor features is different, therefore also need to comprise type of message information in the message editing instruction, the message editing instruction need comprise like this: type of message+message adds action+message deletion action;
To above-mentioned information coding, can obtain a message editing instruction.Mapping relations have been set up in abstract message editing information of obtaining from Label Forwarding Information Base like this and concrete message editing instruction, by the message editing movement decomposition with complexity is that message adds action and message deletion action, thereby realized the normalization of message editing action, be beneficial to hardware and realize.
The message editing of any type can be decomposed into interpolation and peel off, and according to this principle coding, can obtain the message editing instruction set.
The message forwarding engine utilizes the message editing instruction set to obtain the message editing instruction, because the message editing instruction only comprises the editor that need carry out which kind of type to message, and do not know how to edit, such as deleting what bytes, add what bytes, these informational needs are translated acquisition to the message editing instruction, and look-up tables'implementation is passed through in the translation of message editing instruction, the edit instruction that promptly utilizes message obtains carrying out the concrete operations of message editing as the indexed search look-up table.Table 1 is a look-up table example:
Table 1 message editing instruction lookup table example
Bit Name Description
15 ltem_val The list item significant notation
14:10 sop_position The position indication of regeneration heading
9 s1_val Add the content indication, effective at the bottom of the ground floor label stack
8 s2_val Add the content indication, effective at the bottom of the second layer label stack
7:4 add_byte_number Message adds indication
3:0 del_byte_number Message deletion indication
Key message in the look-up table is that message adds indication, adds content indication, message deletion indication and other information.
Whether list item significant notation (Item_val) indicates this message editing instruction can explain, for the message editing instruction of not explaining, by abandoning of this list item may command message.
Message adds indication (add_byte_number), is meant the byte number that needs interpolation, need insert new link layer header and new label such as the top-level tab exchange for aforementioned 2 layers of mpls message on data/address bus.
Add content indication (s1_val, s2_val), being meant needs the content of adding, and needs to insert at the bottom of the stack of new label attribute etc. such as the top-level tab exchange of aforementioned 2 layers of mpls message.
Message deletion indication (del_byte_number), be meant the byte number that needs interpolation, need old link layer header of deletion and old label such as top-level tab exchange for aforementioned 2 layers of mpls message, then then pass through to revise whether effectively attribute of heading, carry out the deletion of old heading at old heading.
Regeneration heading position indication (sop_position) is meant because message editing has changed the position of heading, needs to specify new heading position by this list item.
Can also add some other information in the look-up table, promptly originally need the content of logic determines to obtain by look-up table.
Look-up table can be realized by ROM, presets crucial message editing information to ROM.When having new message editing type to increase, then substitute former table with the look-up table after upgrading.
Look-up table can also utilize two-port RAM to realize that the content by CPU disposes look-up table then can realize the able to programme of message editing.On-the-fly modify the content of look-up table on the one hand as required, increase the flexibility of message editing; On the other hand, increase new message editing type, then only need to give new coded command for new message editing type, and increase explains that list item gets final product in look-up table as need.
As shown in Figure 5 and Figure 6, complete message editing process is as follows:
1, incoming message at first enters the forwarding engine module;
2, obtain the message forwarding action according to transmitting;
3, according to the message editing instruction set message forwarding behavior is analyzed, generated the edit instruction of message;
4, message editing instruction translation module contrast look-up table is translated the message editing instruction;
The message editing instruction translation partly is exactly a message editing instruction lookup table.
The message editing instruction is prior to waiting that editing message arrives, so that message editing instruction translation module makes an explanation to the message editing instruction in advance, with the message editing instruction is index, the contrast look-up table is translated message editing instruction and can be obtained concrete message and revise action, comprises that message deletion indication, message add indication and message and add Edition Contains and indicate three parts.
5, message editing instruction Executive Module is carried out the message editing instruction after translating;
The interpolation operating part of message editing instruction Executive Module adds indication according to message and insert the interpolation content on data/address bus, and writes fifo; The deletion operating part writes fifo then according to deletion indication deletion message.
6, position preface adjusting module carries out a preface adjustment to the message after editing;
7, with the adjusted message output of position preface.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with the people of this technology in the disclosed technical scope of the present invention; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.

Claims (10)

1, a kind of text edition circuit, it is characterized in that, comprise message input, message forwarding engine module, message editing module and message output that order links to each other, message forwarding engine module is analyzed incoming message according to transmitting with the message editing instruction set, generation message editing instruction, the message editing module receives the message editing instruction, message is edited after the output of message output according to look-up table.
2, text edition circuit according to claim 1 is characterized in that, message forwarding engine module comprises:
Transmit, obtain the message forwarding behavior;
Message editing instruction generation module is converted into the message editing instruction according to the message editing instruction set with described message forwarding behavior.
3, text edition circuit according to claim 1 is characterized in that, the message editing module comprises:
Message editing instruction translation module is translated the message editing instruction according to look-up table;
Message editing instruction Executive Module according to the instruction of the message editing after the described translation, is carried out the interpolation and the deletion action of message;
Position preface adjusting module carries out a preface adjustment to the message behind the editor, eliminates byte or bit vacancy.
4, a kind of message editing method is characterized in that,
A, structure message editing instruction set and look-up table;
B, forwarding engine module are analyzed the message of input according to transmitting with the message editing instruction set, generate the message editing instruction;
C, message editing module receive the message editing instruction, find corresponding explanatory content in described look-up table, according to described explanatory content message are edited.
5, message editing method according to claim 4 is characterized in that step C specifically comprises the steps:
According to look-up table translation message editing instruction;
Carry out the message editing instruction after translating;
Message behind the editor is carried out a preface adjustment.
6, message editing method according to claim 4 is characterized in that, the structure of message editing instruction set is message editing to be decomposed into add and peel off two actions and encode.
7, message editing method according to claim 4 is characterized in that, the look-up table explanatory content comprises that message adds indication, adds content indication and message deletion indication.
8, message editing method according to claim 7 is characterized in that, the look-up table explanatory content comprises the positional information of regeneration packet header index signal and needs the content of logic determines originally.
According to claim 4,6 or 7 described message editing methods, it is characterized in that 9, message editing instruction set and look-up table utilize two-port RAM to realize, are configured by CPU, realize the able to programme of message editing.
According to claim 4,6 or 7 described message editing methods, it is characterized in that 10, message editing instruction set and look-up table realize that by ROM the mode of utilizing new table to replace old table is added new message editing command information.
CNB2005101002823A 2005-10-10 2005-10-10 Text edition circuit and method Expired - Fee Related CN100479432C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101002823A CN100479432C (en) 2005-10-10 2005-10-10 Text edition circuit and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101002823A CN100479432C (en) 2005-10-10 2005-10-10 Text edition circuit and method

Publications (2)

Publication Number Publication Date
CN1949736A CN1949736A (en) 2007-04-18
CN100479432C true CN100479432C (en) 2009-04-15

Family

ID=38019125

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101002823A Expired - Fee Related CN100479432C (en) 2005-10-10 2005-10-10 Text edition circuit and method

Country Status (1)

Country Link
CN (1) CN100479432C (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651629B (en) * 2009-09-17 2012-05-23 杭州华三通信技术有限公司 Method and equipment for dynamic grading scheduling of CPU receiving messages
CN102916984B (en) * 2011-08-01 2016-10-26 腾讯科技(深圳)有限公司 The method and system that a kind of picture editor's action is shared
WO2015180130A1 (en) * 2014-05-30 2015-12-03 华为技术有限公司 Packet editing method and related device
CN108200024A (en) * 2017-12-26 2018-06-22 盛科网络(苏州)有限公司 A kind of Ethernet message editing device and method
CN110011940B (en) * 2019-04-11 2021-06-04 盛科网络(苏州)有限公司 Message processing device and method
CN110011920B (en) * 2019-04-11 2021-03-23 盛科网络(苏州)有限公司 Message processing method and device
CN114363258B (en) * 2022-03-17 2022-12-06 中国人民解放军国防科技大学 Message processing device
CN116170527B (en) * 2023-02-16 2023-11-07 南京金阵微电子技术有限公司 Message editing method, message editing device, medium and electronic equipment

Also Published As

Publication number Publication date
CN1949736A (en) 2007-04-18

Similar Documents

Publication Publication Date Title
CN100479432C (en) Text edition circuit and method
CN102480462B (en) Universal protocol adapting method and device
CN100407701C (en) Network processor
CN110297797B (en) Heterogeneous protocol conversion device and method
CN102281192B (en) The cell processing method and processing device of exchange network chip
CN101931835B (en) Method and device for realizing VLAN (Virtual Local Area Network) convergence and conversion in EPON (Ethernet Passive Optical Network)
CN111917753B (en) Modbus TCP message analysis method based on bit field
CN111277480B (en) Method and system for discarding high-availability seamless redundant looped network repeat frame
CN102255687A (en) Rate matching method and device thereof
CN110324204B (en) High-speed regular expression matching engine and method implemented in FPGA (field programmable Gate array)
CN114666681B (en) Stateful in-band network telemetry method and system
CN102014065A (en) Method for analyzing packet headers, header analysis preprocessing device and network processor
CN110493310B (en) Software defined protocol controller and method
CN103699399A (en) Method of causing partially-configurable FPGA (Field Programmable Gate Array) chip system to have high reliability
US7088680B1 (en) System and method for digital communication via a time division multiplexed serial data stream
CN103888189B (en) It is applicable to the single fiber looped network means of communication of extensive power electronic system
CN100552660C (en) A kind of data handling system and data processing method
CN116032837A (en) Flow table unloading method and device
CN116074232A (en) Processing method for generating vehicle-mounted gateway routing table based on DBC file analysis
CN101604973A (en) The coding method of chip identification serial number and device thereof
CN100563378C (en) On frame structure, realize the circuit and the switching method thereof of time division multiplexing exchange
CN108540313B (en) Method for acquiring circuit structure of northbound interface based on type identifier
CN101478427B (en) Method for accelerating PBT tunnel failure fast switching
CN101436131A (en) Method and system for implementing repeat operation in interactive operation software
CN101599820B (en) Data description method of serial transmission interface and correlated grouping and testing system thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090415

Termination date: 20161010

CF01 Termination of patent right due to non-payment of annual fee