[go: up one dir, main page]

CN100484042C - Method and apparatus for message payload transparent transmission logic verification - Google Patents

Method and apparatus for message payload transparent transmission logic verification Download PDF

Info

Publication number
CN100484042C
CN100484042C CNB2004100339676A CN200410033967A CN100484042C CN 100484042 C CN100484042 C CN 100484042C CN B2004100339676 A CNB2004100339676 A CN B2004100339676A CN 200410033967 A CN200410033967 A CN 200410033967A CN 100484042 C CN100484042 C CN 100484042C
Authority
CN
China
Prior art keywords
message
payload
logic
verification
predetermined algorithm
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
CNB2004100339676A
Other languages
Chinese (zh)
Other versions
CN1691610A (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 CNB2004100339676A priority Critical patent/CN100484042C/en
Publication of CN1691610A publication Critical patent/CN1691610A/en
Application granted granted Critical
Publication of CN100484042C publication Critical patent/CN100484042C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开一种报文净荷透传逻辑的验证方法及装置,所述方法主要包括:按照预定算法产生逻辑设备输入端输入报文的各个净荷值;根据所述预定算法依次验证逻辑设备输出端输出报文的各个净荷值,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。所述装置主要包括逻辑验证报文产生单元和逻辑验证单元。本发明由于只需在逻辑设备输入端对数据进行预定算法处理,而在输出端只是验证输出报文的各个净荷值是否符合预定算法即可确定逻辑设备逻辑是否正确,可提高验证速度且校验准确。

Figure 200410033967

The invention discloses a method and device for verifying message payload transparent transmission logic. The method mainly includes: generating each payload value of a message input at the input terminal of a logic device according to a predetermined algorithm; and verifying the logic device sequentially according to the predetermined algorithm The output terminal outputs each payload value of the message, and if each payload value of the output message complies with the predetermined algorithm, it is confirmed that the verification is passed; otherwise, it is confirmed that the logical device has a logic error. The device mainly includes a logic verification message generating unit and a logic verification unit. Since the present invention only needs to process the data with a predetermined algorithm at the input end of the logic device, and only needs to verify whether each payload value of the output message conforms to the predetermined algorithm at the output end, it can determine whether the logic of the logic device is correct, which can improve the verification speed and correct the error rate. The test is accurate.

Figure 200410033967

Description

报文净荷透传逻辑的验证方法及装置 Method and device for verifying message payload transparent transmission logic

技术领域 technical field

本发明涉及通信测试技术领域,尤指一种应用于大规模逻辑芯片中的报文净荷透传逻辑的验证方法及装置。The invention relates to the technical field of communication testing, in particular to a method and device for verifying message payload transparent transmission logic applied in large-scale logic chips.

背景技术 Background technique

现有技术中报文指的是从发送方传输到接收方的一个信息单元。报文的组成主要包括以下部分:报文首部+净荷+报文尾部,例如以太网报文格式如下所示:In the prior art, a message refers to an information unit transmitted from a sender to a receiver. The composition of the message mainly includes the following parts: message header + payload + message tail, for example, the Ethernet message format is as follows:

  目的地址(6字节) 源地址(6字节) 类型(2字节) 数据(46~1500字节) CRC(4字节) Destination address (6 bytes) Source address (6 bytes) type (2 bytes) Data (46~1500 bytes) CRC (4 bytes)

其中目的地址、源地址和类型域为报文首部,数据域为净荷,净荷长度可变,CRC为报文尾部。Wherein, the destination address, source address and type field are the header of the message, the data field is the payload, the length of the payload is variable, and the CRC is the tail of the message.

而逻辑芯片是为实现特定逻辑功能而设计的芯片,例如交换业务中采用许多大规模逻辑芯片实现交换逻辑功能。现有的许多大规模逻辑芯片对传输的报文净荷部分直接转发,即逻辑芯片对报文净荷透传而不加处理,可以利用这个特性来检验大规模逻辑芯片是否正常工作。The logic chip is a chip designed to realize specific logic functions. For example, many large-scale logic chips are used in switching services to realize switching logic functions. Many existing large-scale logic chips directly forward the payload part of the transmitted message, that is, the logic chip transparently transmits the message payload without processing. This feature can be used to check whether the large-scale logic chip is working normally.

现有技术主要采用两种方法实现报文净荷透传逻辑的验证:直接比较法和CRC32校验法(循环冗余校验法)。The prior art mainly adopts two methods to realize the verification of message payload transparent transmission logic: a direct comparison method and a CRC32 check method (cyclic redundancy check method).

采用直接净荷比较法,需首先存储逻辑芯片输入端输入的报文净荷内容,然后将逻辑芯片输出的报文净荷内容与储存的输入报文的净荷内容直接逐字节比较进行验证,经比较,若两者一致,则验证通过,否则,逻辑芯片出错。Using the direct payload comparison method, it is necessary to first store the payload content of the message input from the input terminal of the logic chip, and then directly compare the payload content of the message output by the logic chip with the payload content of the stored input message byte by byte for verification , after comparison, if the two are consistent, the verification is passed, otherwise, the logic chip is faulty.

这种报文净荷透传逻辑验证方法存在如下缺点:This message payload transparent transmission logic verification method has the following disadvantages:

采用直接比较法由于需要存储输入逻辑芯片的报文净荷内容,在逻辑设备输出端验证时,首先读取保存的输入报文净荷内容,再与输出的报文净荷内容进行逐字节比较,从存储设备读取保存的报文净荷内容以及输入输出报文逐字节比对等操作都比较耗时,因而影响验证速度,例如用于仿真系统中将大大降低仿真速度。The direct comparison method needs to store the message payload content of the input logic chip. When verifying at the output terminal of the logic device, the saved input message payload content is first read, and then compared with the output message payload content byte by byte. In comparison, operations such as reading the saved message payload content from the storage device and comparing input and output messages byte by byte are time-consuming, thus affecting the verification speed. For example, when used in a simulation system, the simulation speed will be greatly reduced.

进一步可采取CRC32校验法进行报文净荷透传逻辑验证,其主要采用下述步骤实现逻辑验证:Further, the CRC32 check method can be used to carry out logical verification of message payload transparent transmission, which mainly adopts the following steps to realize logical verification:

首先,构造逻辑设备输入端的输入报文,其中报文净荷由两部分组成:净荷最后四个字节(CRC32部分)、除净荷最后四个字节以外的所有报文净荷字节(data部分);First, construct the input message at the input end of the logic device, where the message payload consists of two parts: the last four bytes of the payload (CRC32 part), all the message payload bytes except the last four bytes of the payload (data part);

CRC32部分的内容是由data部分内容进行CRC32计算得出的校验码,具体的,CRC校验码可由一个常数去除该数据流的二进制数值而得,商数被放弃,余数作为CRC校验码追加到数据流尾,产生新的数据流进行发送;The content of the CRC32 part is the check code calculated by the CRC32 calculation of the data part. Specifically, the CRC check code can be obtained by dividing the binary value of the data stream by a constant, the quotient is discarded, and the remainder is used as the CRC check code Append to the end of the data stream to generate a new data stream for sending;

同样,在接收端,新的数据流被同一常数去除,检查余数是否为一个常数(通常为0),若余数为一个常数,则认为传输正确,否则就认为传输中已发生差错。Similarly, at the receiving end, the new data stream is removed by the same constant, and it is checked whether the remainder is a constant (usually 0). If the remainder is a constant, it is considered that the transmission is correct, otherwise it is considered that an error has occurred in the transmission.

采用CRC32校验法进行报文净荷透传逻辑验证存在如下缺点:Using the CRC32 check method to perform logical verification of message payload transparent transmission has the following disadvantages:

由于CRC32校验法要求逻辑设备输入输出端逐比特进行CRC32算法处理,由于CRC32算法处理的复杂性,实现工作量较大,另外,CRC32校验法理论上对于数据传输中小于32比特(4字节)的数据出错可以完全检测出,但对于数据传输中大于32比特(4字节)的数据出错,则不能完全检测出。Since the CRC32 verification method requires the input and output terminals of the logic device to perform CRC32 algorithm processing bit by bit, due to the complexity of the CRC32 algorithm processing, the implementation workload is relatively large. Section) data errors can be completely detected, but for data errors larger than 32 bits (4 bytes) in data transmission, it cannot be completely detected.

发明内容 Contents of the invention

本发明解决的技术问题是提供一种校验准确、且检验速度较快的报文净荷透传逻辑的验证方法及装置,采用所述方法及装置,大规模逻辑芯片的报文净荷透传逻辑验证将更加快速准确。The technical problem solved by the present invention is to provide a verification method and device for message payload transparent transmission logic with accurate verification and fast verification speed. Using the method and device, the message payload transparent transmission of large-scale logic chips Pass logic verification will be faster and more accurate.

为解决上述问题,本发明的报文净荷透传逻辑的验证方法,包括如下步骤:In order to solve the above problems, the verification method of message payload transparent transmission logic of the present invention comprises the following steps:

A、按照预定算法产生逻辑设备输入端输入报文的各个净荷值;A. Generate each payload value of the input message at the input terminal of the logic device according to a predetermined algorithm;

B、依次判断所述逻辑设备输出端输出报文中的相邻的净荷值之间是否符合所述预定算法,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。B. sequentially judge whether the adjacent payload values in the output message of the logic device output conform to the predetermined algorithm, if each payload value of the output message conforms to the predetermined algorithm, then confirm that the verification is passed, Otherwise, it is confirmed that the logic device has a logic error.

其中,步骤A所述输入报文为一个流的报文,该流的前一报文的最后一个净荷值与紧接的后一报文的最前一个净荷值也符合所述预定算法。Wherein, the input message in step A is a message of a stream, and the last payload value of the previous message and the first payload value of the immediately following message of the stream also conform to the predetermined algorithm.

