[go: up one dir, main page]

CN108242973B - Data error correction method and device - Google Patents

Data error correction method and device Download PDF

Info

Publication number
CN108242973B
CN108242973B CN201611217683.1A CN201611217683A CN108242973B CN 108242973 B CN108242973 B CN 108242973B CN 201611217683 A CN201611217683 A CN 201611217683A CN 108242973 B CN108242973 B CN 108242973B
Authority
CN
China
Prior art keywords
data
bit
bits
bit data
error
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
CN201611217683.1A
Other languages
Chinese (zh)
Other versions
CN108242973A (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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN201611217683.1A priority Critical patent/CN108242973B/en
Publication of CN108242973A publication Critical patent/CN108242973A/en
Application granted granted Critical
Publication of CN108242973B publication Critical patent/CN108242973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0041Arrangements at the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

本发明实施例提供了一种数据纠错方法及装置,应用于包含发送模块和接收模块的器件,方法包括:对于所述器件的发送模块,针对待传输的N位数据进行网状逻辑编码,获得编码数据;将所述编码数据发送给所述器件的接收模块;对于所述器件的接收模块,根据所述组合规则对接收到的编码数据进行拆分,得到所述N位数据的每一位数据与所述每组至少两位数据对应的校验位数据;根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据;当发生错误的数据包含所传输的N位数据中的至少一位数据时,对所述N位数据中的至少一位数据进行纠错。利用本发明实施例,提高了器件的可靠性。

Figure 201611217683

Embodiments of the present invention provide a data error correction method and device, which are applied to a device including a sending module and a receiving module. The method includes: performing mesh logic coding on the N-bit data to be transmitted for the sending module of the device, Obtain coded data; send the coded data to the receiving module of the device; for the receiving module of the device, split the received coded data according to the combination rule to obtain each of the N bits of data Bit data and the check digit data corresponding to the at least two bits of data in each group; according to the N-bit data and the check digit data corresponding to the at least two bits of data in each group, use logical operations to determine the number of bits in the encoded data. Error-occurring data; when the error-occurring data includes at least one bit of the transmitted N-bit data, perform error correction on at least one bit of the N-bit data. By using the embodiments of the present invention, the reliability of the device is improved.

Figure 201611217683

Description

一种数据纠错方法及装置A data error correction method and device

技术领域technical field

本发明涉及通信技术领域,特别是涉及一种数据纠错方法及装置。The present invention relates to the field of communication technologies, and in particular, to a data error correction method and device.

背景技术Background technique

在整个航天和核电等领域的发展过程中,基于SRAM(Static Random AccessMemory,静态随机存取存储器)型FPGA(Field Programmable Gate Array,现场可编程门阵列)具有功能集成度高、资源丰富、设计灵活的优点,但也存在一定风险。比如在航天领域中,在外太空恶劣的辐射环境下其容易受到高位带电粒子的影响,会遭受到各种各样的太空复杂环境的辐射,造成单粒子翻转、多粒子翻转等现象的发生,从而导致FPGA器件发生通信数据的功能性错误,因此需要针对上述现象进行相应的通信数据加固。其中,单粒子翻转主要是指通信数据中的一位比特发生0/1翻转,多粒子翻转主要是指通信数据中的两位或多位比特发生0/1翻转,其中,航天领域中发生三比特及以上数据翻转错误的概率非常低。In the development process of the entire aerospace and nuclear power fields, FPGA (Field Programmable Gate Array) based on SRAM (Static Random Access Memory) has high functional integration, rich resources and flexible design. advantages, but there are also certain risks. For example, in the aerospace field, in the harsh radiation environment of outer space, it is easily affected by high-level charged particles, and will be exposed to various kinds of radiation from the complex space environment, resulting in the occurrence of single-particle flipping, multi-particle flipping and other phenomena. A functional error of communication data occurs in the FPGA device, so corresponding communication data reinforcement needs to be carried out for the above phenomenon. Among them, the single event flip mainly refers to the 0/1 flip of one bit in the communication data, and the multi-event flip mainly refers to the 0/1 flip of two or more bits in the communication data. Among them, three occur in the aerospace field. The probability of bit and above data flipping errors is very low.

目前,在航天或核电站的FPGA中,常用于数据加固的冗余技术为TMR(TripleModular Redundancy,三模冗余)、部分TMR、重复与比较(DWC,Duplication WithCompare)、降低冗余精度(RPR,reduced precision redundancy)等等。其中,TMR技术将输入的原始数据直接复制两份,将两份复制数据与原始数据组合,得到编码数据,在输出口通过一个多数表决器对编码数据中的三份数据进行选择,例如原始数据为000,编码数据为000000000,在传输过程中发生单比特翻转,编码数据变为000000100,在输出口通过多数表决器,会输出编码数据中的000,作为解码数据。但是,当在传输过程中发生多比特错误时,例如编码数据出错变为010010000,此时在输出口会输出错误的解码数据010。可见,TMR无法解决双比特及以上的数据翻转错误,其只能针对于FPGA上的单粒子翻转进行数据加固,而不能处理多粒子翻转错误的情况,导致FPGA器件的可靠性较低。At present, in FPGAs of aerospace or nuclear power plants, the commonly used redundancy technologies for data reinforcement are TMR (Triple Modular Redundancy), partial TMR, Duplication With Compare (DWC, Duplication WithCompare), and reduced redundancy precision (RPR, reduced precision redundancy) and so on. Among them, the TMR technology directly copies the input original data in two copies, combines the two copies of the copied data with the original data to obtain encoded data, and selects three copies of the encoded data through a majority voter at the output port, such as the original data. is 000, the encoded data is 000000000, a single-bit flip occurs during the transmission process, the encoded data becomes 000000100, and the majority voter at the output port will output 000 in the encoded data as the decoded data. However, when a multi-bit error occurs during transmission, for example, the encoded data error becomes 010010000, and the wrong decoded data 010 will be output at the output port. It can be seen that TMR cannot solve data flipping errors of two bits and above. It can only perform data reinforcement for single-event flipping on FPGA, but cannot handle multi-particle flipping errors, resulting in low reliability of FPGA devices.

发明内容SUMMARY OF THE INVENTION

本发明实施例的目的在于提供一种数据纠错方法及装置,以实现提高器件可靠性的目的。The purpose of the embodiments of the present invention is to provide a data error correction method and device, so as to achieve the purpose of improving device reliability.

为达到上述目的,本发明实施例提供了一种数据纠错方法,应用于包含发送模块和接收模块的器件,方法包括:In order to achieve the above object, an embodiment of the present invention provides a data error correction method, which is applied to a device including a sending module and a receiving module, and the method includes:

对于所述器件的发送模块,执行以下操作:For the device's transmit module, do the following:

针对待传输的N位数据进行网状逻辑编码,获得编码数据;Perform mesh logic coding on the N-bit data to be transmitted to obtain coded data;

其中,所述进行网状逻辑编码的步骤,包括:针对待传输的N位数据中的M位数据,对所述M位数据中的每组至少两位数据,分别进行逻辑运算,得到针对每组至少两位数据对应的校验位数据;按照预设组合规则,将所述N位数据与所述校验位数据进行组合,得到编码数据,其中,M小于等于N,N不小于4,所述逻辑运算为异或运算、同或运算、与运算、或运算、非运算、与非运算、或非运算、或者与或非运算;Wherein, the step of performing mesh logic coding includes: for M-bit data in the N-bit data to be transmitted, performing logical operations on each group of at least two bits of data in the M-bit data, respectively, to obtain a Set the check digit data corresponding to at least two bits of data; according to the preset combination rule, combine the N-bit data and the check digit data to obtain encoded data, wherein M is less than or equal to N, and N is not less than 4, The logical operation is an exclusive-OR operation, an exclusive-OR operation, an AND operation, an OR operation, a NOT operation, a NAND operation, a NOR operation, or an AND-NOR operation;

将所述编码数据发送给所述器件的接收模块;sending the encoded data to a receiving module of the device;

对于所述器件的接收模块,执行以下操作:For the receiving module of the device, do the following:

根据所述组合规则对接收到的编码数据进行拆分,得到所述N位数据的每一位数据与所述每组至少两位数据对应的校验位数据;Splitting the received encoded data according to the combination rule to obtain check digit data corresponding to each bit of the N-bit data and the at least two bits of data in each group;

根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据;According to the N-bit data and the parity bit data corresponding to the at least two bits of data in each group, use a logical operation to determine the erroneous data in the encoded data;

当发生错误的数据包含所传输的N位数据中的至少一位数据时,对所述N位数据中的至少一位数据进行纠错。When the erroneous data includes at least one bit of the transmitted N-bit data, error correction is performed on at least one bit of the N-bit data.

较佳的,所述根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据,包括:Preferably, according to the N-bit data and the parity bit data corresponding to each group of at least two bits of data, using a logical operation to determine the erroneous data in the encoded data, including:

分别针对所述N位数据中的每组至少两位数据和与其对应的校验位数据,进行逻辑运算,得到运算结果;根据运算结果为指定值的逻辑运算个数K,以及运算结果为指定值的K个逻辑运算所包含的公共数据位的个数,确定所述编码数据中发生错误的数据,其中,所述公共数据位为所述K个逻辑运算中至少两个逻辑运算所包含的相同数据位,K小于等于所有运算结果对应的逻辑运算个数。For each group of at least two bits of data in the N-bit data and its corresponding check digit data, perform logical operations to obtain the result of the operation; according to the result of the operation, the logical operation number K of the specified value, and the result of the operation is the specified value The number of common data bits included in the K logic operations of the value, to determine the data in which the error occurs in the encoded data, wherein the common data bits are included in at least two logic operations in the K logic operations For the same data bits, K is less than or equal to the number of logical operations corresponding to all operation results.

较佳的,所述对所述N位数据中的至少一位数据进行纠错,包括:Preferably, performing error correction on at least one bit of the N-bit data includes:

当确定的错误数据包含所述N位数据中的一位错误数据时,对所确定的一位数据取反。When the determined erroneous data includes one bit of erroneous data in the N-bit data, the determined one-bit data is inverted.

较佳的,所述对所述N位数据中的至少一位数据进行纠错,包括:Preferably, performing error correction on at least one bit of the N-bit data includes:

当确定出的错误数据包含所述N位数据中的至少两位错误数据时,分别对所确定的所述N位数据中的至少两位数据取反。When the determined error data includes at least two bits of error data in the N-bit data, at least two bits of the determined N-bit data are respectively inverted.

较佳的,所述包含发送模块和接收模块的器件为:现场可编程逻辑门阵列器件或包含FIFO、DDR、DRAM或ram-based的器件。Preferably, the device including the sending module and the receiving module is a field programmable logic gate array device or a device including FIFO, DDR, DRAM or ram-based.

为达到上述目的,本发明实施例提供了一种数据纠错装置,装置包括:In order to achieve the above purpose, an embodiment of the present invention provides a data error correction device, the device includes:

网状逻辑编码单元,用于所述器件的发送模块,针对待传输的N位数据进行网状逻辑编码,获得编码数据;其中,所述进行网状逻辑编码的过程包括:针对待传输的N位数据中的M位数据,对所述M位数据中的每组至少两位数据,分别进行逻辑运算,得到针对每组至少两位数据对应的校验位数据;按照预设组合规则,将所述N位数据与所述校验位数据进行组合,得到编码数据,其中,M小于等于N,N不小于4,所述逻辑运算为异或运算、同或运算、与运算、或运算、非运算、与非运算、或非运算、或者与或非运算;The mesh logic coding unit is used for the sending module of the device to perform mesh logic coding on the N-bit data to be transmitted to obtain encoded data; wherein, the process of performing mesh logic coding includes: for the N bits of data to be transmitted For the M-bit data in the bit data, logical operations are respectively performed on each group of at least two bits of data in the M-bit data to obtain the check digit data corresponding to each group of at least two bits of data; according to the preset combination rule, the The N-bit data is combined with the check bit data to obtain encoded data, wherein M is less than or equal to N, and N is not less than 4, and the logical operation is an exclusive-OR operation, an exclusive-OR operation, an AND operation, an OR operation, NOT, AND NOT, OR NOT, OR AND OR NOT;

发送单元,用于将所述编码数据发送给所述器件的接收模块;a sending unit for sending the encoded data to a receiving module of the device;

拆分单元,用于所述器件的接收模块,根据所述组合规则对接收到的编码数据进行拆分,得到所述N位数据的每一位数据与所述每组至少两位数据对应的校验位数据;The splitting unit is used for the receiving module of the device, and splits the received encoded data according to the combination rule, and obtains the data corresponding to each bit of the N-bit data and the at least two bits of each group of data. check digit data;

运算单元,用于根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据;an arithmetic unit, configured to determine, according to the N-bit data and the parity bit data corresponding to each group of at least two bits of data, the data in which the error occurs in the encoded data by using a logical operation;

纠错单元,用于当发生错误的数据包含所传输的N位数据中的至少一位数据时,对所述N位数据中的至少一位数据进行纠错。An error correction unit, configured to perform error correction on at least one bit of the N-bit data when the data in which the error occurs includes at least one bit of the transmitted N-bit data.

较佳的,所述运算单元具体包括:Preferably, the computing unit specifically includes:

逻辑运算子单元,用于分别针对所述N位数据中的每组至少两位数据和与其对应的校验位数据,进行逻辑运算,得到运算结果;a logical operation subunit for performing logical operations on each group of at least two bits of data in the N-bit data and its corresponding parity bit data to obtain an operation result;

错误位查找子单元,用于根据运算结果为指定值的逻辑运算个数K,以及运算结果为指定值的K个逻辑运算所包含的公共数据位的个数,确定所述编码数据中发生错误的数据,其中,所述公共数据位为所述K个逻辑运算中至少两个逻辑运算所包含的相同数据位,K小于等于所有运算结果对应的逻辑运算个数。The error bit search subunit is used to determine that an error occurs in the encoded data according to the number K of logical operations whose operation result is a specified value, and the number of common data bits included in the K logical operations whose operation result is a specified value , wherein the common data bits are the same data bits included in at least two of the K logical operations, and K is less than or equal to the number of logical operations corresponding to all the operation results.

较佳的,所述纠错单元具体包括:Preferably, the error correction unit specifically includes:

第一取反子单元,用于当确定的错误数据包含所述N位数据中的一位数据时,对所确定的一位数据取反。The first inversion subunit is configured to invert the determined one-bit data when the determined erroneous data includes one-bit data in the N-bit data.

较佳的,所述纠错单元还具体包括:Preferably, the error correction unit further specifically includes:

第二取反子单元,用于当确定出的错误数据包含所述N位数据中的至少两位数据时,分别对所确定的所述N位数据中的至少两位数据取反。The second inversion subunit is configured to respectively invert at least two bits of the determined N-bit data when the determined erroneous data includes at least two bits of the N-bit data.

较佳的,所述装置为:现场可编程逻辑门阵列器件或包含FIFO、DDR、DRAM或ram-based的器件。Preferably, the device is: a field programmable logic gate array device or a device including FIFO, DDR, DRAM or ram-based.

本发明实施例提供的一种数据纠错方法及装置,可以利用网状逻辑编码对待传输的N位数据进行编码得到编码数据,接收模块可以根据所传输的编码数据中的校验位数据和N位数据,利用逻辑运算对N位数据进行检错和纠错。不仅可以针对单粒子翻转,对于多粒子翻转也可以实现检错并纠错的目的,从而对器件内通信数据进行更好的加固,提高了器件的稳定性和可靠性。进一步地,本发明实施例还可以应用于包含FIFO、DDR、DRAM或ram-based的器件,进行器件内部的数据错误检测和错误纠正。当然,实施本发明的任一产品或方法必不一定需要同时达到以上所述的所有优点。The data error correction method and device provided by the embodiments of the present invention can use mesh logic coding to encode N-bit data to be transmitted to obtain encoded data, and the receiving module can obtain encoded data according to the parity bit data in the transmitted encoded data and the N-bit data. Bit data, using logical operations to perform error detection and error correction on N-bit data. Not only for single-particle flipping, but also for multi-particle flipping, the purpose of error detection and correction can be achieved, so as to better reinforce the communication data in the device and improve the stability and reliability of the device. Further, the embodiments of the present invention can also be applied to devices including FIFO, DDR, DRAM, or ram-based to perform data error detection and error correction inside the device. Of course, it is not necessary for any product or method to implement the present invention to simultaneously achieve all of the advantages described above.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例提供的数据纠错方法的一种流程示意图;1 is a schematic flowchart of a data error correction method provided by an embodiment of the present invention;

图2为本发明实施例提供的待传输的5位数据与校验位数据的关系示意图;2 is a schematic diagram of the relationship between 5-bit data to be transmitted and parity bit data provided by an embodiment of the present invention;

图3为本发明实施例提供的数据纠错装置的一种结构示意图。FIG. 3 is a schematic structural diagram of a data error correction apparatus provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

下面首先对本发明实施例提供的一种数据纠错方法进行详细说明。A data error correction method provided by an embodiment of the present invention is first described in detail below.

需要说明的是,本发明实施例优选适用于包含发送模块和接收模块的器件。具体的,在实际应用中,该器件可以为:现场可编程逻辑门阵列器件或包含FIFO(First InputFirst Output,先进先出)、DDR(Double Data Rate,双倍速率同步动态随机存储器)、DRAM(Dynamic Random Access Memory,动态随机存取存储器)或ram-based的器件,例如航天系统或核电站的FPGA器件等等。It should be noted that the embodiments of the present invention are preferably applicable to a device including a sending module and a receiving module. Specifically, in practical applications, the device can be: a field programmable logic gate array device or a FIFO (First InputFirst Output, first-in first-out), DDR (Double Data Rate, double-rate synchronous dynamic random access memory), DRAM ( Dynamic Random Access Memory) or ram-based devices, such as FPGA devices in aerospace systems or nuclear power plants, etc.

参见图1,图1为本发明实施例提供的数据纠错方法的一种流程示意图,可以包括如下步骤:Referring to FIG. 1, FIG. 1 is a schematic flowchart of a data error correction method provided by an embodiment of the present invention, which may include the following steps:

对于所述器件的发送模块,执行以下操作:For the device's transmit module, do the following:

S101,针对待传输的N位数据进行网状逻辑编码,获得编码数据;S101, performing mesh logic coding on the N-bit data to be transmitted to obtain coded data;

具体的,所述进行网状逻辑编码的步骤,包括:针对待传输的N位数据中的M位数据,对所述M位数据中的每组至少两位数据,分别进行逻辑运算,得到针对每组至少两位数据对应的校验位数据;按照预设组合规则,将所述N位数据与所述校验位数据进行组合,得到编码数据,其中,M小于等于N,N不小于4,所述逻辑运算为异或运算、同或运算、与运算、或运算、非运算、与非运算、或非运算、或者与或非运算;Specifically, the step of performing mesh logic coding includes: for M-bit data in the N-bit data to be transmitted, performing logical operations on each group of at least two bits of data in the M-bit data, respectively, to obtain the Check digit data corresponding to at least two bits of data in each group; according to preset combination rules, combine the N-bit data with the check digit data to obtain encoded data, where M is less than or equal to N, and N is not less than 4 , the logical operation is an exclusive-OR operation, an exclusive-OR operation, an AND operation, an OR operation, a NOT operation, a NAND operation, a NOR operation, or an AND-NOR operation;

示例性的,以下均以逻辑运算是异或运算为例,对本发明实施例提供的一种数据纠错方法进行详细说明。Exemplarily, a data error correction method provided by an embodiment of the present invention will be described in detail below by taking the logical operation being an exclusive OR operation as an example.

示例性的,预设组合规则可以为:原始数据位在低位,校验位在高位。在N等于5、M等于5时,针对待传输的5位原始数据b1、b2、b3、b4、b5,对原始数据中的每组2位数据,分别进行异或运算,异或运算过程可以如表1所示。Exemplarily, the preset combination rule may be: the original data bits are in the low bits, and the check bits are in the high bits. When N is equal to 5 and M is equal to 5, for the 5-bit original data to be transmitted b 1 , b 2 , b 3 , b 4 , b 5 , perform an exclusive OR operation on each group of 2-bit data in the original data, respectively, The XOR operation process can be shown in Table 1.

表1Table 1

Figure BDA0001192139510000061
Figure BDA0001192139510000061

由表1可以看出,经过异或运算,可以得到针对每组2位数据对应的校验位eq12、eq13、eq14、eq15、eq23、eq24、eq25、eq34、eq35和eq45,其中,该5位原始数据与得到的校验位之间的关系如图2所示;按照预设的原始数据位在低位、校验位在高位的组合规则,将5位原始数据与校验位进行组合,得到编码数据eq12eq13eq14eq15eq23eq24eq25eq34eq35eq45b1b2b3b4b5(如000000000011111)。It can be seen from Table 1 that after the XOR operation, the check bits eq 12 , eq 13 , eq 14 , eq 15 , eq 23 , eq 24 , eq 25 , eq 34 , eq corresponding to each group of 2-bit data can be obtained 35 and eq 45 , wherein the relationship between the 5-bit original data and the obtained check digit is shown in Figure 2; The original data is combined with the check digit to obtain the encoded data eq 12 eq 13 eq 14 eq 15 eq 23 eq 24 eq 25 eq 34 eq 35 eq 45 b 1 b 2 b 3 b 4 b 5 (eg 000000000011111).

示例性的,在实际应用中,在M小于5时,还可以针对5位原始数据的部分数据位(如4位数据位b1、b2、b3、b4),进行网状逻辑编码,从而可以减少网状逻辑编码的设计复杂度。其中,在编码过程中,不仅可以两两数据位之间异或运算,还可以3位、4位或5位之间进行异或运算操作,如b1、b2、b3间进行异或运算得到校验位

Figure BDA0001192139510000062
b1、b2、b3、b4间进行异或运算得到校验位
Figure BDA0001192139510000063
Figure BDA0001192139510000064
b1、b2、b3、b4、b5间进行异或运算得到校验位
Figure BDA0001192139510000065
Figure BDA0001192139510000071
从而得到了更多的校验位数据。Exemplarily, in practical applications, when M is less than 5, mesh logic coding may also be performed for some data bits of the 5-bit original data (eg, 4-bit data bits b 1 , b 2 , b 3 , b 4 ). , so that the design complexity of the mesh logic coding can be reduced. Among them, in the encoding process, not only the XOR operation can be performed between two data bits, but also the XOR operation can be performed between 3 bits, 4 bits or 5 bits, such as the XOR operation between b 1 , b 2 , and b 3 Operation to get the check digit
Figure BDA0001192139510000062
Perform an exclusive OR operation among b 1 , b 2 , b 3 , and b 4 to obtain the check digit
Figure BDA0001192139510000063
Figure BDA0001192139510000064
Perform an exclusive OR operation among b 1 , b 2 , b 3 , b 4 , and b 5 to obtain the check digit
Figure BDA0001192139510000065
Figure BDA0001192139510000071
Thus, more check digit data is obtained.

S102,将所述编码数据发送给所述器件的接收模块;S102, sending the encoded data to a receiving module of the device;

对于将编码数据发送给接收模块而言,一种可能的情况是,进行真实的数据传输,另一种可能的情况是,模拟数据的传输环境,并真实地进行数据传输。For sending the encoded data to the receiving module, one possible situation is to perform real data transmission, and another possible situation is to simulate the data transmission environment and perform real data transmission.

在航天系统的数据传输中,一般选择FIFO、DDR、DRAM或其他存储设备来存储编码数据,进而将存储的编码数据发送给器件的接收模块。本实施例中,模拟数据的传输环境,并真实地进行数据传输,可以选择FIFO作为存储设备,其一端接发送模块的编码数据输出,一端接接收模块的数据输入。In the data transmission of the aerospace system, FIFO, DDR, DRAM or other storage devices are generally selected to store the encoded data, and then the stored encoded data is sent to the receiving module of the device. In this embodiment, to simulate the data transmission environment and actually perform data transmission, a FIFO can be selected as a storage device, one end of which is connected to the coded data output of the sending module, and the other end is connected to the data input of the receiving module.

对于所述器件的接收模块,执行以下操作:For the receiving module of the device, do the following:

S103,根据所述组合规则对接收到的编码数据进行拆分,得到所述N位数据的每一位数据与所述每组至少两位数据对应的校验位数据;S103, splitting the received encoded data according to the combination rule to obtain check digit data corresponding to each bit of the N-bit data and the at least two bits of each group of data;

具体的,在实际应用中,在数据传输时两端的位宽可以假设是一样的(即位宽=数据位宽度+校验位宽度),接收模块根据和发送模块提前约好的位宽去解析就可以,例如针对5位原始数据位11111和10位校验位0000000000,按照前述的原始数据位在低位、校验位在高位的组合规则,对于组合得到编码数据000000000011111,可以运用位宽为15位的数据总线进行传输,接收模块只需把接收到的编码数据的低5位11111作为数据位、高10位0000000000作为校验位就行。其中,在编码数据的位数较多时,可以在发送模块和接收模块传输数据前约定好每次传输的数据位数,发送模块将编码数据按固定帧长度分批发送,接收模块在接收完毕时进行合并操作即可。例如编码数据的位数为50位,可以设定固定帧长度为10位,发送5次,接收模块在接到5次时就进行合并操作,再从合并后完整的编码数据获得数据位和对应的校验位数据。Specifically, in practical applications, the bit widths at both ends can be assumed to be the same during data transmission (ie, bit width = data bit width + parity bit width). Yes, for example, for the 5-bit original data bit 11111 and the 10-bit check bit 0000000000, according to the aforementioned combination rule that the original data bit is in the low bit and the check bit is in the high bit, for the combined encoded data 000000000011111, the bit width can be 15 bits. The receiving module only needs to use the low 5 bits 11111 of the received encoded data as the data bits and the high 10 bits 0000000000 as the check bits. Among them, when the number of bits of the encoded data is large, the number of data bits for each transmission can be agreed before the sending module and the receiving module transmit data. Just do the merge operation. For example, the number of coded data is 50 bits, the fixed frame length can be set to 10 bits, and it is sent 5 times. The receiving module performs the merging operation when it receives 5 times, and then obtains the data bits and the corresponding data from the combined complete coded data. check digit data.

S104,根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据;S104, according to the N-bit data and the corresponding check digit data of each group of at least two bits of data, use logical operation to determine the data that has an error in the encoded data;

具体的,可以分别针对所述N位数据中的每组至少两位数据和与其对应的校验位数据,进行逻辑运算,得到运算结果;根据运算结果为指定值的逻辑运算个数K,以及运算结果为指定值的K个逻辑运算所包含的公共数据位的个数,确定所述编码数据中发生错误的数据,其中,所述公共数据位为所述K个逻辑运算中至少两个逻辑运算所包含的相同数据位,K小于等于所有运算结果对应的逻辑运算个数。其中,逻辑运算也可以称之为检错校验式。在逻辑运算为异或运算时,指定值可以为1,表示此时由于数据错误,导致异或运算发生错误。Specifically, a logical operation can be performed on each group of at least two bits of data in the N-bit data and the corresponding check digit data to obtain an operation result; the number K of logical operations with a specified value according to the operation result, and The operation result is the number of common data bits included in the K logical operations of the specified value, and the data in which the error occurs in the encoded data is determined, wherein the common data bits are at least two logical operations in the K logical operations. For the same data bits included in the operation, K is less than or equal to the number of logical operations corresponding to all operation results. Among them, the logic operation can also be called an error detection check formula. When the logical operation is an XOR operation, the specified value can be 1, which means that an error occurs in the XOR operation due to data errors.

示例性的,可以根据本发明实施例的应用场景中实际发生错误的数据位数,来决定所需异或运算的个数。Exemplarily, the number of required XOR operations may be determined according to the number of data bits in which errors actually occur in the application scenario of the embodiment of the present invention.

仍参见图2所示实施例,结合表1的异或运算,针对5位原始数据的每组2位数据b1b2、b1b3、b1b4、b1b5、b2b3、b2b4、b2b5、b3b4、b3b5、b4b5与其对应的校验位eq12、eq13、eq14、eq15、eq23、eq24、eq25、eq34、eq35、eq45,进行异或运算,会得到如下运算结果:Still referring to the embodiment shown in FIG. 2 , in conjunction with the exclusive OR operation in Table 1, for each group of 2-bit data b 1 b 2 , b 1 b 3 , b 1 b 4 , b 1 b 5 , b 2 of the 5-bit original data b 3 , b 2 b 4 , b 2 b 5 , b 3 b 4 , b 3 b 5 , b 4 b 5 and their corresponding check digits eq 12 , eq 13 , eq 14 , eq 15 , eq 23 , eq 24 , eq 25 , eq 34 , eq 35 , eq 45 , XOR operation, the following results will be obtained:

Figure BDA0001192139510000081
Figure BDA0001192139510000081

Figure BDA0001192139510000082
Figure BDA0001192139510000082

Figure BDA0001192139510000083
Figure BDA0001192139510000083

Figure BDA0001192139510000084
Figure BDA0001192139510000084

Figure BDA0001192139510000085
Figure BDA0001192139510000085

Figure BDA0001192139510000086
Figure BDA0001192139510000086

Figure BDA0001192139510000087
Figure BDA0001192139510000087

Figure BDA0001192139510000088
Figure BDA0001192139510000088

Figure BDA0001192139510000089
Figure BDA0001192139510000089

Figure BDA00011921395100000810
Figure BDA00011921395100000810

针对图2所示实施例的错误检测依据便是没有错误发生时10个检错校验式的运算结果全部为0,也就是说,只有发生数据错误时才会导致运算结果为1。在航天系统中,器件在发生数据错误时,发生的99.9999%的错误为1位数据错误或2位数据错误,这种情况可以只考虑1位或2位数据错误来进行网状逻辑编码,决定后续所需的检错校验式个数。The error detection basis for the embodiment shown in FIG. 2 is that the operation results of the 10 error detection check formulas are all 0 when no error occurs, that is, the operation result is 1 only when a data error occurs. In the aerospace system, when a data error occurs, 99.9999% of the errors that occur are 1-bit data errors or 2-bit data errors. In this case, only 1-bit or 2-bit data errors can be considered for mesh logic coding, and the decision The number of subsequent error detection check formulas required.

假设针对5位原始数据的每组2位数据b1b2、b1b3、b1b4、b1b5、b2b3、b2b4、b2b5、b3b4、b3b5、b4b5与其对应的校验位eq12、eq13、eq14、eq15、eq23、eq24、eq25、eq34、eq35、eq45,进行异或运算,得到运算结果如下:Assume for each set of 2-bit data b 1 b 2 , b 1 b 3 , b 1 b 4 , b 1 b 5 , b 2 b 3 , b 2 b 4 , b 2 b 5 , b 3 b for each set of 5-bit raw data 4 , b 3 b 5 , b 4 b 5 and their corresponding check bits eq 12 , eq 13 , eq 14 , eq 15 , eq 23 , eq 24 , eq 25 , eq 34 , eq 35 , eq 45 , XOR The operation results are as follows:

Figure BDA0001192139510000091
Figure BDA0001192139510000091

Figure BDA0001192139510000092
Figure BDA0001192139510000092

Figure BDA0001192139510000093
Figure BDA0001192139510000093

根据上述错误检查依据,运算结果为1的6个异或运算代表6个出现错误的检错校验式,该6个检错校验式中包含公共数据位b13个、b23个、b32个、b42个、b52个,由于b1、b2出现的次数最多,因而确定发生错误的数据位为b1、b2According to the above error checking basis, the 6 XOR operations whose operation result is 1 represent 6 error detection check formulas, and the 6 error detection check formulas include 3 common data bits b 1 , b 2 3 , 2 b 3 , 2 b 4 , and 2 b 5 . Since b 1 and b 2 appear the most times, the data bits that have errors are determined to be b 1 and b 2 .

上述实施例中未考虑3位或3位以上数据发生错误的情况,在需要考虑时可以增加检错校验式个数,来满足具体应用场景的检错和纠错需求。在实际应用中,在需要考虑3比特以及更多比特翻转的情况下,可以在进行网状逻辑编码时,在2位原始数据间进行异或运算的基础上,进行3位原始数据、4位原始数据或5位原始数据间的异或运算,得到更多的校验位,如对于上述5位原始数据,在得到每组2个数据的10个校验位后,继续在3位数据间进行异或运算得到eq123、eq124、eq125、eq134、eq135、eq145、eq234、eq235、eq245、eq345,在5位数据间进行异或运算得到eq12345,进而在确定发生翻转的错误数据过程中,可以得到的检错校验式个数为10+10+1=21,利用这些检错校验式中运算结果为1的个数K,以及K个检错校验式包含的公共数据位的个数,来判定具体哪些原始数据位或校验位发生错误,其中,在运算结果为指定值1时,表示该个检错校验式发生错误,且此时K不大于21。The above embodiment does not consider the situation that 3 or more bits of data have errors, and the number of error detection check formulas can be increased when necessary to meet the error detection and error correction requirements of specific application scenarios. In practical applications, when 3-bit and more bit flips need to be considered, when performing mesh logic coding, on the basis of XOR operation between 2-bit original data, 3-bit original data, 4-bit original data can be performed. The XOR operation between the original data or the 5-bit original data can obtain more check digits. For example, for the above 5-bit original data, after obtaining 10 check digits of each group of 2 data, continue between the 3-bit data. Perform XOR operation to obtain eq 123 , eq 124 , eq 125 , eq 134 , eq 135 , eq 145 , eq 234 , eq 235 , eq 245 , eq 345 , and perform XOR operation between 5-bit data to obtain eq 12345 , and then in In the process of determining the erroneous data that has flipped, the number of error detection check formulas that can be obtained is 10+10+1=21, and the number K of the operation results of these error detection check formulas is 1, and K error detection formulas are used. The number of common data bits included in the check formula is used to determine which original data bits or check bits are in error. When the operation result is the specified value of 1, it means that the error detection check formula has an error, and this When K is not greater than 21.

S105,对所述N位数据中的至少一位数据进行纠错。S105: Perform error correction on at least one bit of the N-bit data.

具体的,当发生错误的数据包含所传输的N位数据中的至少一位数据时,对所述N位数据中的至少一位数据进行纠错。在实际应用中,当发生错误的数据为校验位数据时,由于校验位数据发生错误不会对所传输的原始N位数据产生影响,所以无需对校验位数据错误进行纠错。Specifically, when the data in which the error occurs includes at least one bit of the transmitted N-bit data, error correction is performed on at least one bit of the N-bit data. In practical applications, when the erroneous data is the check digit data, since the error of the check digit data will not affect the transmitted original N-bit data, there is no need to correct the error of the check digit data.

具体的,当确定的错误数据包含所述N位数据中的一位错误数据时,对所确定的一位数据取反。Specifically, when the determined erroneous data includes one bit of erroneous data in the N-bit data, the determined one-bit data is inverted.

具体的,当确定出的错误数据包含所述N位数据中的至少两位错误数据时,分别对所确定的所述N位数据中的至少两位数据取反。Specifically, when the determined error data includes at least two bits of error data in the N-bit data, at least two bits of the determined N-bit data are respectively inverted.

示例性的,对于如上所述的5位原始数据的每组2位数据b1b2、b1b3、b1b4、b1b5、b2b3、b2b4、b2b5、b3b4、b3b5、b4b5与其对应的校验位eq12、eq13、eq14、eq15、eq23、eq24、eq25、eq34、eq35、eq45,进行异或运算,得到运算结果,其中,

Figure BDA0001192139510000101
Figure BDA0001192139510000102
Figure BDA0001192139510000103
Figure BDA0001192139510000104
在a1、a2、a3、a4、a5、a6、a7、a8、a9、a10中,当其中1个运算结果为1时,便可定位到1位校验位数据错误,如仅a1为1,说明eq12发生错误,此时不需要纠错;当其中4个运算结果为1时,便可定位到1位原始数据错误,如a1、a2、a3、a4为1,其他为0,说明该4个错误检错校验式包含的同一数据位b1发生错误,对b1取反纠错;当其中2个运算结果为1时,便可定位到2位校验位数据错误,如a1、a2为1,其他为0,说明原始数据位没有发生错误,故而检验位eq12、eq13发生错误,此时不需要纠错;当其中3个运算结果为1时,便可定位到1位原始数据和与该原始数据相关的1位检验位数据发生错误,如a1、a2、a3为1,其他为0,根据该3个错误检错校验式包含的同一数据位b1,定位出b1发生错误,又因为与b1相关的检错校验式的运算结果a4为0,定位出校验位eq15发生错误,此时只需要对b1取反纠错;当其中5个运算结果为1时,便可定位到1位原始数据和与该位原始数据不相关的1位检验位数据发生错误,如a1、a2、a3、a4、a5为1,其他为0,根据其中4个错误检错校验式包含的同一数据位b1,定位出b1发生错误,又因为a5发生错误而b2或b3不可能发生错误,说明eq23发生错误,此时只需要对b1取反纠错;当其中6个运算结果为1时,便可定位到2位原始数据发生错误,如a2、a3、a4、a5、a6、a7为1,其他为0,其中3个检错校验式包含公共数据位b13个、b23个、b32个、b42个、b52个,说明2位数据b1、b2发生错误,分别对b1、b2取反纠错即可。另外,在实际应用中,在根据实际需要,要求对3位及更多位数据进行检错和纠错时,可以如前面的步骤中所述,增加更多的检错校验式,具体以实现检测出多位数据错误并进行纠错为准。Exemplarily, for each group of 2-bit data b 1 b 2 , b 1 b 3 , b 1 b 4 , b 1 b 5 , b 2 b 3 , b 2 b 4 , b for each set of 5-bit raw data as described above 2 b 5 , b 3 b 4 , b 3 b 5 , b 4 b 5 and their corresponding check digits eq 12 , eq 13 , eq 14 , eq 15 , eq 23 , eq 24 , eq 25 , eq 34 , eq 35 , eq 45 , perform XOR operation to obtain the operation result, among which,
Figure BDA0001192139510000101
Figure BDA0001192139510000102
Figure BDA0001192139510000103
Figure BDA0001192139510000104
In a 1 , a 2 , a 3 , a 4 , a 5 , a 6 , a 7 , a 8 , a 9 , a 10 , when one of the operation results is 1, the 1-bit check can be located Bit data error, if only a 1 is 1, it means that an error occurs in eq 12 , and no error correction is required at this time; when 4 of the operation results are 1, 1-bit original data error can be located, such as a 1 , a 2 , a 3 , a 4 are 1, and the others are 0, indicating that the same data bit b 1 contained in the four error detection check formulas has an error, and b 1 is inverted for error correction; when two of the operation results are 1 , the 2-bit check bit data error can be located. For example, a 1 and a 2 are 1, and the others are 0, indicating that the original data bits are not wrong, so the check bits eq 12 and eq 13 have errors, and no correction is required at this time. Wrong; when 3 of the operation results are 1, it is possible to locate the 1-bit original data and the 1-bit check bit data related to the original data. Errors occur, such as a 1 , a 2 , a 3 are 1, others are 0 , according to the same data bit b 1 contained in the three error detection and check formulas, locate an error in b 1 , and because the operation result a 4 of the error detection and check formula related to b 1 is 0, locate the check When an error occurs in bit eq 15 , it is only necessary to invert b 1 for error correction; when 5 of the operation results are 1, 1-bit original data and 1-bit check bit data unrelated to the original data can be located. An error occurs, such as a 1 , a 2 , a 3 , a 4 , and a 5 are 1, and the others are 0. According to the same data bit b 1 contained in the four error detection check formulas, locate the error in b 1 , And because a 5 has an error, b 2 or b 3 cannot have an error, indicating that an error has occurred in eq 23. At this time, only b 1 needs to be inverted for error correction; when 6 of the operation results are 1, 2 can be located. Bit original data error, such as a 2 , a 3 , a 4 , a 5 , a 6 , a 7 are 1, others are 0, and the 3 error detection check formulas include common data bits b 1 3, b 2 3, 2 b 3 , 2 b 4 , and 2 b 5 , indicating that an error occurs in the 2 -bit data b 1 and b 2 . In addition, in practical applications, when it is required to perform error detection and error correction on 3-bit or more bits of data according to actual needs, more error detection and check formulas can be added as described in the previous steps. The realization of multi-bit data error detection and error correction shall prevail.

图1所示方法可以应用于FPGA器件,也可以应用于包含FIFO、DDR、DRAM或ram-based的器件。The method shown in Figure 1 can be applied to FPGA devices, and can also be applied to devices containing FIFO, DDR, DRAM or ram-based.

可见,利用网状逻辑编码对待传输的N位数据进行编码得到编码数据,接收模块可以根据所传输的编码数据中的校验位数据和N位数据,利用逻辑运算对N位数据进行检错和纠错。不仅可以针对单粒子翻转,对于多粒子翻转也可以实现检错并纠错的目的,从而对器件内通信数据进行更好的加固,提高了器件的稳定性和可靠性。进一步地,本发明实施例还可以应用于包含FIFO、DDR、DRAM或ram-based的器件,进行器件内部的数据错误检测和错误纠正。It can be seen that the N-bit data to be transmitted is encoded by using mesh logic coding to obtain encoded data, and the receiving module can use logical operations to perform error detection and summation on the N-bit data according to the parity bit data and N-bit data in the transmitted encoded data. error correction. Not only for single-particle flipping, but also for multi-particle flipping, the purpose of error detection and correction can be achieved, so as to better reinforce the communication data in the device and improve the stability and reliability of the device. Further, the embodiments of the present invention can also be applied to devices including FIFO, DDR, DRAM, or ram-based to perform data error detection and error correction inside the device.

参见图3,图3为本发明实施例提的数据纠错装置的一种结构示意图,与图1所示的流程相对应,该纠错装置可以包括:网状逻辑编码单元301、发送单元302、拆分单元303、运算单元304、纠错单元305。Referring to FIG. 3 , FIG. 3 is a schematic structural diagram of a data error correction apparatus according to an embodiment of the present invention. Corresponding to the process shown in FIG. 1 , the error correction apparatus may include: a mesh logic coding unit 301 and a sending unit 302 , a splitting unit 303 , an arithmetic unit 304 , and an error correction unit 305 .

网状逻辑编码单元301,用于所述器件的发送模块,针对待传输的N位数据进行网状逻辑编码,获得编码数据;其中,所述进行网状逻辑编码的过程包括:针对待传输的N位数据中的M位数据,对所述M位数据中的每组至少两位数据,分别进行逻辑运算,得到针对每组至少两位数据对应的校验位数据;按照预设组合规则,将所述N位数据与所述校验位数据进行组合,得到编码数据,其中,M小于等于N,N不小于4,所述逻辑运算为异或运算、同或运算、与运算、或运算、非运算、与非运算、或非运算、或者与或非运算;The mesh logic encoding unit 301 is used for the sending module of the device to perform mesh logic encoding on the N-bit data to be transmitted to obtain encoded data; wherein, the process of performing mesh logic encoding includes: for the to-be-transmitted N-bit data For M-bit data in the N-bit data, logical operations are respectively performed on each group of at least two bits of data in the M-bit data to obtain check digit data corresponding to each group of at least two bits of data; according to the preset combination rule, The N-bit data is combined with the check bit data to obtain encoded data, wherein M is less than or equal to N, and N is not less than 4, and the logical operation is an exclusive-OR operation, an exclusive-OR operation, an AND operation, or an OR operation , NOT, AND NOT, OR NOT, OR AND OR NOT;

发送单元302,用于将所述编码数据发送给所述器件的接收模块;a sending unit 302, configured to send the encoded data to a receiving module of the device;

拆分单元303,用于所述器件的接收模块,根据所述组合规则对接收到的编码数据进行拆分,得到所述N位数据的每一位数据与所述每组至少两位数据对应的校验位数据;The splitting unit 303, used for the receiving module of the device, splits the received encoded data according to the combination rule, and obtains that each bit of the N-bit data corresponds to the at least two bits of data in each group the check digit data;

运算单元304,用于根据所述N位数据和所述每组至少两位数据对应的校验位数据,利用逻辑运算,确定所述编码数据中发生错误的数据;an arithmetic unit 304, configured to determine the data with errors in the encoded data according to the N-bit data and the parity bit data corresponding to the at least two bits of data in each group, using logical operations;

纠错单元305,用于当发生错误的数据包含所传输的N位数据中的至少一位数据时,对所述N位数据中的至少一位数据进行纠错。The error correction unit 305 is configured to perform error correction on at least one bit of the N-bit data when the erroneous data includes at least one bit of the transmitted N-bit data.

具体的,所述运算单元具体可以包括:逻辑运算子单元、错误位查找子单元(图中未示出);Specifically, the operation unit may specifically include: a logic operation subunit, an error bit search subunit (not shown in the figure);

逻辑运算子单元,用于分别针对所述N位数据中的每组至少两位数据和与其对应的校验位数据,进行逻辑运算,得到运算结果;a logical operation subunit for performing logical operations on each group of at least two bits of data in the N-bit data and its corresponding parity bit data to obtain an operation result;

错误位查找子单元,用于根据运算结果为指定值的逻辑运算个数K,以及运算结果为指定值的K个逻辑运算所包含的公共数据位的个数,确定所述编码数据中发生错误的数据,其中,所述公共数据位为所述K个逻辑运算中至少两个逻辑运算所包含的相同数据位,K小于等于所有运算结果对应的逻辑运算个数。The error bit search subunit is used to determine that an error occurs in the encoded data according to the number K of logical operations whose operation result is a specified value, and the number of common data bits included in the K logical operations whose operation result is a specified value , wherein the common data bits are the same data bits included in at least two of the K logical operations, and K is less than or equal to the number of logical operations corresponding to all the operation results.

具体的,所述纠错单元具体可以包括:Specifically, the error correction unit may specifically include:

第一取反子单元,用于当确定的错误数据包含所述N位数据中的一位数据时,对所确定的一位数据取反。The first inversion subunit is configured to invert the determined one-bit data when the determined erroneous data includes one-bit data in the N-bit data.

具体的,所述纠错单元具体还可以包括:Specifically, the error correction unit may further include:

第二取反子单元,用于当确定出的错误数据包含所述N位数据中的至少两位数据时,分别对所确定的所述N位数据中的至少两位数据取反。The second inversion subunit is configured to respectively invert at least two bits of the determined N-bit data when the determined erroneous data includes at least two bits of the N-bit data.

具体的,所述装置可以为:现场可编程逻辑门阵列器件或包含FIFO、DDR、DRAM或ram-based的器件。Specifically, the device may be: a field programmable logic gate array device or a device including FIFO, DDR, DRAM or ram-based.

可见,利用网状逻辑编码对待传输的N位数据进行编码得到编码数据,接收模块可以根据所传输的编码数据中的校验位数据和N位数据,利用逻辑运算对N位数据进行检错和纠错。不仅可以针对单粒子翻转,对于多粒子翻转也可以实现检错并纠错的目的,从而对器件内通信数据进行更好的加固,提高了器件的稳定性和可靠性。进一步地,本发明实施例还可以应用于包含FIFO、DDR、DRAM或ram-based的器件,进行器件内部的数据错误检测和错误纠正。It can be seen that the N-bit data to be transmitted is encoded by using mesh logic coding to obtain encoded data, and the receiving module can use logical operations to perform error detection and summation on the N-bit data according to the parity bit data and N-bit data in the transmitted encoded data. error correction. Not only for single-particle flipping, but also for multi-particle flipping, the purpose of error detection and correction can be achieved, so as to better reinforce the communication data in the device and improve the stability and reliability of the device. Further, the embodiments of the present invention can also be applied to devices including FIFO, DDR, DRAM, or ram-based to perform data error detection and error correction inside the device.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (8)

1. A method for correcting data errors in a device comprising a transmitting module and a receiving module, the method comprising:
for a transmit module of the device, performing the following:
performing mesh logic encoding on N bit data to be transmitted to obtain encoded data;
wherein the step of performing mesh logic encoding comprises: respectively carrying out logic operation on at least two bits of data in each group in the M bit data aiming at the M bit data in the N bit data to be transmitted to obtain check bit data corresponding to the at least two bits of data in each group; combining the N bit data and the check bit data according to a preset combination rule to obtain coded data, wherein M is less than or equal to N, N is not less than 4, and the logical operation is exclusive-or operation, exclusive-nor operation, AND operation, OR operation, NOT operation, or AND NOT operation; the preset combination rule is as follows: the original data bit is at the low position, and the check bit is at the high position;
sending the encoded data to a receiving module of the device;
for a receive module of the device, performing the following:
splitting the received coded data according to the combination rule to obtain check bit data corresponding to each bit of data of the N bits of data and each group of at least two bits of data;
determining data with errors in the coded data by using logical operation according to the N-bit data and check bit data corresponding to each group of at least two-bit data;
when the data with errors contains at least one bit of data in the transmitted N bits of data, correcting the error of the at least one bit of data in the N bits of data;
determining data with errors in the encoded data by using logical operation according to the N-bit data and the check bit data corresponding to each group of at least two bits of data, including:
respectively carrying out logic operation on each group of at least two bit data in the N bit data and the check bit data corresponding to the at least two bit data to obtain an operation result; and determining the data with errors in the coded data according to the number K of logical operations with the operation result being the specified value and the number of common data bits contained in the K logical operations with the operation result being the specified value, wherein the common data bits are the same data bits contained in at least two of the K logical operations, and K is less than or equal to the number of the logical operations corresponding to all the operation results.
2. The method of claim 1, wherein said error correcting at least one of said N bits of data comprises:
when the determined error data includes one bit of error data of the N-bit data, inverting the determined one bit of data.
3. The method of claim 1, wherein said error correcting at least one of said N bits of data comprises:
and when the determined error data comprises at least two bit error data in the N bit data, respectively negating at least two bit data in the determined N bit data.
4. The method of claim 1, wherein the device comprising the sending module and the receiving module is: a field programmable gate array device or a device containing a FIFO, DDR, DRAM or ram-based.
5. A data error correction apparatus, applied to a device including a transmitting module and a receiving module, the apparatus comprising:
the mesh logic coding unit is used for a sending module of the device and carrying out mesh logic coding on the N-bit data to be transmitted to obtain coded data; wherein the process of performing mesh logic encoding comprises: respectively carrying out logic operation on at least two bits of data in each group in the M bit data aiming at the M bit data in the N bit data to be transmitted to obtain check bit data corresponding to the at least two bits of data in each group; combining the N bit data and the check bit data according to a preset combination rule to obtain coded data, wherein M is less than or equal to N, N is not less than 4, and the logical operation is exclusive-or operation, exclusive-nor operation, AND operation, OR operation, NOT operation, or AND NOT operation; the preset combination rule is as follows: the original data bit is at the low position, and the check bit is at the high position;
a transmitting unit for transmitting the encoded data to a receiving module of the device;
the splitting unit is used for a receiving module of the device to split the received coded data according to the combination rule to obtain check bit data corresponding to each bit of data of the N bits of data and each group of at least two bits of data;
the arithmetic unit is used for determining data with errors in the coded data by using logical operation according to the N-bit data and the check bit data corresponding to each group of at least two-bit data;
an error correction unit for correcting error of at least one bit data of the N bit data when the data in which the error occurs contains at least one bit data of the transmitted N bit data;
the operation unit specifically includes:
the logical operation subunit is used for respectively carrying out logical operation on each group of at least two bit data in the N bit data and the check bit data corresponding to the at least two bit data to obtain an operation result;
and the error bit searching subunit is used for determining data with errors in the encoded data according to the number K of logical operations of which the operation result is the specified value and the number of common data bits included in the K logical operations of which the operation result is the specified value, wherein the common data bits are the same data bits included in at least two of the K logical operations, and K is less than or equal to the number of the logical operations corresponding to all the operation results.
6. The apparatus according to claim 5, wherein the error correction unit specifically comprises:
a first negation subunit, configured to negate the determined one bit of data when the determined error data includes one bit of data of the N-bit of data.
7. The apparatus according to claim 6, wherein the error correction unit further comprises:
and the second negation subunit is used for respectively negating the determined at least two bits of data in the N bits of data when the determined error data comprises at least two bits of data in the N bits of data.
8. The apparatus of claim 5, wherein the apparatus is: a field programmable gate array device or a device containing a FIFO, DDR, DRAM or ram-based.
CN201611217683.1A 2016-12-26 2016-12-26 Data error correction method and device Active CN108242973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611217683.1A CN108242973B (en) 2016-12-26 2016-12-26 Data error correction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611217683.1A CN108242973B (en) 2016-12-26 2016-12-26 Data error correction method and device

Publications (2)

Publication Number Publication Date
CN108242973A CN108242973A (en) 2018-07-03
CN108242973B true CN108242973B (en) 2020-10-27

Family

ID=62705050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611217683.1A Active CN108242973B (en) 2016-12-26 2016-12-26 Data error correction method and device

Country Status (1)

Country Link
CN (1) CN108242973B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181710B (en) * 2020-09-11 2022-03-29 厦门大学 Solid-state disk data storage method and device based on bit flipping

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067972A (en) * 2007-04-23 2007-11-07 北京芯技佳易微电子科技有限公司 Memory error-detecting and error-correcting coding circuit and method for reading and writing data utilizing the same
CN101281481A (en) * 2008-05-23 2008-10-08 北京时代民芯科技有限公司 Method for error correcting and detecting for memory anti-single particle overturn
CN102915769A (en) * 2012-09-29 2013-02-06 北京时代民芯科技有限公司 Implementation and optimization method for processor EDAC (error detection and correction) circuit
CN104917592A (en) * 2015-06-11 2015-09-16 天津大学 Error detection and error correction circuit for data with 10-bit wide

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080256415A1 (en) * 2005-09-27 2008-10-16 Nxp B.V. Error Detection/Correction Circuit as Well as Corresponding Method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067972A (en) * 2007-04-23 2007-11-07 北京芯技佳易微电子科技有限公司 Memory error-detecting and error-correcting coding circuit and method for reading and writing data utilizing the same
CN101281481A (en) * 2008-05-23 2008-10-08 北京时代民芯科技有限公司 Method for error correcting and detecting for memory anti-single particle overturn
CN102915769A (en) * 2012-09-29 2013-02-06 北京时代民芯科技有限公司 Implementation and optimization method for processor EDAC (error detection and correction) circuit
CN104917592A (en) * 2015-06-11 2015-09-16 天津大学 Error detection and error correction circuit for data with 10-bit wide

Also Published As

Publication number Publication date
CN108242973A (en) 2018-07-03

Similar Documents

Publication Publication Date Title
US10476681B2 (en) Semiconductor device generating security key, method of generating security key, and method of enrolling security key
US8612834B2 (en) Apparatus, system, and method for decoding linear block codes in a memory controller
TW201319800A (en) Checksum using sums of permutation sub-matrices
US10860419B2 (en) Minimal aliasing bit-error correction code
US9471416B2 (en) Partitioned error code computation
CN108242973B (en) Data error correction method and device
WO2020052672A1 (en) Decoding method and apparatus for turbo product code, decoder, and computer storage medium
CN109753369B (en) Data coding and checking method for sequence array in register and memory
CN110679090B (en) Reduced delay error correction decoding
US3218612A (en) Data transfer system
CN106531224A (en) SRAM type FPGA-based RAM data reliability reinforcement apparatus and method
CN108964670B (en) Basic coding and decoding unit and coder-decoder
CN107294541B (en) A Self-Fault Tolerant LDPC Decoder with Low Area Overhead
US11361838B2 (en) Cyclic redundancy check circuit, corresponding device and method
Sokolovskyi et al. DEVELOPMENT OF THE METHOD OF DETECTING AND CORRECTING DATA TRANSMISSION ERRORS IN IOT SYSTEMS FOR MONITORING THE STATE OF OBJECTS.
KR102516190B1 (en) Semiconductor device generating security key, method of generating security key, and method of enrolling security key
CN108847849B (en) Basic coding and decoding unit and coder-decoder
Amrutha Shree et al. Design of Error Correction Engine Based on Flexible Unequal Error Control Code (FUEC) for Flash Memory Faults in Space Applications
RU2708956C2 (en) Processor with high reliability of operation
CN110489267A (en) Memory and the method for reinforcing data to be stored
Laih et al. On the analysis and design of group theoretical t-syEC/AUED codes
RU186547U1 (en) PROCESSOR OF INCREASED OPERATING RELIABILITY
CN108566210A (en) The LDPC coded systems and method, LDPC encoder of compatible IEEE802.11n standards
Alnajjar et al. Hardware-Based Error Correction Systems for Hamming Codes: a Review of the Literature
Faraj ’Design Error Detection and Correction System based on Reed_Muller Matrix for Memory Protection’

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant