[go: up one dir, main page]

CN101420417B - Scanning circuit for data content and its scanning method - Google Patents

Scanning circuit for data content and its scanning method Download PDF

Info

Publication number
CN101420417B
CN101420417B CN200710180299A CN200710180299A CN101420417B CN 101420417 B CN101420417 B CN 101420417B CN 200710180299 A CN200710180299 A CN 200710180299A CN 200710180299 A CN200710180299 A CN 200710180299A CN 101420417 B CN101420417 B CN 101420417B
Authority
CN
China
Prior art keywords
data
circuit
label
scanning
batch
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.)
Active
Application number
CN200710180299A
Other languages
Chinese (zh)
Other versions
CN101420417A (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.)
Realtek Semiconductor Corp
Original Assignee
Realtek Semiconductor Corp
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 Realtek Semiconductor Corp filed Critical Realtek Semiconductor Corp
Priority to CN200710180299A priority Critical patent/CN101420417B/en
Publication of CN101420417A publication Critical patent/CN101420417A/en
Application granted granted Critical
Publication of CN101420417B publication Critical patent/CN101420417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Logic Circuits (AREA)

Abstract

The invention relates to a scanning circuit and method of a data content, store a plurality of label data by a memory circuit, and each label data corresponds to a sub rule, the memory circuit is used for receiving a first input data and outputting a first part bit in a first label data to an arithmetic circuit and receiving a second input data and outputting a second part bit of a second label data to the arithmetic circuit; the arithmetic circuit performs logic operation on the first part of bits and the second part of bits to output an operation result; a judgment circuit receives the operation result and judges whether the input data conforms to a predetermined rule according to the operation result, so that the complexity of the circuit can be saved, the cost can be saved, and the scanning efficiency can be improved.

Description

数据内容的扫描电路与其扫描方法Scanning circuit for data content and its scanning method

技术领域technical field

本发明有关于一种数据内容扫描电路,其尤其指一种网络数据内容的扫描电路与扫描方法。The present invention relates to a data content scanning circuit, in particular to a network data content scanning circuit and scanning method.

背景技术Background technique

现今电脑科技的技术越来越发达,传输速率与传输频宽也随着科技的进步而提高,因此可传送的数据流量也就越大。由于各种因素,在传输中的数据可能会因此夹带病毒或是广告网页等,进而拖慢系统的处理速度甚至使系统中毒而无法正常运作。因此,现今系统的许多应用中,像是网络管理交换器(Web Switch)、负载平衡器(Load balancer)以及病毒防御等等,会对数据的内容逐一检查,以避免发生上述问题,此即为内容扫描(contentscanning)。Nowadays, computer technology is more and more developed, and the transmission rate and transmission bandwidth are also improved with the advancement of technology, so the data flow that can be transmitted is also greater. Due to various factors, the data in transmission may contain viruses or advertising webpages, etc., which will slow down the processing speed of the system or even cause the system to be poisoned and fail to operate normally. Therefore, in many applications of the current system, such as network management switch (Web Switch), load balancer (Load balancer) and virus defense, etc., the content of the data will be checked one by one to avoid the above problems, which is Content scanning (contentscanning).

请参阅图1,为公知技术的数据内容的扫描电路。如图所示,扫描电路10’包括多比较器20’,该多个比较器20’由于不确定所要搜寻的包数据的内容在哪个位置,所以必须要对此包数据的所有内容逐一扫描,以确保不会有扫描遗漏的情形发生,如图1所示,在比对完此包数据的第一字节到第五字节后,接着必须比对第二字节到第六字节,因此通常必须将第二字节到第五字节先寄存起来,以作为下一次比对的用。又,由于扫描电路应用范围较广,且每种应用分类的依据皆有所不同,故每个规则(rules)的长度亦会有所不同,例如当需要扫描的规则共有10个,但其中规则的长度最短的可能仅有两三个字节(Bytes),但最长的规则却可能有几十个字节。现今为解决上述的每一个规则的长短不同的问题,会设定每一个规则的大小一定,若要设定较短的规则,则设置一掩模22’(mask),再用比较器20’比对以确认是否符合所要扫描的数据,如此不但浪费额外的寄存空间以作为比较之用,同时在电路实作上亦较为复杂,且对于较长的规则需有较大的寄存空间。Please refer to FIG. 1 , which is a scanning circuit of data content in the known technology. As shown in the figure, the scanning circuit 10' includes multiple comparators 20'. Since the multiple comparators 20' are not sure where the content of the packet data to be searched is, they must scan all the contents of the packet data one by one. To ensure that there will be no scanning omissions, as shown in Figure 1, after comparing the first byte to the fifth byte of the packet data, then the second byte to the sixth byte must be compared, Therefore, usually the second byte to the fifth byte must be registered first for the next comparison. In addition, since the scanning circuit has a wide range of applications, and the classification basis of each application is different, the length of each rule (rules) will also be different. For example, when there are 10 rules that need to be scanned, but the rules The shortest length of the rule may only be two or three bytes (Bytes), but the longest rule may have dozens of bytes. Nowadays, in order to solve the above-mentioned problem that the length of each rule is different, the size of each rule is set to be constant. If a shorter rule is to be set, a mask 22' (mask) is set, and a comparator 20' is used to Comparing to confirm whether it matches the data to be scanned, not only wastes extra storage space for comparison, but also complicates circuit implementation, and requires a larger storage space for longer rules.

因此本发明针对上述问题而提出一种数据内容的扫描电路与方法,可节省电路面积,又可动态设定扫描规则的长度,以增加扫描的灵活性,并可缩短扫描时间。Therefore, the present invention proposes a scanning circuit and method for data content, which can save circuit area, and can dynamically set the length of scanning rules to increase scanning flexibility and shorten scanning time.

发明内容Contents of the invention

本发明的目的之一,在于提供一种数据的扫描电路与方法,扫描出输入数据的部分数据是否符合扫描规则,以达节省电路的复杂度、节省成本与提高扫描效率的目的。One of the objectives of the present invention is to provide a data scanning circuit and method to scan whether part of the input data conforms to the scanning rules, so as to save the complexity of the circuit, save the cost and improve the scanning efficiency.

本发明的目的之一,在于提供一种数据的扫描电路与方法,其可动态设定扫描规则的长度,以增加扫描的灵活性。One of the objectives of the present invention is to provide a data scanning circuit and method, which can dynamically set the length of scanning rules, so as to increase the flexibility of scanning.

本发明的目的之一,在于提供一种数据的扫描电路与方法,其可得知符合扫描规则的数据于该多个输入数据中的位置。One of the objectives of the present invention is to provide a data scanning circuit and method, which can know the position of the data conforming to the scanning rule among the plurality of input data.

本发明的数据的扫描电路与方法,其包括一存储电路、一运算电路与一判断电路,存储电路存储多个标签数据,且每一标签数据对应至一子规则,当一第一输入数据传送至存储电路而输出该多个标签数据的一第一部分位,并传送至运算电路,一第二输入数据传送至存储电路而输出该多个标签数据的一第二部分位,并传送至运算电路,运算电路逻辑运算第一部分位与第二部分位产生一运算结果,判断电路接收运算结果而判断输入数据是否符合预定的规则。The data scanning circuit and method of the present invention include a storage circuit, an arithmetic circuit and a judgment circuit. The storage circuit stores a plurality of label data, and each label data corresponds to a sub-rule. When a first input data is transmitted A first partial bit of the plurality of tag data is output to the storage circuit, and sent to the arithmetic circuit, and a second input data is sent to the storage circuit, and a second partial bit of the plurality of tag data is output, and sent to the arithmetic circuit The operation circuit logically operates the first part of bits and the second part of bits to generate an operation result, and the judging circuit receives the operation result to judge whether the input data conforms to a predetermined rule.

附图说明Description of drawings

图1为公知技术的数据扫描电路;Fig. 1 is the data scanning circuit of known technology;

图2为本发明的一较佳实施例的方块图;Fig. 2 is a block diagram of a preferred embodiment of the present invention;

图3为本发明的一较佳实施例的电路图:以及Fig. 3 is the circuit diagram of a preferred embodiment of the present invention: and

图4为本发明的另一较佳实施例的方块图。FIG. 4 is a block diagram of another preferred embodiment of the present invention.

主要元件符号说明Description of main component symbols

10’扫描电路10' scanning circuit

20’比较器20' Comparator

22’掩模22' mask

10  实体层装置10 physical layer device

20  存储电路20 storage circuit

22  第一存储电路22 first storage circuit

24  第二存储电路24 Second storage circuit

26    序列单元26 sequence units

30    运算电路30 arithmetic circuit

32    触发器32 triggers

34    逻辑单元34 logic units

36    隔离单元36 isolation units

40    判断电路40 judgment circuit

50    处理电路50 processing circuits

60    计数单元60 counting units

70    媒体存取控制器70 Media Access Controller

80    数据扫描电路80 data scanning circuit

具体实施方式Detailed ways

为使本发明的结构特征及所达成的功效有更进一步的了解与认识,以较佳的实施例及配合详细的说明,说明如后:In order to make the structural features of the present invention and the achieved effects have a further understanding and understanding, with preferred embodiments and detailed descriptions, the descriptions are as follows:

请一并参阅图2与图3,其为本发明的一较佳实施例的方块图与电路图。如图所示,此实施例应用于网际网络以扫描网络的包数据,像是网络管理交换器(Web Switch)或负载平衡器(Load balancer),但本发明并不局限应用于网际网络。此实施例包括一实体层装置10(Physical,PHY)与一媒体存取控制器70(Media Access Control,MAC);该媒体存取控制器70包含一数据扫描电路80与一处理电路50;数据扫描电路80还包含一存储电路20、一运算电路30以及一判断电路40。实体层装置10接收输入数据,输入数据包含多数据,由于此实施例为应用于网际网络中,所以输入数据为网际网络的一包数据。Please refer to FIG. 2 and FIG. 3 together, which are a block diagram and a circuit diagram of a preferred embodiment of the present invention. As shown in the figure, this embodiment is applied to the Internet to scan the packet data of the network, such as a web switch (Web Switch) or a load balancer (Load balancer), but the present invention is not limited to be applied to the Internet. This embodiment includes a physical layer device 10 (Physical, PHY) and a media access controller 70 (Media Access Control, MAC); the media access controller 70 includes a data scanning circuit 80 and a processing circuit 50; The scanning circuit 80 further includes a storage circuit 20 , an arithmetic circuit 30 and a judgment circuit 40 . The physical layer device 10 receives input data, and the input data includes multiple data. Since this embodiment is applied in the Internet, the input data is a packet of Internet data.

承接上述,存储电路20存储多批标签数据,每批标签数据对应于一子规则(例如:字元A、符号…等),每批标签数据包括N个位数据,每一位数据分布于不同的存储电路20地址,且标签数据的N-1个位对应至同一逻辑值,又每一标签数据为一可编程的标签数据,供使用者进行设定。存储电路20存储位数据的一实施例方式,将子规则对应于存储电路20的存储地址并设定数值。Following the above, the storage circuit 20 stores multiple batches of tag data, each batch of tag data corresponds to a sub-rule (for example: character A, symbol, etc.), each batch of tag data includes N bits of data, and each bit of data is distributed in different The address of the storage circuit 20, and the N-1 bits of the label data correspond to the same logic value, and each label data is a programmable label data for users to set. In one embodiment of storing bit data in the storage circuit 20 , the sub-rule is corresponding to the storage address of the storage circuit 20 and a value is set.

以下举例说明,若是要搜寻该多个输入数据中是否包含ABCDE的扫描规则,即包括ABCDE五个子规则,第一个子规则A对应的美国信息互换标准代码(America Standard Code for Information Interchange Code,ASCII Code)是65,故在存储电路20中,存储第一标签数据的存储地址65设定为1,其余地址(即地址0-64与66-255)的位皆设定为0,而第二个子规则B对应至ASCII Code 66,即在存储电路20中,存储第二标签数据的存储地址66设定为1,其余地址(即地址0-65与67-255)的位皆设为0,其余的扫描数据CDE依此类推。若扫描规则的外不理会的数据则对应的位则皆设为1,如图三所示的数据X,其为第六个数据,所以所有存储地址的第六部分位皆设为1。由于此实施例的扫描方法以字节为单元,加上一个字节有256种组合,因此此实施例的存储电路20的深度为256,即具有256个地址,宽度则视扫描规则的需求而设定,即每一地址的存储位视扫描需求而设定。The following example illustrates that if you want to search whether the multiple input data contains ABCDE scanning rules, that is, including five sub-rules of ABCDE, the first sub-rule A corresponds to the American Standard Code for Information Interchange Code (America Standard Code for Information Interchange Code, ASCII Code) is 65, so in the storage circuit 20, the storage address 65 for storing the first label data is set to 1, and the bits of the remaining addresses (that is, addresses 0-64 and 66-255) are all set to 0, and the first label data is set to 0. The two sub-rules B correspond to ASCII Code 66, that is, in the storage circuit 20, the storage address 66 for storing the second label data is set to 1, and the bits of the other addresses (that is, addresses 0-65 and 67-255) are all set to 0 , and so on for the rest of the scan data CDE. If the data is ignored by the scanning rule, the corresponding bits are all set to 1, as shown in Figure 3, the data X is the sixth data, so the sixth bit of all storage addresses is set to 1. Because the scanning method of this embodiment takes byte as a unit, plus a byte, there are 256 combinations, so the depth of the storage circuit 20 of this embodiment is 256, that is, there are 256 addresses, and the width depends on the requirements of the scanning rule. Setting, that is, the storage bit of each address is set according to the scanning requirements.

此外,实体层装置10所接收的该多个输入数据会传送至存储电路20而作为读取地址,如此存储电路20即会依据该多个输入数据读取对应的标签数据,也就是说输入数据会分别输入至存储电路20的地址端口(address port),使存储电路20依据输入数据而分别输出标签数据中的部分位。以图3为例,若存储电路20所接收的输入数据的第一数据为A时,由于A对应于存储电路的存储地址65,所以存储电路20即会依据第一数据输出标签数据中的第一部分位,也就是存储电路20的存储地址65所存储的数据,于此实施例中存储电路20会输出10000。假若输入数据的第二数据为B,存储电路20同理会对应输出存储地址66所存储的数据,而得到01000。其中,存储电路20的一较佳实施例可为一静态随机存取存储器。In addition, the plurality of input data received by the physical layer device 10 will be sent to the storage circuit 20 as a read address, so that the storage circuit 20 will read the corresponding tag data according to the plurality of input data, that is, the input data They will be respectively input to the address port (address port) of the storage circuit 20, so that the storage circuit 20 respectively outputs some bits in the tag data according to the input data. Taking FIG. 3 as an example, if the first data of the input data received by the storage circuit 20 is A, since A corresponds to the storage address 65 of the storage circuit, the storage circuit 20 will output the first data in the label data according to the first data. A part of bits, that is, the data stored in the memory address 65 of the memory circuit 20 , in this embodiment, the memory circuit 20 will output 10000. If the second data of the input data is B, the storage circuit 20 will correspondingly output the data stored in the storage address 66 to obtain 01000. Wherein, a preferred embodiment of the storage circuit 20 is a static random access memory.

运算电路30,其依序接收存储电路20所输出的每批数据并依据一时钟信号(Clock,CLK)移位所接收的存储电路20输出的数据并与下一批所接收的存储电路20输出的数据进行逻辑运算,而产生一运算结果,供判断电路40判断。下述配合图3对运算电路30进行详细说明。如图3所示,运算电路30包括多个触发器32与多个逻辑单元34,于此实施例中逻辑单元34为与门(AND gate)。该多个触发器32分别相互串接,而该多个逻辑单元34分别耦接于该多个触发器32之间以接收存储电路20所输出的该多个数据,并输出至所耦接的该多个触发器32。其中,该多个触发器32依据时钟信号CLK输出所接收的存储电路20输出的数据至下一级串接的逻辑单元34,逻辑单元34即逻辑运算触发器32输出的数据与所接收的下一批存储电路20输出的数据,以产生运算结果。An arithmetic circuit 30, which sequentially receives each batch of data output by the storage circuit 20 and shifts the received data output by the storage circuit 20 according to a clock signal (Clock, CLK) and outputs it with the next batch of received storage circuit 20 The logic operation is performed on the data to generate an operation result for the judgment circuit 40 to judge. The operation circuit 30 will be described in detail below with reference to FIG. 3 . As shown in FIG. 3 , the arithmetic circuit 30 includes a plurality of flip-flops 32 and a plurality of logic units 34 , and in this embodiment the logic units 34 are AND gates. The plurality of flip-flops 32 are respectively connected in series, and the plurality of logic units 34 are respectively coupled between the plurality of flip-flops 32 to receive the plurality of data output by the storage circuit 20 and output to the coupled The plurality of flip-flops 32 . Wherein, the plurality of flip-flops 32 output the received data outputted by the storage circuit 20 according to the clock signal CLK to the logic unit 34 connected in series at the next stage. A batch of data output by the storage circuit 20 is used to generate an operation result.

以下就以扫描数据为ABCDE进行详细说明,在存储电路20接收输入数据后,若此输入数据中包含ABCDE,则存储电路20则会依序输出运算数据10000、01000、00100、00010、00001。也就是说运算电路20的触发器32会分别接收第一批数据10000,并且会依据时钟信号CLK移位输出所接收的数据至下一级所串接的逻辑单元34,此时逻辑单元34亦会接收下一批数据,而进行逻辑运算,以输出至所串接的触发器32,于此实施例中此时第二个触发器32所接收的数据为1,并将依据下一个时钟信号CLK移位输出至下一级所串接的逻辑单元34,但若输入数据的第二个数据并非为B而为C,此时存储电路20所输出的第二批运算数据会为00100,此时运算电路30中的第二个触发器32所接收的数据会为0,表示输入数据不符合扫描规则。也就是说,若运算电路30依序接收的运算数据符合扫描规则时,运算电路30的功用就如同移位寄存器般会将第一批运算数据的1往下移位。The scan data is described in detail below as ABCDE. After the storage circuit 20 receives the input data, if the input data contains ABCDE, the storage circuit 20 will sequentially output the operation data 10000, 01000, 00100, 00010, 00001. That is to say, the flip-flops 32 of the arithmetic circuit 20 will respectively receive the first batch of data 10000, and will shift and output the received data to the logic unit 34 connected in series at the next stage according to the clock signal CLK. At this time, the logic unit 34 also The next batch of data will be received, and logical operations will be performed to output to the flip-flops 32 connected in series. In this embodiment, the data received by the second flip-flop 32 is 1 at this time, and will be based on the next clock signal CLK is shifted and output to the logic unit 34 connected in series at the next stage, but if the second data of the input data is not B but C, the second batch of operation data output by the storage circuit 20 will be 00100 at this time. The data received by the second flip-flop 32 in the timing operation circuit 30 will be 0, indicating that the input data does not conform to the scanning rule. That is to say, if the operation data sequentially received by the operation circuit 30 conforms to the scanning rule, the function of the operation circuit 30 is like a shift register to shift down the 1 of the first batch of operation data.