其中,步骤B中所述验证具体包括步骤:Wherein, the verification described in step B specifically includes steps:

B1、读取一个净荷值;B1. Read a payload value;

B2、继续读取下一个净荷值;B2. Continue to read the next payload value;

B3、判断前一净荷值与后一净荷值是否符合所述预定算法,若符合所述预定算法,则进入B4,否则,进入B5;B3. Judging whether the previous payload value and the next payload value conform to the predetermined algorithm, if they conform to the predetermined algorithm, then go to B4, otherwise, go to B5;

B4、判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则确认验证通过,否则,保留后一净荷值,然后返回B2;B4, judge whether each payload value of the output message has all been verified, if all verified, then confirm that the verification is passed, otherwise, keep the last payload value, and then return to B2;

B5、确认逻辑设备逻辑出错,退出验证。B5. Confirm that the logical device has a logic error, and exit the verification.

其中,所述步骤A中输入报文的各个净荷值是按照字节、字或双字产生的。Wherein, each payload value of the input message in the step A is generated according to byte, word or double word.

其中,所述预定算法为递增算法。Wherein, the predetermined algorithm is an incremental algorithm.

相应的,本发明的报文净荷透传逻辑的验证装置,包括:Correspondingly, the verification device of the message payload transparent transmission logic of the present invention includes:

逻辑验证报文产生单元,与逻辑设备输入端相连,用于按照预定算法产生逻辑设备输入端输入报文的各个净荷值;The logic verification message generation unit is connected to the input terminal of the logic device, and is used to generate each payload value of the input message at the input terminal of the logic device according to a predetermined algorithm;

逻辑验证单元,与逻辑设备输出端相连,用于依次判断所述逻辑设备输出端输出报文中的相邻的净荷值之间是否符合所述预定算法,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。The logic verification unit is connected to the output terminal of the logic device, and is used to sequentially judge whether the adjacent payload values in the output message of the output terminal of the logic device conform to the predetermined algorithm, if each payload value of the output message If it conforms to the predetermined algorithm, it is confirmed that the verification is passed; otherwise, it is confirmed that the logical device has a logic error.

其中,所述输入报文为一个流的报文,该流的前一报文的最后一个净荷值与紧接的后一报文的最前一个净荷值也符合所述预定算法。Wherein, the input message is a message of a flow, and the last payload value of the previous message of the flow and the first payload value of the immediately following message of the flow also conform to the predetermined algorithm.

其中,所述逻辑验证单元包括:Wherein, the logic verification unit includes:

读取模块,用于依次读取输出报文的各个净荷值;The reading module is used to sequentially read each payload value of the output message;

第一判断模块,用于判断所述读取模块读取的一个净荷值,以及读取模块后续继续读取的下一个净荷值是否符合预定算法,若符合预定算法,则判断为真,否则判断为假,确认逻辑设备逻辑出错;The first judging module is used to judge whether a payload value read by the reading module and the next payload value read by the reading module conforms to the predetermined algorithm, and if it conforms to the predetermined algorithm, the judgment is true, Otherwise, the judgment is false, and the logical device logic error is confirmed;

第二判断模块,若所述第一判断模块判断为真,则进一步判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则确认验证通过,否则,保留后一净荷值,由所述读取模块继续读取下一净荷值交由第一判断模块继续判断。The second judging module, if the judgment of the first judging module is true, then further judge whether each payload value of the output message has been verified completely, if all verified, then confirm that the verification is passed, otherwise, keep the latter payload value, the reading module continues to read the next payload value and hand it over to the first judging module to continue judging.

其中,所述逻辑验证报文产生单元按照字节、字或双字产生输入报文的各个净荷值。Wherein, the logic verification message generation unit generates each payload value of the input message according to byte, word or double word.

其中,所述预定算法为递增算法。Wherein, the predetermined algorithm is an incremental algorithm.

与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:

一方面,相对于直接比较法,本发明不需要保存逻辑设备输入端的输入报文,不需要读取输入报文的操作,也不需要输入报文和输出报文净荷内容之间的逐字节比较的操作,因而可提高验证速度,若应用于逻辑验证仿真和测试中,其测试速度将大大快于直接比较法;On the one hand, compared with the direct comparison method, the present invention does not need to save the input message at the input terminal of the logic device, does not need to read the operation of the input message, and does not need verbatim between the input message and the output message payload content. The operation of section comparison can improve the verification speed. If it is applied to logic verification simulation and test, the test speed will be much faster than the direct comparison method;

另一方面,相对于CRC32算法,本发明只需在逻辑设备输入端对数据进行预定算法处理,而在输出端只是验证输出报文的各个净荷值是否符合预定算法即可确定逻辑设备逻辑是否正确,由于避免了CRC32算法需分别在逻辑设备输入输出端对数据处理的繁琐处理操作,可提高验证速度;On the other hand, compared with the CRC32 algorithm, the present invention only needs to perform predetermined algorithm processing on the data at the input end of the logic device, and only needs to verify whether each payload value of the output message conforms to the predetermined algorithm at the output end to determine whether the logic device logic is Correct, because the CRC32 algorithm needs to avoid the cumbersome processing operations of data processing at the input and output terminals of the logic device, the verification speed can be improved;

进一步,本发明根据预定算法检测输出报文净荷可以完全保证校验是正确的,因此,避免了CRC32算法从理论上只有在逻辑设备数据转发过程中出错小于32比特(4字节)的情况下,才能确保检测出错误的缺点。Further, the present invention detects the payload of the output message according to the predetermined algorithm and can fully guarantee that the verification is correct, therefore, avoiding the situation that the CRC32 algorithm is theoretically only in the process of logical device data forwarding and is less than 32 bits (4 bytes) in error In order to ensure the detection of wrong shortcomings.

附图说明 Description of drawings

图1是本发明报文净荷透传逻辑的验证装置组成示意图;Fig. 1 is a schematic diagram of the composition of the verification device of the message payload transparent transmission logic of the present invention;

图2是图1所示逻辑验证单元的组成示意图;Fig. 2 is a schematic diagram of the composition of the logic verification unit shown in Fig. 1;

图3是本发明报文净荷透传逻辑的验证方法具体实施例流程图。Fig. 3 is a flow chart of a specific embodiment of the method for verifying message payload transparent transmission logic of the present invention.

具体实施方式 Detailed ways

参考图1,图1是本发明报文净荷透传逻辑的验证装置组成示意图,所述验证装置主要包括:逻辑验证报文产生单元11和逻辑验证单元12,分别说明如下:Referring to Fig. 1, Fig. 1 is a schematic diagram of the composition of the verification device of the message payload transparent transmission logic of the present invention, and the verification device mainly includes: a logic verification message generating unit 11 and a logic verification unit 12, which are respectively described as follows:

逻辑验证报文产生单元11,其主要用于按照预定算法产生逻辑设备输入端输入报文的各个净荷值,可以是按字节,也可以是按字或双字为单位产生所述输入报文净荷,所述预定算法可采取增量算法等;Logic verification message generation unit 11, which is mainly used to generate each payload value of the input message at the input terminal of the logic device according to a predetermined algorithm, which can be by byte, or by word or double word as a unit to generate the input message Text payload, the predetermined algorithm can adopt incremental algorithm, etc.;

逻辑验证单元12,其主要用于根据所述预定算法验证所述逻辑设备输出端输出报文的各个净荷值,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。Logic verification unit 12, which is mainly used to verify each payload value of the output message of the logic device output according to the predetermined algorithm, if each payload value of the output message conforms to the predetermined algorithm, then confirm that the verification is passed, Otherwise, it is confirmed that the logic device has a logic error.

优化的,逻辑验证报文产生单元11产生报文净荷时,若输入报文为一个流的报文,按照所述预定算法产生该流的报文的各个净荷值,另外,该流的相邻报文之间的净荷值也按照所述预定算法产生,即需保证同一报文的净荷值符合所述预定算法,同一个流的前一报文的最后一个净荷值与紧接的后一报文的最前一个净荷值也符合所述预定算法。Optimized, when the logic verification message generation unit 11 generates the message payload, if the input message is a message of a flow, each payload value of the message of the flow is generated according to the predetermined algorithm, in addition, the flow of the message The payload value between adjacent messages is also generated according to the predetermined algorithm, that is, it is necessary to ensure that the payload value of the same message conforms to the predetermined algorithm, and the last payload value of the previous message of the same flow and the tight The first payload value of the following message also complies with the predetermined algorithm.

下面说明逻辑验证单元12,参考图2,所述逻辑验证单元12主要包括:读取模块121、第一判断模块122以及第二判断模块123,具体说明如下:The logic verification unit 12 is described below, with reference to Fig. 2, the logic verification unit 12 mainly includes: a reading module 121, a first judging module 122 and a second judging module 123, specifically as follows:

读取模块121,主要用于依次读取输出报文的各个净荷值;The reading module 121 is mainly used to sequentially read each payload value of the output message;

第一判断模块122,主要用于判断所述读取模块121读取的一个净荷值,以及读取模块121后续继续读取的下一个净荷值是否符合预定算法,若符合预定算法,则判断为真,否则判断为假,确认逻辑设备逻辑出错;The first judging module 122 is mainly used to judge whether a payload value read by the reading module 121 and the next payload value that the reading module 121 continues to read subsequently conform to a predetermined algorithm, and if it conforms to a predetermined algorithm, then The judgment is true, otherwise the judgment is false, and the logical device logic error is confirmed;

