CN101848055A - Method and device for correcting data - Google Patents
Method and device for correcting data Download PDFInfo
- Publication number
- CN101848055A CN101848055A CN200910106342A CN200910106342A CN101848055A CN 101848055 A CN101848055 A CN 101848055A CN 200910106342 A CN200910106342 A CN 200910106342A CN 200910106342 A CN200910106342 A CN 200910106342A CN 101848055 A CN101848055 A CN 101848055A
- Authority
- CN
- China
- Prior art keywords
- prime
- check code
- new
- data cell
- data element
- 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.)
- Pending
Links
Images
Abstract
The invention discloses a method for correcting data, which comprises the following steps of: verifying a preceding stage data unit by utilizing a pre-stage check code of the preceding stage data unit to acquire pre-stage error code information; processing the part, except for the pre-stage check code, of the preceding stage data unit to generate a new data unit; performing verifying operation on the new data unit to acquire a regenerated check code; acquiring a new regenerated check code according to the exclusive OR operation of the pre-stage error code information and the regenerated check code; and substituting the new regenerated check code for the pre-stage check code in the new data unit to generate the corrected data unit. The invention also discloses a device for correcting the data. Due to the technical scheme of the embodiment of the invention, the pre-stage error code information is directly transferred and serial port expenditure or other gateway channel mode does not need to be adopted, the error code information can be transferred correctly and the waste of bandwidth resources is avoided.
Description
Technical field
The present invention relates to communication technical field, relate in particular to a kind of data correcting method and device.
Background technology
Aggravation along with development of Communication Technique and market competition; people are more and more higher to the requirement of signal quality; but the disturbing factor in the practical communication environment is a lot; can exert an influence to signal quality unavoidably; in order to monitor the signal quality in the transmission course, can in data, increase some error detection codings usually.For example bit intersects odd even (Bit-Interleaved Parity, BIP) check code is one of error detection coding of using always, be widely used in PDH (Pseudo-synchronous Digital Hierarchy) (Plesiochronous Digital Hierarchy, PDH), (Synchronous Digital Hierarchy is SDH) etc. in the field for SDH (Synchronous Digital Hierarchy).
Data are in transmission course, and intermediate NE receives the prime data cell, and the prime data cell has the prime check code, if at intermediate NE this prime data cell is handled, obtains new data element, then needs the check code of regenerating.The regeneration of check code causes original check code to be terminated, thereby the error code information that prime produces will be lost.
Solution to this problem in the prior art is: prime error code information is passed to next stage by serial ports expense or other gateway passage, wasted the part bandwidth like this, the more important thing is that sliding frame can appear in serial ports expense or other gateway passage in the network element self-vibration, thereby can not guarantee the accurate transmission of error code information.
Summary of the invention
The embodiment of the invention provides a kind of data correcting method and device, can realize the direct transmission of prime error code information.
A kind of data correcting method, this method comprises:
Utilize the prime check code of prime data cell that described prime data cell is carried out verification, obtain prime error code information;
The part of described prime data cell except that described prime check code handled, generated new data element;
Described new data element is carried out the verification computing, obtain the check code of regenerating;
According to the XOR of described prime error code information and the described regeneration check code check code of newly being regenerated;
Described new regeneration check code is replaced described prime check code in the described new data element, generate revised data cell.
A kind of data correcting method, this method comprises:
Utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtain the first prime error code information;
The part of the described first prime data cell except that its prime check code handled, generated first new data element; The part of the described second prime data cell except that its prime check code handled, generated second new data element;
Described first new data element is carried out the verification computing, obtain the first regeneration check code;
XOR according to described first prime error code information and the described first regeneration check code obtains the first new regeneration check code;
The described first new regeneration check code is replaced described prime check code in described second new data element, generate revised data cell.
A kind of data correction device, this device comprises:
First acquisition module is used to utilize the prime check code of prime data cell that described prime data cell is carried out verification, obtains prime error code information;
First processing module is used for the part of described prime data cell except that described prime check code handled, and generates new data element;
Second acquisition module is used for described new data element is carried out the verification computing, obtains the check code of regenerating;
First computing module is used for according to the XOR of described prime error code information and the described regeneration check code check code of newly being regenerated;
First replaces module, is used for described new regeneration check code is replaced the described prime check code of described new data element, generates revised data cell.
5, a kind of data correction device, this device comprises:
The 3rd acquisition module is used to utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtains the first prime error code information;
Second processing module is used for the part of the described first prime data cell except that its prime check code handled, and generates first new data element; Also be used for the part of the described second prime data cell except that its prime check code handled, generate second new data element;
The 4th acquisition module is used for described first new data element is carried out the verification computing, obtains the first regeneration check code;
Second computing module is used for obtaining the first new regeneration check code according to the XOR of described first prime error code information and the described first regeneration check code;
Second replaces module, is used for the described first new regeneration check code is replaced the described prime check code of described second new data element, generates revised data cell.
Adopt the technical scheme of the embodiment of the invention, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Description of drawings
Fig. 1 is the data correction flow chart that the embodiment of the invention provides;
Fig. 2 is the data correction schematic diagram that the embodiment of the invention provides;
Fig. 3 is a kind of data correction structure drawing of device that the embodiment of the invention provides;
Fig. 4 is the another kind of data correction structure drawing of device that the embodiment of the invention provides.
Embodiment
In order more clearly to describe the present invention,, the specific embodiment of the present invention is described in further detail below in conjunction with drawings and Examples.
Embodiment one
Present embodiment provides a kind of data correcting method, and this method comprises: utilize the prime check code of prime data cell that described prime data cell is carried out verification, obtain prime error code information; The part of described prime data cell except that described prime check code handled, generated new data element; Described new data element is carried out the verification computing, obtain the check code of regenerating; According to the XOR of described prime error code information and the described regeneration check code check code of newly being regenerated; Described new regeneration check code is replaced described prime check code in the described new data element, generate revised data cell.
In the present embodiment, the prime check code on the prime data cell is used for this prime data cell of verification.
Technical scheme by present embodiment, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Embodiment two
Present embodiment provides a kind of data correcting method, and this method comprises: utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtain the first prime error code information; The part of the described first prime data cell except that its prime check code handled, generated first new data element; The part of the described second prime data cell except that its prime check code handled, generated second new data element; Described first new data element is carried out the verification computing, obtain the first regeneration check code; XOR according to described first prime error code information and the described first regeneration check code obtains the first new regeneration check code; The described first new regeneration check code is replaced described prime check code in described second new data element, generate revised data cell.
In the present embodiment, the prime check code on the second prime data cell is used for the verification first prime data cell.
Technical scheme by present embodiment, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Embodiment three
A kind of method of data correction is provided below, and as shown in Figure 1, this method specifically comprises:
S101 obtains prime error code information;
As shown in Figure 2, insert check code at the source end, the generation method of check code is: the check code of preserving on first data cell generates at random, the check code of preserving on second data unit is by utilizing algorithm all bytes of first data cell to be carried out the result of computing, the check code of preserving on the 3rd data unit is the result by utilizing algorithm that all bytes of second data unit are carried out computing, and the generation method of the check code of preserving on the remainder data unit is similar.Wherein, above-mentioned algorithm is meant all bytes of data unit is carried out XOR by byte:
B(n)=Pld1(n-1)^Pld2(n-1)^......^Pldx(n-1)......
Wherein, n is the natural number greater than 2, " ^ " is xor operator, the 1st byte in Pld1 (n-1) n-1 data unit of expression, the 2nd byte in Pld2 (n-1) n-1 data unit of expression, x the byte in Pldx (n-1) n-1 data unit of expression, B (n) is the check code of preserving on n the data unit, is the result who all bytes of n-1 data unit is carried out computing.
When the intermediate NE Error detection, n-1 data unit carried out same computing:
Brx(n-1)=pld1(n-1)^pld2(n-1)^......^pldx(n-1)......
Wherein, n is the natural number greater than 2, " ^ " is xor operator, the 1st byte in n-1 data unit during pld1 (n-1) expression Error detection, the 2nd byte in n-1 data unit during pld2 (n-1) expression Error detection, x byte in n-1 data unit during pldx (n-1) expression Error detection, the result that Brx (n-1) carries out computing once more to all bytes of n-1 data unit when being Error detection.
B (n) and Brx (n-1) are carried out XOR obtain prime error code information, wherein, B (n) is the check code of preserving on n the data unit, is used for n-1 data unit of verification, the result who when Brx (n-1) is Error detection all bytes of n-1 data unit is carried out computing once more:
Err(n-1)=B(n)^Brx(n-1)
In the present embodiment, obtain this prime error code information.
In the present embodiment, the prime data cell comprises first prime data cell (n-1 data unit) and the second prime data cell (n data unit), the first prime data cell has the first prime check code, the second prime data cell has the second prime check code (B (n)), the second prime check code (B (n)) is used for the verification first prime data cell (n-1 data unit), the first prime data cell is carried out the verification computing obtain check value (Brx (n-1)), obtain the first prime error code information (Err (n-1)) according to the XOR of check value (Brx (n-1)) and the second prime check code (B (n)).
In the present embodiment, the first prime data cell and the second prime data cell are two adjacent data unit, and in another embodiment, the first prime data cell and the second prime data cell are non-conterminous two data unit, principle is identical, does not repeat them here.
In the present embodiment, the second prime check code is used for the verification first prime data cell, and in another embodiment, the first prime check code is used for the verification first prime data cell, and promptly corresponding to the situation of embodiment one, principle is identical, also repeats no more at this.
S102 obtains the regeneration check code;
As shown in Figure 2, at intermediate NE, the part of prime data cell except that its prime check code handled, obtain new data element, first new data element is obtained by first prime data cell, and second new data element obtained by second prime data cell, and the generation method of all the other new data element is similar, then must recomputate check code, need the regeneration check code.The renovation process of check code is: the check code of preserving on first new data element generates at random, the check code of preserving on second new data element is by utilizing algorithm all bytes of first new data element to be carried out the result of computing, the check code of preserving on the 3rd new data element is the result by utilizing algorithm that all bytes of second new data element are carried out computing, and the generation method of the check code of preserving on all the other new data element is similar.Wherein, above-mentioned algorithm is meant all bytes of data unit is carried out XOR by byte, recomputates after overhead/traffic changes and obtain the check code of regenerating:
B′(n-1)=Pld′1(n-1)^Pld′2(n-1)^......^Pld′x(n-1)......
Wherein, n is the natural number greater than 2, " ^ " is xor operator, the 1st byte of Pld ' 1 (n-1) n-1 new data element of expression, the 2nd byte of Pld ' 2 (n-1) n-1 new data element of expression, x byte of Pld ' x (n-1) n-1 new data element of expression, B ' is the result for all bytes of n-1 new data element are carried out computing (n-1).
In the present embodiment, obtain this regeneration check code.
In the present embodiment, new data element comprises first new data element (n-1 new data element) and second new data element (n new data element), first new data element is obtained by the first prime data cell, second new data element is obtained by the second prime data cell, the step of obtaining the regeneration check code is: described first new data element is carried out the verification computing, obtain the first regeneration check code (B ' (n-1)).
In the present embodiment, first new data element is obtained by the first prime data cell, second new data element is obtained by the second prime data cell, in another embodiment, first new data element is obtained by the second prime data cell, second new data element is obtained by the first prime data cell, and principle is identical, does not repeat them here.
S103, computing obtains to carry the new regeneration check code of prime error code information;
B′new(n)=B′(n-1)^Err(n-1)
Wherein, B ' is the result for all bytes of n-1 new data element are carried out computing (n-1), and Err (n-1) is the prime error code information of n-1 prime data cell.
In the present embodiment, B ' new (n) is for carrying the regeneration check code of prime error code information.
In the present embodiment, obtain the first new regeneration check code (B ' new (n)) according to the XOR of the first prime error code information (Err (n-1)) and the first regeneration check code (B ' (n-1)).
For the person of ordinary skill of the art, adopt said method can obtain " the second regeneration check code " and " the second new regeneration check code " with the second new data element correspondence easily, " first " and " second " is for the ease of with the new data element correspondence and the numbering of employing.
S104 utilizes new regeneration check code to replace the prime check code.
In the present embodiment, utilize B ' new (n) to replace the B (n) that waits to revise in the data cell.
In the present embodiment, the first new regeneration check code (B ' new (n)) is replaced the prime check code (B (n)) of second new data element.
In the present embodiment, directly generate and carry the new regeneration check code of prime error code information, utilize this check code to replace the prime check code, in another embodiment, can generate the regeneration check code earlier, utilize this regeneration check code to replace the prime check code, generate then and carry the new regeneration check code of prime error code information, utilize this new regeneration check code that carries prime error code information to replace the regeneration check code, principle is identical, does not repeat them here.
Technical scheme by present embodiment, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Embodiment four
Present embodiment provides a kind of data correction device, and as shown in Figure 3, this device comprises:
First replaces module 305, is used for described new regeneration check code is replaced the described prime check code of described new data element, generates revised data cell.
Information interaction in the said apparatus between each module, contents such as implementation since with the inventive method embodiment based on same design, particular content can repeat no more referring to the narration among the inventive method embodiment herein.
Device by present embodiment, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Embodiment five
Present embodiment provides a kind of data correction device, and as shown in Figure 4, this device comprises:
The 3rd acquisition module 401 is used to utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtains the first prime error code information;
Second processing module 402 is used for the part of the described first prime data cell except that its prime check code handled, and generates first new data element; Also be used for the part of the described second prime data cell except that its prime check code handled, generate second new data element;
The 4th acquisition module 403 is used for described first new data element is carried out the verification computing, obtains the first regeneration check code;
Second computing module 404 is used for obtaining the first new regeneration check code according to the XOR of described first prime error code information and the described first regeneration check code;
Second replaces module 405, is used for the described first new regeneration check code is replaced the described prime check code of described second new data element, generates revised data cell.
Information interaction in the said apparatus between each module, contents such as implementation since with the inventive method embodiment based on same design, particular content can repeat no more referring to the narration among the inventive method embodiment herein.
Device by present embodiment, utilization is carried the new regeneration check code of prime error code information and is replaced the prime check code of waiting to revise data cell, thereby realized the direct transmission of prime error code information, do not need to adopt the mode of serial ports expense or other gateway passage to transmit prime error code information, can realize the accurate transmission of error code information, and avoid the waste of bandwidth resources.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform, all or part of can the embodying that technical scheme of the present invention contributes to background technology with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
The above only is the specific embodiment of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.
Claims (5)
1. a data correcting method is characterized in that, this method comprises:
Utilize the prime check code of prime data cell that described prime data cell is carried out verification, obtain prime error code information;
The part of described prime data cell except that described prime check code handled, generated new data element;
Described new data element is carried out the verification computing, obtain the check code of regenerating;
According to the XOR of described prime error code information and the described regeneration check code check code of newly being regenerated;
Described new regeneration check code is replaced described prime check code in the described new data element, generate revised data cell.
2. a data correcting method is characterized in that, this method comprises:
Utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtain the first prime error code information;
The part of the described first prime data cell except that its prime check code handled, generated first new data element; The part of the described second prime data cell except that its prime check code handled, generated second new data element;
Described first new data element is carried out the verification computing, obtain the first regeneration check code;
XOR according to described first prime error code information and the described first regeneration check code obtains the first new regeneration check code;
The described first new regeneration check code is replaced described prime check code in described second new data element, generate revised data cell.
3. method according to claim 2 is characterized in that:
Described first prime data cell and the described second prime data cell are two adjacent data unit.
4. a data correction device is characterized in that, this device comprises:
First acquisition module is used to utilize the prime check code of prime data cell that described prime data cell is carried out verification, obtains prime error code information;
First processing module is used for the part of described prime data cell except that described prime check code handled, and generates new data element;
Second acquisition module is used for described new data element is carried out the verification computing, obtains the check code of regenerating;
First computing module is used for according to the XOR of described prime error code information and the described regeneration check code check code of newly being regenerated;
First replaces module, is used for described new regeneration check code is replaced the described prime check code of described new data element, generates revised data cell.
5. a data correction device is characterized in that, this device comprises:
The 3rd acquisition module is used to utilize the prime check code of the second prime data cell that the first prime data cell is carried out verification, obtains the first prime error code information;
Second processing module is used for the part of the described first prime data cell except that its prime check code handled, and generates first new data element; Also be used for the part of the described second prime data cell except that its prime check code handled, generate second new data element;
The 4th acquisition module is used for described first new data element is carried out the verification computing, obtains the first regeneration check code;
Second computing module is used for obtaining the first new regeneration check code according to the XOR of described first prime error code information and the described first regeneration check code;
Second replaces module, is used for the described first new regeneration check code is replaced the described prime check code of described second new data element, generates revised data cell.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910106342A CN101848055A (en) | 2009-03-23 | 2009-03-23 | Method and device for correcting data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910106342A CN101848055A (en) | 2009-03-23 | 2009-03-23 | Method and device for correcting data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101848055A true CN101848055A (en) | 2010-09-29 |
Family
ID=42772527
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200910106342A Pending CN101848055A (en) | 2009-03-23 | 2009-03-23 | Method and device for correcting data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101848055A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105373747A (en) * | 2015-12-09 | 2016-03-02 | 上海斐讯数据通信技术有限公司 | File generation method, file verification method and systems for preventing system from being tampered |
WO2020200304A1 (en) * | 2019-04-04 | 2020-10-08 | 华为技术有限公司 | Method and apparatus for data transmission |
CN112533207A (en) * | 2021-02-05 | 2021-03-19 | 浙江地芯引力科技有限公司 | Data verification method, device and system of wireless sensor |
CN113297000A (en) * | 2021-05-20 | 2021-08-24 | 山东云海国创云计算装备产业创新中心有限公司 | RAID (redundant array of independent disks) coding circuit and coding method |
CN113966499A (en) * | 2021-09-08 | 2022-01-21 | 长江存储科技有限责任公司 | Data protection method for memory and memory device thereof |
-
2009
- 2009-03-23 CN CN200910106342A patent/CN101848055A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105373747A (en) * | 2015-12-09 | 2016-03-02 | 上海斐讯数据通信技术有限公司 | File generation method, file verification method and systems for preventing system from being tampered |
WO2020200304A1 (en) * | 2019-04-04 | 2020-10-08 | 华为技术有限公司 | Method and apparatus for data transmission |
CN112533207A (en) * | 2021-02-05 | 2021-03-19 | 浙江地芯引力科技有限公司 | Data verification method, device and system of wireless sensor |
CN113297000A (en) * | 2021-05-20 | 2021-08-24 | 山东云海国创云计算装备产业创新中心有限公司 | RAID (redundant array of independent disks) coding circuit and coding method |
CN113966499A (en) * | 2021-09-08 | 2022-01-21 | 长江存储科技有限责任公司 | Data protection method for memory and memory device thereof |
CN113966499B (en) * | 2021-09-08 | 2023-10-27 | 长江存储科技有限责任公司 | Data protection method for memory and memory device thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101702639B (en) | Check value calculation method and device of cyclic redundancy check | |
CN106911426A (en) | The method and apparatus of data is transmitted in a kind of flexible Ethernet | |
RU2628145C2 (en) | Method of coding and decoding and device and system | |
CN100568744C (en) | A kind of method and apparatus of convolutional code rate coupling | |
CN104426631A (en) | Method and device for processing data | |
CA2276153A1 (en) | Secondary channel using code violations | |
CN102196321A (en) | Method for transmitting 100GE (100gigabit Ethernet) data in OTN (Optical Transport Network) and data sending device | |
US6701478B1 (en) | System and method to generate a CRC (cyclic redundancy check) value using a plurality of CRC generators operating in parallel | |
CN110943800A (en) | Method, device and system for sending data packet, storage medium and electronic device | |
CN104426629A (en) | Physical layer coding and decoding methods and devices | |
CN101848055A (en) | Method and device for correcting data | |
CN1283905A (en) | Error correction controlled coding of transmission equipment protection | |
US20220052785A1 (en) | Data sending and receiving method and device | |
CN111669250B (en) | Data transmission method, device and system | |
CN104579558A (en) | Method for detecting integrity in data transmission process | |
US20110060959A1 (en) | Method and Apparatus for Data Receiving | |
CN104081701A (en) | Communication method, system and device for optical network system | |
CN101977092B (en) | Forward error correction mapping and de-mapping techniques | |
RU2646346C2 (en) | Apparatus and method for transmitting and receiving forward error correction packet | |
US7822071B2 (en) | Method and system to enable the transport of sysplex timer protocols over generic frame procedure networks | |
US20150106679A1 (en) | Defect propagation of multiple signals of various rates when mapped into a combined signal | |
WO2014015516A1 (en) | Method and apparatus for performing pipelined operations on parallel input data with feedback | |
CN104734815A (en) | Hardware implementation method and system for FEC in OTN system | |
JP5761551B2 (en) | Transmission device, transmission method, reception device, reception method, program, and transmission system | |
CN103763064A (en) | CRC code generating method and circuit applicable to ultra-high-speed communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20100929 |