Data transmission checking device and method

文档序号:1660256 发布日期:2019-12-27 浏览:10次 中文

阅读说明:本技术 数据传输校验装置及方法 (Data transmission checking device and method ) 是由 张益铭 郑宏彬 于 2018-06-20 设计创作,主要内容包括:一种数据传输校验方法,用于校验由第一设备传输至第二设备的数据,包括:接收并获取N+1个信号引脚的信号值;对所述N+1个信号引脚的信号值进行求和运算,并将求得的和进行第一次取模运算;判断所述第一次取模运算的结果是否等于零;及若所述第一次取模运算的结果不等于零,控制所述第二设备拒绝接收所述数据。本发明还提供一种数据传输校验装置。上述数据传输校验装置及方法,通过结合数据校验位及取模校验算法实现对设备之间传输的数据进行校验,提高数据传输可靠性。(A data transmission verification method for verifying data transmitted by a first device to a second device, comprising: receiving and acquiring signal values of N +1 signal pins; carrying out summation operation on the signal values of the N +1 signal pins, and carrying out first modular operation on the obtained sum; judging whether the result of the first modular operation is equal to zero or not; and if the result of the first modular operation is not equal to zero, controlling the second equipment to refuse to receive the data. The invention also provides a data transmission checking device. According to the data transmission checking device and the data transmission checking method, the data transmitted between the devices are checked by combining the data check bits and the modulus checking algorithm, and the data transmission reliability is improved.)

1. A data transmission/verification method for verifying data transmitted from a first device to a second device, the first device transmitting the data to the second device via a data line, the data line including first to nth bit signal pins for transmitting the data, the data line further including an N +1 th bit signal pin for transmitting verification information, the data transmission/verification method comprising the steps of:

receiving and acquiring signal values of the N +1 signal pins;

carrying out summation operation on the signal values of the N +1 signal pins, and carrying out first modular operation on the obtained sum;

judging whether the result of the first modular operation is equal to zero or not; and

and if the result of the first modular operation is not equal to zero, controlling the second equipment to refuse to receive the data.

2. The data transmission verification method of claim 1, wherein the data line further includes an N + 2-bit signal pin for transmitting the verification information, and the step of determining whether the result of the first modulo operation is equal to zero further includes:

if the result of the first modular operation is equal to zero, multiplying the signal value of the even-numbered signal pin in the N +1 signal pins by 2;

carrying out summation operation on the signal values of the N +1 signal pins subjected to multiplication operation, and carrying out second modular operation on the obtained sum;

judging whether the result of the second modular operation is equal to the signal value of the (N + 2) th bit signal pin or not; and

and if the result of the second modular operation is equal to the signal value of the (N + 2) th bit signal pin, controlling the second equipment to receive the data.

3. The data transmission checking method of claim 2, wherein the data transmission checking method further comprises:

and if the result of the second modular operation is not equal to the signal value of the (N + 2) th bit signal pin, controlling the second equipment to refuse to receive the data.

4. The data transmission checking method of claim 3, wherein the first modulo operation and the second modulo operation are modulo-2 operations.

5. The data transmission verification method of claim 1, wherein the data line is a CAT5 network line, and the number N is equal to or less than 6.

6. A data transmission checking device is used for checking data transmitted from first equipment to second equipment, the first equipment transmits the data to the second equipment through a data line, the data line comprises first to N bit signal pins used for transmitting the data, the data line is characterized by further comprising N +1 bit signal pins used for transmitting checking information, and the data transmission checking device comprises:

a processor adapted to implement instructions; and

a memory adapted to store a plurality of instructions adapted to be executed by the processor to:

receiving and acquiring signal values of the N +1 signal pins;

carrying out summation operation on the signal values of the N +1 signal pins, and carrying out first modular operation on the obtained sum;

judging whether the result of the first modular operation is equal to zero or not; and

and if the result of the first modular operation is not equal to zero, controlling the second equipment to refuse to receive the data.

7. The data transmission verification apparatus according to claim 6, wherein the data line further includes an N + 2-bit signal pin for transmitting the verification information, and the instruction for determining whether the result of the first modulo operation is equal to zero further includes:

if the result of the first modular operation is equal to zero, multiplying the signal value of the even-numbered signal pin in the N +1 signal pins by 2;

carrying out summation operation on the signal values of the N +1 signal pins subjected to multiplication operation, and carrying out second modular operation on the obtained sum;

judging whether the result of the second modular operation is equal to the signal value of the (N + 2) th bit signal pin or not; and

and if the result of the second modular operation is equal to the signal value of the (N + 2) th bit signal pin, controlling the second equipment to receive the data.

8. The data transmission checking apparatus of claim 7, wherein the instructions further comprise:

and if the result of the second modular operation is not equal to the signal value of the (N + 2) th bit signal pin, controlling the second equipment to refuse to receive the data.

9. The data transmission verification apparatus of claim 8, wherein the first modulo operation and the second modulo operation are modulo-2 operations.

10. The data transmission verification apparatus of claim 6, wherein the data line is a CAT5 network line, and the number N is equal to or less than 6.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a data transmission verification apparatus and method.

Background

Digital communication is the use of digital signals to communicate information, including signal sources and signal destinations. In order to ensure the correctness of data transmission, the received data generally needs to be checked. In the existing data verification scheme, a check bit is generally added on original data, and whether the received data is correct or not is confirmed by verifying the data on the check bit during receiving, so that error verification still possibly occurs, and the reliability of data transmission is reduced.

Disclosure of Invention

In view of the above, it is desirable to provide a data transmission verification apparatus and method, which can improve the reliability of data transmission.

An embodiment of the present invention provides a data transmission and verification method, configured to verify data transmitted from a first device to a second device, where the first device transmits the data to the second device through a data line, and the data line includes first to nth bit signal pins for transmitting the data. The data line further comprises an N +1 bit signal pin for transmitting verification information, and the data transmission verification method comprises the following steps: receiving and acquiring signal values of the N +1 signal pins; carrying out summation operation on the signal values of the N +1 signal pins, and carrying out first modular operation on the obtained sum; judging whether the result of the first modular operation is equal to zero or not; and if the result of the first modular operation is not equal to zero, controlling the second equipment to refuse to receive the data.

An embodiment of the present invention provides a data transmission checking apparatus, configured to check data transmitted from a first device to a second device, where the first device transmits the data to the second device through a data line, and the data line includes first to nth bit signal pins for transmitting the data. The data line further includes an N +1 th bit signal pin for transmitting a verification information, the data transmission verification apparatus includes: a processor adapted to implement instructions; and a memory adapted to store a plurality of instructions adapted to be executed by the processor to: receiving and acquiring signal values of the N +1 signal pins; carrying out summation operation on the signal values of the N +1 signal pins, and carrying out first modular operation on the obtained sum; judging whether the result of the first modular operation is equal to zero or not; and if the result of the first modular operation is not equal to zero, controlling the second equipment to refuse to receive the data.

Compared with the prior art, the data transmission checking device and the data transmission checking method have the advantages that the data transmitted between the devices are checked by combining the data check bits and the modulus check algorithm, and the data transmission reliability is improved.

Drawings

Fig. 1 is a diagram illustrating an operation scenario of a data transmission verification apparatus according to an embodiment of the present invention.

Fig. 2 is a functional block diagram of a data transmission verification apparatus according to an embodiment of the present invention.

Fig. 3 is a functional block diagram of a data transmission verification system according to an embodiment of the present invention.

Fig. 4 is a flowchart illustrating steps of a data transmission checking method according to an embodiment of the present invention.

Description of the main elements

Detailed Description

The following detailed description will further illustrate the invention in conjunction with the above-described figures.

Referring to fig. 1-3, an embodiment of the invention provides a data transmission verification apparatus 100 for verifying data transmitted from a first device 110 to a second device 120. The first device 110 transmits the data to the second device 120 through a data line 130, and the data line 130 includes first to nth bit signal pins P for transmitting the data1~Pn

For example, the first device 110 is a rack management device, and the second device 120 is a server. The first device 110 includes a first connection port 140 and the second device 120 includes a second connection port 150. One end of the data line 130 is plugged into the first connection port 140, and the other end is plugged into the second connection port 150, so as to implement data transmission between the first device 110 and the second device 120.