第二判断模块123,若所述第一判断模块122判断为真,则进一步判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则确认验证通过,否则,保留后一净荷值,由所述读取模块121继续读取下一净荷值交由第一判断模块122继续判断。The second judging module 123, if the judgment of the first judging module 122 is true, then further judge whether each payload value of the output message has been verified, if all verified, then confirm that the verification is passed, otherwise, keep the latter For the payload value, the reading module 121 continues to read the next payload value and hand it over to the first judging module 122 to continue judging.

下面举一较简单的例子对本发明报文净荷透传逻辑的验证方法进行说明。A relatively simple example is given below to illustrate the verification method of the message payload transparent transmission logic of the present invention.

假设逻辑设备输入端的输入报文为pkt1,经逻辑处理后在逻辑设备输出端输出的报文为pkt2,首先按照预定算法产生所述输入报文pkt1的各个净荷值,产生的同一报文的净荷值符合所述预定算法,作为举例,所述预定算法可采用增量算法:next_data=data+1,按照所述算法产生的输入报文的各个净荷值如下:Assuming that the input message at the input terminal of the logic device is pkt1, and the message output at the output terminal of the logic device after logic processing is pkt2, at first, each payload value of the input message pkt1 is generated according to a predetermined algorithm, and the generated same message is The payload value conforms to the predetermined algorithm. As an example, the predetermined algorithm can use an incremental algorithm: next_data=data+1, and the respective payload values of the input message generated according to the algorithm are as follows:

pkt1:0、1、2。。。14pkt1: 0, 1, 2. . . 14

进一步,在逻辑设备输出端按照所述预定算法对输出报文的各个净荷值进行验证,即验证报文pkt1经逻辑处理输出后的报文的净荷值是否符合预定算法,若符合所述预定算法,则报文净荷没有被逻辑芯片处理过,则可确定逻辑芯片的报文净荷透传逻辑正确,即输出报文净荷与输入报文净荷相同,输出报文pkt2的各个净荷值如下所示:Further, at the output terminal of the logic device, verify each payload value of the output message according to the predetermined algorithm, that is, verify whether the payload value of the message pkt1 output after logical processing conforms to the predetermined algorithm, if it meets the stated Predetermined algorithm, if the message payload has not been processed by the logic chip, it can be determined that the message payload transparent transmission logic of the logic chip is correct, that is, the output message payload is the same as the input message payload, and each of the output message pkt2 The payload values are as follows:

pkt2:0、1、2、3。。。14pkt2: 0, 1, 2, 3. . . 14

若输出报文净荷值发生改变,例如所述输出报文pkt2的净荷值2改变为3,如下所示:If the payload value of the output message changes, for example, the payload value 2 of the output message pkt2 is changed to 3, as shown below:

pkt2:0、1、3、3。。。14pkt2: 0, 1, 3, 3. . . 14

则由于前一净荷值为3,后一净荷值也为3,则不符合预定算法(3=2+1),因此,可确定逻辑芯片出错,芯片报文净荷透传逻辑出错。Since the previous payload value is 3 and the latter payload value is also 3, it does not conform to the predetermined algorithm (3=2+1). Therefore, it can be determined that the logic chip is faulty, and the chip message payload transparent transmission logic is faulty.

继续说明本发明的方法,对于同一个流的报文本发明同样适用,所述流指具有某些相同特征的多个报文;如对于前面的以太网报文,可以将DMAC值相同的报文当作一个流,应用本发明方法时,所述流的同一报文的各个净荷值符合所述预定算法,同一个流的前一报文的最后一个净荷值与紧接其后面的后一报文的第一个净荷值也符合所述预定算法。Continuing to explain the method of the present invention, the invention is equally applicable to the message text of the same stream, and the stream refers to a plurality of messages with some identical characteristics; as for the previous Ethernet message, the message with the same DMAC value can be As a stream, when the method of the present invention is applied, each payload value of the same message of the stream conforms to the predetermined algorithm, the last payload value of the previous message of the same stream and the following The first payload value of a message also complies with the predetermined algorithm.

参考图3,以一典型实施例进行说明,所述预定算法仍采用增量算法:next_data=data+1:Referring to Fig. 3, a typical embodiment is used for illustration, the predetermined algorithm still adopts the incremental algorithm: next_data=data+1:

假设逻辑设备输入端输入的同一个流的5个报文为pkt1~pkt5,在步骤31,按照增量算法产生5个输入报文的净荷,各个报文净荷的净荷值分别为Assuming that the five messages of the same flow input by the input terminal of the logical device are pkt1-pkt5, in step 31, the payloads of the five input messages are generated according to the incremental algorithm, and the payload values of the payloads of each message are respectively

pkt1:0、1、2。。。14pkt1: 0, 1, 2. . . 14

pkt2:15、16、17、18。。。89pkt2: 15, 16, 17, 18. . . 89

pkt3:90、91、92、93。。。123pkt3: 90, 91, 92, 93. . . 123

pkt4:124、125、126。。。174pkt4: 124, 125, 126. . . 174