依此类推,输入数据包含ABCDE时,第一批的运算数据中的1将在经过五个时钟信号CLK的移位后,而会在第五个触发器32输出的运算结果为1,也表示此批输入数据中的部分数据符合扫描规则ABCDE。由此可知,若第五个触发器32所输出的运算结果为0,则代表于输入数据中未有符合ABCDE这个规则的数据。上述的时钟信号可由外部电路或内部电路所提供,此为熟知该技术领域者众所皆知,故此不再多加赞述。By analogy, when the input data contains ABCDE, 1 in the first batch of operation data will be shifted by five clock signals CLK, and the operation result output by the fifth flip-flop 32 will be 1, which also means Part of this batch of input data conforms to scan rule ABCDE. It can be seen that, if the operation result output by the fifth flip-flop 32 is 0, it means that there is no data conforming to the rule of ABCDE in the input data. The above-mentioned clock signal can be provided by an external circuit or an internal circuit, which is well known to those skilled in the art, so no further description is given here.

判断电路40,其接收运算结果而用于判断逻辑数据,以得知输入数据的部分数据是否符合该扫描规则,以此实施例来说,若运算电路30的第五个触发器32输出的运算结果为1时,则表示输入数据的部分数据符合扫描规则。当判断电路40得知实体层装置10所接收的输入数据中包含符合扫描规则时,将会传送一控制信号至处理电路50,处理电路50接收控制信号则执行相关的动作,例如当判断电路40比对网际网络的包数据符合扫描规则时,处理单元50则可阻挡网页的开启或是避免病毒的攻击。Judging circuit 40, which receives the operation result and is used to judge the logic data to know whether part of the input data conforms to the scanning rule. For this embodiment, if the operation output by the fifth flip-flop 32 of the operation circuit 30 When the result is 1, it means that part of the input data conforms to the scanning rule. When the judging circuit 40 learns that the input data received by the physical layer device 10 includes conforming to the scanning rules, it will send a control signal to the processing circuit 50, and the processing circuit 50 will perform related actions after receiving the control signal, for example, when the judging circuit 40 When the packet data of the Internet is compared with the scanning rule, the processing unit 50 can prevent the opening of the web page or avoid the attack of the virus.

本发明以扫描规则为依据,让扫描规则的每一数据分别对应至存储电路20的标签数据,也就是存储地址,并存储对应标签数据的部分位,且让存储电路20依据输入数据输出对应的数据,再通过运算电路30依据存储电路20输出的数据产生运算结果,的后再通过判断单元40判断运算结果,即可得知输入数据中是否包含符合扫描规则的数据,如此方式可节省电路的复杂度,进而节省成本,且可提高扫描效率。此外,判断电路40可任意设定是要以哪一触发器32的输出作为逻辑数据以进行判断,所以本发明极具有灵活性,方便使用。The present invention is based on the scanning rule, makes each data of the scanning rule correspond to the label data of the storage circuit 20, that is, the storage address, and stores part of the corresponding label data, and allows the storage circuit 20 to output the corresponding bit according to the input data. data, and then through the calculation circuit 30 to generate calculation results based on the data output by the storage circuit 20, and then through the judgment unit 40 to judge the calculation results, you can know whether the input data contains data that conforms to the scanning rules, and this way can save the circuit. Complexity, thereby saving costs, and can improve scanning efficiency. In addition, the judging circuit 40 can arbitrarily set which flip-flop 32 output is to be used as logic data for judging, so the present invention has great flexibility and is convenient to use.

另外,判断电路40还包括一计数单元60,以用于计数时钟信号CLK,判断电路40于得知输入数据的部分数据符合扫描规则时,则可依据计数单元60的计数结果得知符合扫描规则的数据于输入数据中的位置,以方便后续处理。计数单元60设置于判断电路40仅为本发明的一实施例,并不局限计数单元60仅必需设置于判断电路40。In addition, the judging circuit 40 also includes a counting unit 60 for counting the clock signal CLK. When the judging circuit 40 learns that part of the input data conforms to the scanning rule, it can know that it complies with the scanning rule according to the counting result of the counting unit 60. The location of the data in the input data to facilitate subsequent processing. The counting unit 60 disposed in the judging circuit 40 is only an embodiment of the present invention, and it is not limited that the counting unit 60 must only be disposed in the judging circuit 40 .

再参阅图3,由于此实施例中的运算电路30的所有触发器32相互串接在一起,所以运算电路30于逻辑运算不同扫描规则时,必须隔开,以避免上一个扫描规则的结果影响下一个扫描规则的结果。本发明还包括多隔离单元36,于此实施例中隔离单元36可为或闸。隔离单元36位于两触发器32之间而耦接于前级的触发器32与两触发器32之间的逻辑单元34,用于接收一区隔信号,以区隔下一该扫描规则,其中区隔信号可由判断单元40或是可由外部其他电路发出。假若第一个扫描规则包含有五个扫描数据,即必须在第五个触发器32与第六个触发器32必须隔离,此时判断电路40即发送区隔信号至设于第五个触发器32与第六个触发器32之间的隔离单元36,此实施例的区隔信号为1,如此不管第五个触发器32的输出1或0,隔离单元36的输出都为1,第五个触发器32与第六触发器32之间的逻辑单元34的输出则依据下一扫描规则的第一批数据所决定,即是第六触发器32所接收的数据为下一扫描规则的数据,所以即可隔离第五个触发器32与第六个触发器32,以有效隔离扫描规则。Referring to Fig. 3 again, since all the flip-flops 32 of the arithmetic circuit 30 in this embodiment are connected in series, so the arithmetic circuit 30 must be separated when the logic operation is different in scanning rules, so as to avoid the influence of the result of the last scanning rule The result of the next scan rule. The present invention also includes multiple isolation units 36, and the isolation units 36 in this embodiment can be OR gates. The isolation unit 36 is located between the two flip-flops 32 and is coupled to the front-stage flip-flop 32 and the logic unit 34 between the two flip-flops 32, and is used to receive an isolation signal to isolate the next scan rule, wherein The partition signal can be sent by the judging unit 40 or by other external circuits. If the first scan rule contains five scan data, the fifth flip-flop 32 and the sixth flip-flop 32 must be isolated, and the judging circuit 40 then sends a partition signal to the fifth flip-flop 32 and the isolation unit 36 between the sixth flip-flop 32, the partition signal of this embodiment is 1, so regardless of the output 1 or 0 of the fifth flip-flop 32, the output of the isolation unit 36 is 1, the fifth The output of the logic unit 34 between the first flip-flop 32 and the sixth flip-flop 32 is determined according to the first batch of data of the next scanning rule, that is, the data received by the sixth flip-flop 32 is the data of the next scanning rule , so the fifth flip-flop 32 and the sixth flip-flop 32 can be isolated to effectively isolate the scanning rules.