In an embodiment, the data transmission verification apparatus 100 may be disposed in the second device 120, orIndependently of said second device 120, to verify the data transmitted by the first device 110 to the second device 120. The data line 130 further includes an N +1 th bit signal pin P for transmitting a check informationn+1. In other embodiments of the present invention, the data transmission checking apparatus 100 may also be disposed in the first device 110, or be independent from the first device 110, so as to check the data transmitted from the second device 120 to the first device 110.

The data transmission verification device 100 includes a memory 11, a processor 12 and a data transmission verification system 13. The data transmission verification system 13 may be partitioned into one or more modules that are stored in the memory 11 and executed by one or more processors (e.g., the processor 12 in this embodiment) to perform the functions of the present invention. The data transmission verification system 13 may be divided into an acquisition module 10, a calculation module 20, a judgment module 30 and a reception control module 40. The module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the data transmission verification system 13 in the data transmission verification apparatus 100.

In one embodiment, the memory 11 may include at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip.

The obtaining module 10 is configured to receive and obtain signal values of the N +1 signal pins.

In one embodiment, the signal value is preferably a binary signal value, and the signal value of each signal pin is a logic "1" or a logic "0". The N +1 th bit signalPin Pn+1For the check bit, the N +1 th bit signal pin Pn+1The signal value of (a) can be set according to the actual detection requirement, such as setting the (N +1) th bit signal pin Pn+1Is set to logic '1', or the N +1 th bit signal pin Pn+1The signal value of (a) is set to logic "0".

The calculation module 20 is configured to perform summation operation on the signal values of the N +1 signal pins, and perform a first modulo operation on the obtained sum.

In one embodiment, the first modulo operation is preferably a modulo-2 operation. For example, if the first to N +1 th bit signal pins P1~Pn+1The sum of the signal values of the N +1 signal pins is 1+1+1+1+1+0+1 is 6, and the calculation module 20 performs the first modulo operation on the obtained sum to obtain (1+1+1+1+ 0+1) (mod 2) is 0. If the first to N +1 th bit signal pins P1~Pn+1The sum of the signal values of the N +1 signal pins is 1+1+1+1+1+1+ 1+ 7, and the calculation module 20 performs the first modulo operation on the obtained sum to obtain (1+1+1+1+1+ 1) (mod 2) 1.

The determining module 30 is configured to determine whether a result of the first modulo operation is equal to zero.

The receiving control module 40 is configured to control the second device 120 to reject receiving the data transmitted from the first device 110 when the result of the first modulo operation is not equal to zero.

For example, if the first device 110 passes through the first to N +1 th bit signal pins P1~Pn+1The transmitted data is "111111", and the check bit (the N +1 th bit signal pin P)n+1) Is "1". The second device 120 receives data "111011", and the result of performing the first modulo operation on the received data is 1+1+1+0+1+1) (mod 2) is 1, and since the result of the first modulo operation is not equal to zero, the reception control module 40 controls the second device 120 to refuse to receive the data "111011".

In one embodiment, the numberThe data line 130 further includes an N + 2-bit signal pin P for transmitting the verification informationn+2. The N +2 th bit signal pin Pn+2Can be set according to actual detection requirements, such as setting the N +2 th bit signal pin Pn+2Is set to logic '1', or the N +2 th bit signal pin Pn+2The signal value of (a) is set to logic "0".

If the result of the first modulo operation is equal to zero, the computing module 20 is further configured to apply the N +1 signal pins (the first to N + 1-th bit signal pins P)1~Pn+1) The signal values of the even-numbered signal pins in the circuit are multiplied by 2, the signal values of the N +1 signal pins subjected to multiplication are summed, and the obtained sum is subjected to a second modular operation. The determining module 30 is further configured to determine whether the result of the second modulo operation is equal to the N +2 th bit signal pin Pn+2The signal value of (a). The receiving control module 40 is further configured to perform a second modulo operation on the result of the second modulo operation equal to the N +2 th bit signal pin Pn+2Controls the second device 120 to receive the data. If the result of the second modulo operation is not equal to the N +2 th bit signal pin Pn+2The reception control module 40 controls the second device 120 to refuse to receive the data. The second modulo operation is preferably a modulo-2 operation.