pkt5:175、176、177。。。247pkt5: 175, 176, 177. . . 247

上述各个报文的净荷值符合增量算法,如16=15+1,17=16+1;同一个流的报文之间的净荷值也符合增量算法,如15=14+1,90=89+1。这样,经逻辑设备处理后,在步骤32,当在逻辑设备输出端输出报文时,根据所述增量算法对输出报文的各个净荷值进行验证,验证主要包括以下流程:The payload value of each of the above messages conforms to the incremental algorithm, such as 16=15+1, 17=16+1; the payload value between the packets of the same flow also conforms to the incremental algorithm, such as 15=14+1 , 90=89+1. In this way, after processing by the logic device, in step 32, when the message is output at the output terminal of the logic device, each payload value of the output message is verified according to the incremental algorithm, and the verification mainly includes the following processes:

在步骤s321,读取一个净荷值;In step s321, read a payload value;

然后在步骤s322,继续读取下一个净荷值;Then in step s322, continue to read the next payload value;

进而在步骤s323判断前一净荷值与后一净荷值是否符合所述预定算法,若符合所述预定算法,则进入步骤s324,否则,进入步骤s325,确认逻辑设备逻辑出错,退出验证;Further, in step s323, it is judged whether the previous payload value and the latter payload value conform to the predetermined algorithm, if they conform to the predetermined algorithm, then enter step s324, otherwise, enter step s325, confirm that the logic device has a logic error, and exit the verification;

其中步骤s324,判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则进入步骤s326,确认验证通过,否则,在步骤s327,仅保留后一净荷值,然后返回步骤s322。Wherein step s324, judge whether each payload value of the output message has all been verified, if all verified, then enter step s326, confirm that the verification is passed, otherwise, in step s327, only keep the last payload value, then return to step s322.

例如:For example:

1)假设pkt2的净荷值17经逻辑处理后被改变为其他值如45,由于不符合45=16+1,故可判断净荷值45不正确,逻辑设备出错;1) Assuming that the payload value 17 of pkt2 is changed to other values such as 45 after logical processing, since it does not meet 45=16+1, it can be judged that the payload value 45 is incorrect and the logical device is wrong;

2)假设pkt2的净荷值16丢弃,由于不符合17=15+1,故可判断净荷值17不正确,逻辑设备出错;2) Assuming that the payload value 16 of pkt2 is discarded, since it does not meet 17=15+1, it can be judged that the payload value 17 is incorrect and the logic device is wrong;

3)假设pkt2整个报文被丢弃,由于不符合90=14+1,故可判断净荷值90不正确,逻辑设备出错。3) Assuming that the entire message of pkt2 is discarded, since it does not conform to 90=14+1, it can be judged that the payload value 90 is incorrect and the logical device is wrong.

可以看出,本发明可以方便准确的判断逻辑设备对报文净荷处理是否正确,同时不需要将输出的报文净荷内容与输入端的报文净荷内容的逐字节比较。It can be seen that the present invention can conveniently and accurately judge whether the logic device processes the payload of the message correctly, and at the same time does not need to compare the payload content of the message at the output end with the payload content of the message at the input terminal byte by byte.

上述实施例预定算法采用增量算法为例进行说明。事实上,本发明中还可采用其他算法,例如递减算法或者随机函数rand()算法,其实现原理与上述递增算法类似,由于具体算法不是本发明的关键,且无法进行穷举,这里不再赘述。The predetermined algorithm in the above embodiment is described by using the incremental algorithm as an example. In fact, other algorithms can also be used in the present invention, such as the decreasing algorithm or the random function rand() algorithm. repeat.

另外,上述按照预定算法产生输入报文净荷可以是按字节、字、双字为单位,相应验证时也以所述单位进行验证。In addition, the above-mentioned generation of the input message payload according to the predetermined algorithm may be in units of bytes, words, or double words, and verification is also performed in units of said units during corresponding verification.

本发明报文净荷透传逻辑的验证方法主要通过预定算法产生逻辑设备输入端的输入报文的各个净荷值,进而利用所述预定算法验证逻辑设备输出端的输出报文的净荷,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确定报文净荷透传逻辑出错。由于不需输入报文净荷内容和输出报文净荷内容之间按照逐字节比较的方式进行验证,同时没有CRC32算法的繁琐处理,可保证逻辑验证仿真和测试的速度优于现有技术。The verification method of the message payload transparent transmission logic of the present invention mainly generates each payload value of the input message at the input end of the logic device through a predetermined algorithm, and then uses the predetermined algorithm to verify the payload of the output message at the output end of the logic device. If each payload value of the message complies with the predetermined algorithm, it is confirmed that the verification is passed; otherwise, it is determined that the logic of transparent transmission of the message payload is wrong. Since there is no need to compare the payload content of the input message with the payload content of the output message byte by byte, and there is no cumbersome processing of the CRC32 algorithm, it can ensure that the speed of logic verification simulation and testing is better than that of the existing technology .