接上所述,判断电路40可依据扫描规则大小而自由设定隔离单元36,如此可动态设定扫描规则的长度,以增加使用的灵活性。本实施例可考虑到节省成本,运算电路30可依一固定间隔设定隔离单元36,像是以4的倍数或6的倍数设置隔离单元36,以简化电路的复杂度与节省成本。再者,若扫描规则的多扫描数据少于固定间隔所设定的数量时,多余的位则为不理会的数据,即设定为1,像是以6的倍数设置隔离单元36时,若扫描规则的多扫描数据不满6位时,则可将多余的位设定为1(don’t care)。Continuing from the above, the judging circuit 40 can freely set the isolation unit 36 according to the size of the scan rule, so that the length of the scan rule can be dynamically set to increase the flexibility of use. In this embodiment, cost saving can be considered. The computing circuit 30 can set the isolation units 36 at a fixed interval, such as setting the isolation units 36 in multiples of 4 or 6, so as to simplify the complexity of the circuit and save costs. Furthermore, if the multi-scanning data of the scanning rule is less than the number set at a fixed interval, the extra bits are ignored data, that is, they are set to 1, such as when the isolation unit 36 is set in a multiple of 6, if When the multi-scan data of the scan rule is less than 6 bits, the extra bits can be set to 1 (don't care).

请一并参阅图4,其为本发明的另一较佳实施例的方块图。如图所示,此实施例与图2的实施例不同的处在于图2仅具有一存储电路20,而此实施例具有一第一存储电路22与一第二存储电路24,其中第一存储电路22与第二存储电路24的存储容量皆小于存储电路20的存储容量,通过这种配置可减少存储电路20的容量,进而减少占用面积。此原因在于若将一字节(8位)拆为两个4位,如此一字节的扫描数据展开就仅需2^4×2=32位,也就是说仅需两个深度16的第一存储电路22与第二存储电路24即可取代图2实施例的存储电路20,如此两存储电路22、24的容量与原本的存储电路20的容量相较的下少了许多,故可节省存储电路所占用的面积。Please also refer to FIG. 4 , which is a block diagram of another preferred embodiment of the present invention. As shown in the figure, the difference between this embodiment and the embodiment of FIG. 2 is that FIG. 2 only has a storage circuit 20, and this embodiment has a first storage circuit 22 and a second storage circuit 24, wherein the first storage circuit Both the storage capacity of the circuit 22 and the second storage circuit 24 are smaller than the storage capacity of the storage circuit 20 , through this configuration, the capacity of the storage circuit 20 can be reduced, thereby reducing the occupied area. The reason for this is that if one byte (8 bits) is divided into two 4 bits, the scanning data of one byte only needs 2^4×2=32 bits, that is to say, only two depth 16 bits are required. A storage circuit 22 and a second storage circuit 24 can replace the storage circuit 20 of the embodiment in FIG. The area occupied by the storage circuit.

再者,此实施例的扫描电路还包括一序列单元26,序列单元26的输入端分别耦接第一存储电路22与第二存储电路24。当实体层装置10接收输入数据时会分离输入数据并分别传输至对应的第一存储电路22与第二存储电路24,以分别输出对应的数据。的后再由序列单元26的处理,将第一存储电路22与第二存储电路24所输出的数据相串后,进而传送至运算电路30,以进行同于图2实施例的后续处理。Furthermore, the scanning circuit of this embodiment further includes a sequence unit 26 , the input terminals of the sequence unit 26 are respectively coupled to the first storage circuit 22 and the second storage circuit 24 . When the physical layer device 10 receives the input data, it separates the input data and transmits them to the corresponding first storage circuit 22 and the second storage circuit 24 respectively, so as to output the corresponding data respectively. Afterwards, the processing by the sequence unit 26 serializes the output data of the first storage circuit 22 and the second storage circuit 24, and then transmits them to the operation circuit 30 for subsequent processing similar to that of the embodiment in FIG. 2 .

综上所述,本发明的数据的扫描电路与方法,其由存储电路存储多个标签数据,且每一个标签数据对应于一子规则,存储电路依据第一数据与第二数据而分别输出每一个标签数据中的一第一部分位与一第二部分位;一运算电路逻辑运算第一部分位与第二部分位,而产生一运算结果;一判断电路依据该运算结果以判断该输入数据是否符合扫描规则。以可节省电路的复杂度,进而节省成本,且可提高扫描效率与扫描灵活性。To sum up, in the data scanning circuit and method of the present invention, the storage circuit stores a plurality of tag data, and each tag data corresponds to a sub-rule, and the storage circuit outputs each sub-rule according to the first data and the second data. A first part and a second part of a label data; an operation circuit logically operates the first part and the second part to generate an operation result; a judging circuit judges whether the input data conforms to the Scan rules. Therefore, the complexity of the circuit can be saved, thereby saving the cost, and the scanning efficiency and scanning flexibility can be improved.

虽然本发明已以较佳实施例公开如上,然其并非用以限定本发明。任何所属技术领域中的普通技术人员,在不脱离本发明的精神和范围的情况下,可进行各种更动与修改。因此,本发明的保护范围以所提出的权利要求的范围为准。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Various changes and modifications can be made by those skilled in the art without departing from the spirit and scope of the present invention. Accordingly, the protection scope of the present invention shall be determined by the scope of the appended claims.

Claims (13)

1. a data scanning circuit is used for scanning input data and whether meets a rule, and these input data comprise one first data and one second data, and this data scanning circuit comprises:
One memory circuit; In order to store many batches of label datas; And each batch label data corresponds to a sub-rule; Wherein, this memory circuit reads address corresponding label data as a first position to export in every batch of label data with this as reading the address with these first data, and reads address corresponding label data as a second portion position to export in every batch of label data with this as reading the address with these second data;
One computing circuit is coupled to this memory circuit, in order to logical operation is carried out in this first position and this second portion position, to produce an operation result; And
One decision circuitry is coupled to this computing circuit, in order to according to this operation result judging whether these input data meet this rule,
Wherein this computing circuit comprises:
A plurality of triggers; And
A plurality of logical blocks are respectively coupled between these a plurality of triggers;
Wherein, These a plurality of triggers are exported this first position to these a plurality of logical blocks according to clock signal displacement; These a plurality of logical blocks carried out logical operation to this first position of being exported by this a plurality of trigger with this this second portion position of being exported by this memory circuit; To produce this operation result
Wherein each in the every batch of label data is distributed in this different memory circuit addresses, and
Wherein every batch of label data is the N position; And the N-1 of every batch of label data position corresponds to same logical value, and wherein in the N bit address of every batch of label data of storage of memory circuit, the corresponding memory address of the ASCII(American Standard Code for information interchange) corresponding with sub-rule is set at 1; All the other N-1 positions are set at 0
Wherein first data and second data are 1 byte, and N is 256.
2. data scanning circuit as claimed in claim 1, wherein these first data and this second data input to the address port of this memory circuit.
3. data scanning circuit as claimed in claim 1, wherein every batch of label data is a programmable label data.
4. data scanning circuit as claimed in claim 1, wherein these a plurality of logical blocks are and door.
5. data scanning circuit as claimed in claim 1 also comprises:
One counting unit meets the position that these regular data are arranged in these input data in order to count this clock signal to learn.
6. data scanning circuit as claimed in claim 1, wherein this sub-rule is represented a character.
7. data scanning circuit as claimed in claim 1, wherein this memory circuit is a static RAM.
8. data scanning circuit as claimed in claim 1 is arranged in the medium access controller.
9. a data scanning method is used for scanning input data and whether meets a rule, and these input data comprise one first data and one second data, and this data scanning method comprises:
Store many batches of label datas in a memory circuit, each batch label data corresponds to a sub-rule;
Read address corresponding label data as a first position to export in every batch of label data with this as reading the address with these first data;
Read address corresponding label data as a second portion position to export in every batch of label data with this as reading the address with these second data;
Logical operation is carried out to produce an operation result in this first position and this second portion position; And
Whether meet this rule according to this operation result with these input data of judgement,
Wherein in the step of logical operation, also comprise:
According to this first position of clock signal displacement, and carry out logical operation with this second portion position, producing this operation result,
Wherein each in the every batch of label data is distributed in the different storage addresss, and
Wherein every batch of label data is the N position; And the N-1 of this first label data position corresponds to same logical value; Wherein in the N bit address of every batch of label data of storage of memory circuit; The corresponding memory address of the ASCII(American Standard Code for information interchange) corresponding with sub-rule is set at 1, and all the other N-1 positions are set at 0
Wherein first data and second data are 1 byte, and N is 256.
10. data scanning method as claimed in claim 9, wherein these first data and this second data input to the address port of this memory circuit.
11. data scanning method as claimed in claim 9, wherein every batch of label data is a programmable label data.
12. scan method as claimed in claim 9 also comprises:
Count this clock signal and meet the position that these regular data are arranged in these input data to learn.
13. scan method as claimed in claim 9 is applied to a network management interchanger or a load balancer.
CN200710180299A 2007-10-26 2007-10-26 Scanning circuit for data content and its scanning method Active CN101420417B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710180299A CN101420417B (en) 2007-10-26 2007-10-26 Scanning circuit for data content and its scanning method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710180299A CN101420417B (en) 2007-10-26 2007-10-26 Scanning circuit for data content and its scanning method

Publications (2)

Publication Number Publication Date
CN101420417A CN101420417A (en) 2009-04-29
CN101420417B true CN101420417B (en) 2012-08-29

Family

ID=40631027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710180299A Active CN101420417B (en) 2007-10-26 2007-10-26 Scanning circuit for data content and its scanning method

Country Status (1)

Country Link
CN (1) CN101420417B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI625534B (en) * 2015-12-21 2018-06-01 瑞昱半導體股份有限公司 Debug method executed via scan chain for scan test and related circuitry system
CN111652644A (en) * 2020-06-01 2020-09-11 湖南快乐阳光互动娱乐传媒有限公司 Advertisement strategy configuration method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004008701A1 (en) * 2002-07-11 2004-01-22 Taral Networks Method and system for controlling messages in a communication network
US7076650B1 (en) * 1999-12-24 2006-07-11 Mcafee, Inc. System and method for selective communication scanning at a firewall and a network node
CN1863211A (en) * 2006-03-23 2006-11-15 华为技术有限公司 Content filtering system and method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7076650B1 (en) * 1999-12-24 2006-07-11 Mcafee, Inc. System and method for selective communication scanning at a firewall and a network node
WO2004008701A1 (en) * 2002-07-11 2004-01-22 Taral Networks Method and system for controlling messages in a communication network
CN1863211A (en) * 2006-03-23 2006-11-15 华为技术有限公司 Content filtering system and method thereof

Also Published As

Publication number Publication date
CN101420417A (en) 2009-04-29

Similar Documents

Publication Publication Date Title
US20210142082A1 (en) Bus translator
US20140068124A1 (en) Enhanced memory savings in routing memory structures of serial attached scsi expanders
US8713223B2 (en) Methods and systems to accomplish variable width data input
JP5489014B2 (en) Method and system for power consumption management of a pattern recognition processor
US5452451A (en) System for plural-string search with a parallel collation of a first partition of each string followed by finite automata matching of second partitions
US10007486B2 (en) Systems and methods to enable identification of different data sets
US6253280B1 (en) Programmable multiple word width CAM architecture
US7861291B2 (en) System and method for implementing ACLs using standard LPM engine
US8972450B2 (en) Multi-stage parallel multi-character string matching device
WO2010080403A2 (en) Pattern-recognition processor with matching-data reporting module
TW200301429A (en) A method of improving the lookup performance of tree-type knowledge base searches
US4941124A (en) Text comparator with counter shift register
CN111526134B (en) Message detection system, method and device
US6954823B1 (en) Search engine device and method for generating output search responses from multiple input search responses
US7694068B1 (en) Re-entrant processing in a content addressable memory
CN101420417B (en) Scanning circuit for data content and its scanning method
US7889530B2 (en) Reconfigurable content-addressable memory
US8463988B2 (en) System and method for matching patterns
RU2313128C1 (en) Information finding device
US8607337B2 (en) Scanning circuit and method for data content
US6763422B2 (en) Cache memory capable of reducing area occupied by data memory macro units
US20040128441A1 (en) Method and apparatus for detecting ''almost match'' in a CAM
US6401188B1 (en) Method for selection on a pattern sequence
US20240126683A1 (en) Method and apparatus for determining data storage bit width, and method for storing index data
JPH03131969A (en) Method and device for retrieving code string

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