For example, if the first device 110 passes through the first to N +2 th bit signal pins P1~Pn+2The transmitted data is "1111111", i.e., the first to N-th bit signal pins P1~PnIs '11111', the N +1 th bit signal pin Pn+1The signal value of (1), the N +2 th bit signal pin Pn+2The signal value of (1). The data transmission verification apparatus 100 detects that the data received by the second device 120 is "1111111", and the first to N +1 th bit signal pins P1-P in the received datan+1The result of the first modulo operation is 1+1+1+1+1+1) (mod 2) is 0, and a second check is required since the result of the first modulo operation is zero, the first to N +1 th bitsSignal pins P1-Pn+1The signal value of the even number signal pin in the (1) is multiplied by 2, then the summation is 1+1 × 2+1+1 × 2 ═ 9, then the obtained summation is processed by the second modulus operation, (1+1 × 2+1+1 × 2) (mod 2) ═ 1, and the result of the second modulus operation is equal to the N +2 signal pin Pn+2The reception control module 40 controls the second device 120 to receive the data '1111111'.

If the data transmitted by the first device 110 through the first to N +2 th bit signal pins is "1111111", that is, the first to N-th bit signal pins P1~PnIs '11111', the N +1 th bit signal pin Pn+1The signal value of (1), the N +2 th bit signal pin Pn+2The signal value of (1). The data transmission verification apparatus 100 detects that the data received by the second device 120 is "0011110", and the first to N +1 th bit signal pins P in the received data are1~Pn+1The result of the first modulo operation is 0+0+1+1+ 1) (mod 2) 0, and a second check is required because the result of the first modulo operation is zero, and the first to N +1 th bit signal pins P1 to Pn+1In the above-mentioned method, the signal value of the even-numbered signal pin is multiplied by 2, then the summation is made to be 0+ 2+1+ 2 ═ 6, then the obtained sum is made to be (0+ 2+1+ 2) (mod 2) ═ 0, and the result of said second modulo operation is not equal to the result of said N + 2-numbered signal pin Pn+2The reception control module 40 controls the second device 120 to refuse to receive the data "0011110".

In one embodiment, the data line 130 is preferably a CAT5 network line, and the CAT5 network line has 8 data lines, two of which are used for transmitting verification information, and the number N is preferably 6 or less.

Fig. 4 is a flowchart of a data transmission checking method according to an embodiment of the present invention. The method may be used in the data transmission verification system 13 shown in fig. 3.

In step S400, the obtaining module 10 receives and obtains the signal values of the N +1 signal pins.

In step S402, the calculating module 20 performs summation operation on the signal values of the N +1 signal pins, and performs a first modulo operation on the obtained sum.

In step S404, the determining module 30 determines whether the result of the first modulo operation is equal to zero.

In step S406, if the result of the first modulo operation is not equal to zero, the receiving control module 40 controls the second device 120 to reject receiving the data transmitted from the first device 110.

Step S408, if the result of the first modulo operation is equal to zero, the calculation module 20 performs a multiplication operation of multiplying the signal values of the even-numbered signal pins in the N +1 signal pins by 2, then performs a summation operation on the signal values of the N +1 signal pins subjected to the multiplication operation, and performs a second modulo operation on the obtained sum;

step S410: the determining module 30 determines whether the result of the second modulo operation is equal to the signal value of the N +2 th bit signal pin;

step S412: if the result of the second modulo operation is equal to the signal value of the N +2 th bit signal pin, the receiving control module 40 controls the second device to receive the data;

step S414: if the result of the second modulo operation is not equal to the signal value of the N +2 th bit signal pin, the receiving control module 40 controls the second device to refuse to receive the data.

According to the data transmission checking device and the data transmission checking method, the data transmitted between the devices are checked by adding the data check bits and the modulo checking algorithm, and the success rate of data checking is improved.

It will be apparent to those skilled in the art that other variations and modifications may be made in accordance with the invention and its spirit and scope in accordance with the practice of the invention disclosed herein.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于FPGA的数据解压装置及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类