上述仅以优选实施例对本发明进行说明,非因此即局限本发明的权利范围,因此,在不脱离本发明思想的情况下,凡运用本发明说明书及附图内容所为的等效变化,均理同包含于本发明的权利要求范围内。The above only describes the present invention with preferred embodiments, and does not therefore limit the scope of rights of the present invention. Therefore, without departing from the idea of the present invention, all equivalent changes made by using the description and accompanying drawings of the present invention are all It is equally included in the scope of the claims of the present invention.

Claims (10)

1、一种报文净荷透传逻辑的验证方法,其特征在于,所述的方法包括如下步骤:1, a kind of verification method of message payload transparent transmission logic, it is characterized in that, described method comprises the steps: A、按照预定算法产生逻辑设备输入端输入报文的各个净荷值;A. Generate each payload value of the input message at the input terminal of the logic device according to a predetermined algorithm; B、依次判断所述逻辑设备输出端输出报文中的相邻的净荷值之间是否符合所述预定算法,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。B. sequentially judge whether the adjacent payload values in the output message of the logic device output conform to the predetermined algorithm, if each payload value of the output message conforms to the predetermined algorithm, then confirm that the verification is passed, Otherwise, it is confirmed that the logic device has a logic error. 2、根据权利要求1所述的报文净荷透传逻辑的验证方法,其特征在于,步骤A所述输入报文为一个流的报文,该流的前一报文的最后一个净荷值与紧接的后一报文的最前一个净荷值也符合所述预定算法。2. The verification method of message payload transparent transmission logic according to claim 1, wherein the input message in step A is a message of a flow, and the last payload of the previous message of the flow value and the first payload value of the immediately following message also conform to the predetermined algorithm. 3、根据权利要求1或2所述的报文净荷透传逻辑的验证方法,其特征在于,步骤B中所述验证具体包括如下步骤:3. The verification method of message payload transparent transmission logic according to claim 1 or 2, wherein the verification described in step B specifically includes the following steps: B1、读取一个净荷值;B1. Read a payload value; B2、继续读取下一个净荷值;B2. Continue to read the next payload value; B3、判断前一净荷值与后一净荷值是否符合所述预定算法,若符合所述预定算法,则进入B4,否则,进入B5;B3. Judging whether the previous payload value and the next payload value conform to the predetermined algorithm, if they conform to the predetermined algorithm, then go to B4, otherwise, go to B5; B4、判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则确认验证通过,否则,保留后一净荷值,然后返回B2;B4, judge whether each payload value of the output message has all been verified, if all verified, then confirm that the verification is passed, otherwise, keep the last payload value, and then return to B2; B5、确认逻辑设备逻辑出错,退出验证。B5. Confirm that the logical device has a logic error, and exit the verification. 4、根据权利要求3所述的报文净荷透传逻辑的验证方法,其特征在于,所述步骤A中输入报文的各个净荷值是按照字节、字或双字产生的。4. The method for verifying message payload transparent transmission logic according to claim 3, characterized in that, in the step A, each payload value of the input message is generated according to byte, word or double word. 5、根据权利要求3所述的报文净荷透传逻辑的验证方法,其特征在于,所述预定算法为递增算法。5. The method for verifying message payload transparent transmission logic according to claim 3, wherein the predetermined algorithm is an incremental algorithm. 6、一种报文净荷透传逻辑的验证装置,其特征在于,包括:6. A verification device for message payload transparent transmission logic, characterized in that it comprises: 逻辑验证报文产生单元,与逻辑设备输入端相连,用于按照预定算法产生逻辑设备输入端输入报文的各个净荷值;The logic verification message generation unit is connected to the input terminal of the logic device, and is used to generate each payload value of the input message at the input terminal of the logic device according to a predetermined algorithm; 逻辑验证单元,与逻辑设备输出端相连,用于依次判断所述逻辑设备输出端输出报文中的相邻的净荷值之间是否符合所述预定算法,若输出报文的各个净荷值符合所述预定算法,则确认验证通过,否则,确认所述逻辑设备逻辑出错。The logic verification unit is connected to the output terminal of the logic device, and is used to sequentially judge whether the adjacent payload values in the output message of the output terminal of the logic device conform to the predetermined algorithm, if each payload value of the output message If it conforms to the predetermined algorithm, it is confirmed that the verification is passed; otherwise, it is confirmed that the logical device has a logic error. 7、根据权利要求6所述的报文净荷透传逻辑的验证装置,其特征在于,所述输入报文为一个流的报文,该流的前一报文的最后一个净荷值与紧接的后一报文的最前一个净荷值也符合所述预定算法。7. The device for verifying message payload transparent transmission logic according to claim 6, wherein the input message is a message of a flow, and the last payload value of the previous message of the flow is the same as The first payload value of the immediately following message also complies with the predetermined algorithm. 8、根据权利要求6或7所述的报文净荷透传逻辑的验证装置,其特征在于,所述逻辑验证单元包括:8. The device for verifying message payload transparent transmission logic according to claim 6 or 7, wherein the logic verification unit includes: 读取模块,用于依次读取输出报文的各个净荷值;The reading module is used to sequentially read each payload value of the output message; 第一判断模块,用于判断所述读取模块读取的一个净荷值,以及读取模块后续继续读取的下一个净荷值是否符合预定算法,若符合预定算法,则判断为真,否则判断为假,确认逻辑设备逻辑出错;The first judging module is used to judge whether a payload value read by the reading module and the next payload value read by the reading module conforms to the predetermined algorithm, and if it conforms to the predetermined algorithm, the judgment is true, Otherwise, the judgment is false, and the logical device logic error is confirmed; 第二判断模块,若所述第一判断模块判断为真,则进一步判断输出报文的各个净荷值是否已全部验证完,若全部验证完,则确认验证通过,否则,保留后一净荷值,由所述读取模块继续读取下一净荷值交由第一判断模块继续判断。The second judging module, if the judgment of the first judging module is true, then further judge whether each payload value of the output message has been verified completely, if all verified, then confirm that the verification is passed, otherwise, keep the latter payload value, the reading module continues to read the next payload value and hand it over to the first judging module to continue judging. 9、根据权利要求8所述的报文净荷透传逻辑的验证装置,其特征在于,所述逻辑验证报文产生单元按照字节、字或双字产生输入报文的各个净荷值。9. The verification device of message payload transparent transmission logic according to claim 8, characterized in that, the logic verification message generation unit generates each payload value of the input message according to byte, word or double word. 10、根据权利要求8所述的报文净荷透传逻辑的验证装置,其特征在于,所述预定算法为递增算法。10. The device for verifying message payload transparent transmission logic according to claim 8, wherein the predetermined algorithm is an incremental algorithm.
CNB2004100339676A 2004-04-20 2004-04-20 Method and apparatus for message payload transparent transmission logic verification Expired - Fee Related CN100484042C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100339676A CN100484042C (en) 2004-04-20 2004-04-20 Method and apparatus for message payload transparent transmission logic verification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100339676A CN100484042C (en) 2004-04-20 2004-04-20 Method and apparatus for message payload transparent transmission logic verification

Publications (2)

Publication Number Publication Date
CN1691610A CN1691610A (en) 2005-11-02
CN100484042C true CN100484042C (en) 2009-04-29

Family

ID=35346756

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100339676A Expired - Fee Related CN100484042C (en) 2004-04-20 2004-04-20 Method and apparatus for message payload transparent transmission logic verification

Country Status (1)

Country Link
CN (1) CN100484042C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102301364B (en) 2011-06-27 2013-01-02 华为技术有限公司 Cpu interconnecting device
CN109061442A (en) * 2018-08-13 2018-12-21 迈普通信技术股份有限公司 Detection method, device and programmable chip

Also Published As

Publication number Publication date
CN1691610A (en) 2005-11-02

Similar Documents

Publication Publication Date Title
US7065702B2 (en) Out-of-order calculation of error detection codes
US8527834B2 (en) Information processing device and information processing method
CN101227263B (en) An online fault detection system, device and method
JP2000503498A (en) Error detection apparatus and method in multiple word communication
CN103200130B (en) Method and device for secure storage and selection of messages in LEU
CN104639294A (en) Improved CRC (Cyclic redundancy check) implementation method
US6732317B1 (en) Apparatus and method for applying multiple CRC generators to CRC calculation
US8165160B2 (en) Method and system to validate a write for a device on a serial bus
CN102394720A (en) Information safety checking processor
CN100484042C (en) Method and apparatus for message payload transparent transmission logic verification
CN116346278A (en) Sending method, receiving method, device, system, equipment and storage medium
CN110381050B (en) Multi-protocol conversion and verification method and device for data packet
US20050257117A1 (en) Method and circuit for determining an ending of an ethernet frame
CN118035156A (en) TLK 2711-based multichannel communication adapter
CN108959977B (en) Soft and hard hybrid decoding method suitable for SRAM PUF
CN117650999A (en) Ethernet hub with fault detection function and working method thereof
CN114448565B (en) Cyclic redundancy check calculation method, cyclic redundancy check calculation device, electronic equipment and storage medium
CN117354387A (en) HDLC module design method based on FPGA
US20230058854A1 (en) Method and system for sequencing data checks in a packet
CN101355403B (en) Error-detection error-correction device for universal frame-forming protocol and control method thereof
CN116685952A (en) A data transmission method and device
CN107944151A (en) The link-layer authentication platform and method of excitation and simulation result are preserved using binary system
CN101494518B (en) Packet Processing Method for Wireless Communication
CN116722954B (en) Encoding and decoding verification system, method, equipment and storage medium
CN117914444B (en) Hardware implementation method and device for CRC calculation of IB network data packet

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090429

Termination date: 20100420