CN101771495A - Data correction method and device - Google Patents
Data correction method and device Download PDFInfo
- Publication number
- CN101771495A CN101771495A CN 200810241993 CN200810241993A CN101771495A CN 101771495 A CN101771495 A CN 101771495A CN 200810241993 CN200810241993 CN 200810241993 CN 200810241993 A CN200810241993 A CN 200810241993A CN 101771495 A CN101771495 A CN 101771495A
- Authority
- CN
- China
- Prior art keywords
- data unit
- check code
- link
- transmitted
- complete
- 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.)
- Granted
Links
Images
Landscapes
- Detection And Prevention Of Errors In Transmission (AREA)
Abstract
本发明公开了一种数据修正方法和装置,该方法包括:提取主用链路上传输的数据单元的完整校验码;根据主用链路上传输的数据单元的完整校验码运算获得主用链路上传输的数据单元的本体校验码;将主用链路上传输的数据单元的本体校验码替换主用链路上传输的数据单元的完整校验码,获得主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据备用链路上传输的数据单元的完整校验码运算获得备用链路上传输的数据单元的本体校验码;将备用链路上传输的数据单元的本体校验码替换备用链路上传输的数据单元的完整校验码,获得备用链路上传输的修正后的数据单元。采用本发明实施例的技术方案,降低了保护倒换时的误码率。
The present invention discloses a data correction method and device, which includes: extracting the complete check code of the data unit transmitted on the main link; obtaining the body check code of the data unit transmitted on the main link according to the complete check code calculation of the data unit transmitted on the main link; replacing the complete check code of the data unit transmitted on the main link with the body check code of the data unit transmitted on the main link, and obtaining the corrected data unit transmitted on the main link; extracting the complete check code of the data unit transmitted on the backup link; obtaining the body check code of the data unit transmitted on the backup link according to the complete check code calculation of the data unit transmitted on the backup link; replacing the body check code of the data unit transmitted on the backup link with the body check code of the data unit transmitted on the backup link, and obtaining the corrected data unit transmitted on the backup link. The technical solution of the embodiment of the present invention is adopted to reduce the bit error rate during protection switching.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种数据修正方法及装置。The invention relates to the field of communication technology, in particular to a data correction method and device.
背景技术Background technique
在通信技术领域中,需要提供稳定可靠的通信业务,但实际通信环境中的干扰因素很多,如光通信中的光纤断裂、光损耗过大、光信号干扰等都会对通信通道带来小误码、大误码甚至通道失效的影响,在信号传输过程中,为了监控传输过程中的信号质量,通常会在数据单元中增加一些检错编码。例如比特交叉奇偶(Bit-Interleaved Parity,BIP)校验码是最常用的检错编码之一,被广泛应用于准同步数字体系(Plesiochronous Digital Hierarchy,PDH)、同步数字序列(Synchronous Digital Hierarchy,SDH)、数据等传输领域中。In the field of communication technology, it is necessary to provide stable and reliable communication services, but there are many interference factors in the actual communication environment, such as fiber breakage in optical communication, excessive optical loss, optical signal interference, etc., will bring small errors to the communication channel , large bit errors or even channel failure, in the signal transmission process, in order to monitor the signal quality during the transmission process, some error detection codes are usually added to the data unit. For example, Bit-Interleaved Parity (BIP) check code is one of the most commonly used error detection codes, and is widely used in Plesiochronous Digital Hierarchy (PDH), Synchronous Digital Hierarchy (SDH) ), data and other transmission fields.
随着通信技术的发展以及市场竞争的加剧,客户对业务保护的要求越来越高,于是很多保护倒换要求倒换时检测不到误码,例如常用的无缝数据倒换(Hitless Switch Module,HSM),如果倒换时检测到误码会导致倒换失败。With the development of communication technology and the intensification of market competition, customers have higher and higher requirements for service protection, so many protection switching requirements cannot detect bit errors during switching, such as the commonly used seamless data switching (Hitless Switch Module, HSM) , if a bit error is detected during switching, the switching will fail.
在进行本发明创造的过程中,发明人发现现有技术中至少存在如下问题:在进行保护链路切换时检测到误码的概率比较高。During the process of creating the present invention, the inventor found at least the following problems in the prior art: the probability of bit errors detected during protection link switching is relatively high.
发明内容Contents of the invention
本发明实施例提供了一种数据修正方法及装置,可以降低保护倒换时检测到误码的概率。技术方案为:The embodiment of the present invention provides a data correction method and device, which can reduce the probability of bit errors detected during protection switching. The technical solution is:
一种数据修正方法,该方法包括:A data correction method, the method comprising:
提取主用链路上传输的数据单元的完整校验码;Extract the complete check code of the data unit transmitted on the active link;
根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;Obtaining the body check code of the data unit transmitted on the active link according to the complete check code operation of the data unit transmitted on the active link;
将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;replacing the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link to obtain the corrected data unit transmitted on the active link ;
提取备用链路上传输的数据单元的完整校验码;Extract the complete check code of the data unit transmitted on the standby link;
根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;Obtaining the body check code of the data unit transmitted on the standby link according to the complete check code operation of the data unit transmitted on the standby link;
将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。The body check code of the data unit transmitted on the standby link is replaced by the complete check code of the data unit transmitted on the standby link to obtain the corrected data unit transmitted on the standby link.
一种数据修正系统,该系统包括:A data correction system, the system includes:
主用修正单元,用于提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;The main correction unit is used to extract the complete check code of the data unit transmitted on the main link; according to the complete check code operation of the data unit transmitted on the main link, the transmission on the main link is obtained. The body check code of the data unit of the main link; the body check code of the data unit transmitted on the main link is replaced by the complete check code of the data unit transmitted on the main link to obtain the main link Corrected data units transmitted on the road;
备用修正单元,用于提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。The standby correction unit is used to extract the complete check code of the data unit transmitted on the standby link; and obtain the complete check code of the data unit transmitted on the standby link according to the operation of the complete check code of the data unit transmitted on the standby link Body check code; replace the full check code of the data unit transmitted on the backup link with the body check code of the data unit transmitted on the backup link to obtain the corrected data unit transmitted on the backup link data unit.
采用本发明实施例的技术方案,通过分别使用本体校验码替换主备链路上传输的数据单元的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,由于保护倒换时使用备用链路上保存的校验码校验主用链路上的数据单元,从而可以降低保护倒换时的误码率。By adopting the technical solution of the embodiment of the present invention, by replacing the complete check codes of the data units transmitted on the active and standby links with the body check codes respectively, the check codes of the corresponding data units transmitted on the active and standby links will not Because the check code stored on it is different, since the check code stored on the standby link is used to check the data unit on the active link during protection switching, the bit error rate during protection switching can be reduced.
附图说明Description of drawings
图1是一种保护倒换示意图;FIG. 1 is a schematic diagram of protection switching;
图2是本发明实施例二中保护倒换示意图;FIG. 2 is a schematic diagram of protection switching in Embodiment 2 of the present invention;
图3是本发明实施例三中保护倒换示意图;FIG. 3 is a schematic diagram of protection switching in Embodiment 3 of the present invention;
图4是本发明实施例四中的修正流程图;Fig. 4 is a flow chart of correction in Embodiment 4 of the present invention;
图5是本发明实施例五中的再次修正流程图;Fig. 5 is a flow chart of re-amendment in Embodiment 5 of the present invention;
图6是本发明实施例六中的校验码修正装置的结构图;FIG. 6 is a structural diagram of a verification code correction device in Embodiment 6 of the present invention;
图7是本发明实施例七中的校验码修正装置的结构图;FIG. 7 is a structural diagram of a check code correction device in Embodiment 7 of the present invention;
具体实施方式Detailed ways
为了更清楚地描述本发明,下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述:In order to describe the present invention more clearly, below in conjunction with accompanying drawing and embodiment, specific embodiment of the present invention is described in further detail:
如图1所示,为现有技术常用的保护倒换的示意图,业务源端发送原始数据单元到链路1和链路2,原始数据单元为B1、B2、B3、B4、B5等,校验码插入装置将校验码插入到原始数据单元,C1、C2、C3、C4、C5等为链路1上插入校验码后的数据单元,C1′、C2′、C3′、C4′、C5′等为链路2上插入校验码后的数据单元。As shown in Figure 1, it is a schematic diagram of protection switching commonly used in the prior art. The service source sends original data units to link 1 and link 2. The original data units are B1, B2, B3, B4, B5, etc., and the verification The code insertion device inserts the check code into the original data unit, C1, C2, C3, C4, C5, etc. are the data units after the check code is inserted on link 1, C1', C2', C3', C4', C5 ' and so on are the data units after the check code is inserted on the link 2.
C1上保存的校验码随机生成,C2上保存的校验码为利用算法对C1的所有字节进行运算的结果,C3上保存的校验码为利用现有算法对C2的所有字节进行运算的结果,链路1上其余校验码的生成方法类似。The check code saved on C1 is randomly generated, the check code saved on C2 is the result of calculating all the bytes of C1 using the algorithm, and the check code saved on C3 is the result of using the existing algorithm to calculate all the bytes of C2 As a result of the operation, the methods for generating other check codes on link 1 are similar.
C1′上保存的校验码随机生成,C2′上保存的校验码为利用算法对C1′的所有字节进行运算的结果,C3′上保存的校验码为利用现有算法对C2′的所有字节进行运算的结果,链路2上其余校验码的生成方法类似。The check code saved on C1' is randomly generated, the check code saved on C2' is the result of calculating all the bytes of C1' using the algorithm, and the check code saved on C3' is the result of using the existing algorithm to calculate C2' As a result of performing operations on all the bytes of , the methods for generating other check codes on link 2 are similar.
显然可知,如果C1和C1′上保存的校验码不同,则其余相应的数据单元上保存的校验码也会不同,当链路1故障时需要使用链路2上的数据,在倒换的瞬间使用链路2上保存的校验码校验链路1上的数据单元,必然会检测到误码。而C1和C1′上保存的校验码不同的概率很大。Obviously, if the check codes stored on C1 and C1′ are different, the check codes stored on other corresponding data units will also be different. When link 1 fails, the data on link 2 needs to be used. Instantly use the check code saved on link 2 to check the data unit on link 1, and a bit error will inevitably be detected. However, the check codes stored on C1 and C1' have a high probability of being different.
上述校验码的校验范围包括待校验数据单元的所有字节,为完整校验码,是一种常用的校验码,使用这种校验码在进行保护倒换时检测到误码的概率比较大。The verification range of the above check code includes all the bytes of the data unit to be verified, which is a complete check code and is a commonly used check code. When using this check code to detect bit errors during protection switching The probability is relatively high.
实施例一Embodiment one
本实施例提供了一种数据修正方法,包括:This embodiment provides a data correction method, including:
提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。Extracting the complete check code of the data unit transmitted on the active link; calculating the body check of the data unit transmitted on the active link according to the complete check code of the data unit transmitted on the active link code; replace the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link, and obtain the corrected data unit transmitted on the active link Data unit; extracting the complete check code of the data unit transmitted on the backup link; calculating the body check of the data unit transmitted on the backup link according to the complete check code of the data unit transmitted on the backup link code; replace the complete check code of the data unit transmitted on the standby link with the body check code of the data unit transmitted on the standby link, to obtain the corrected data unit transmitted on the standby link.
其中,修正前,数据单元上保存的完整校验码用于校验另一数据单元的所有字节,待校验数据单元(即所述另一数据单元)由完整校验码和本体组成。C和D为主用链路上传输的数据单元,C和D可以为主用链路上传输的相邻的数据单元,也可以为主用链路上传输的不相邻的数据单元,C′和D′为备用链路上传输的数据单元,C′和D′可以为备用链路上传输的相邻的数据单元,也可以为备用链路上传输的不相邻的数据单元,C和C′、D和D′都是修正前的数据单元,C上的完整校验码用于校验D,C′上的完整校验码用于校验D′。如果D和D′上的本体相同,但D和D′上的完整校验码不同,则C和C′上的完整校验码不同。Wherein, before correction, the complete check code stored on the data unit is used to check all bytes of another data unit, and the data unit to be checked (that is, the other data unit) is composed of a complete check code and a body. C and D are data units transmitted on the active link. C and D can be adjacent data units transmitted on the active link, or non-adjacent data units transmitted on the active link. C ' and D' are data units transmitted on the backup link, C' and D' can be adjacent data units transmitted on the backup link, or non-adjacent data units transmitted on the backup link, C And C', D and D' are all data units before correction, the complete check code on C is used to verify D, and the complete check code on C' is used to verify D'. If the ontologies on D and D' are the same, but the full checksums on D and D' are different, then the full checksums on C and C' are different.
其中,修正后数据单元上保存的本体校验码用于校验另一其它数据单元的本体部分,待校验数据单元(即所述另一数据单元)由本体校验码和本体组成。E和F为主用链路上传输的的数据单元,E′和F′为备用链路上传输的数据单元,E和E′、F和F′都是修正后的数据单元,E上的本体校验码用于校验F,E′上的本体校验码用于校验F′。,如果F、F′上的本体部分相同,但F、F′上保存的本体校验码不同,则E和E′上的本体校验码相同。Wherein, the body check code saved on the corrected data unit is used to verify the body part of another data unit, and the data unit to be checked (that is, the other data unit) is composed of the body check code and the body. E and F are the data units transmitted on the active link, E' and F' are the data units transmitted on the standby link, E and E', F and F' are all corrected data units, and the The body check code is used to verify F, and the body check code on E' is used to verify F'. , if the body parts on F and F' are the same, but the body check codes stored on F and F' are different, then the body check codes on E and E' are the same.
采用本实施例的技术方案,通过分别使用本体校验码替换了主备链路上的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,从而降低了保护倒换时的误码率。By adopting the technical solution of this embodiment, the complete check codes on the active and standby links are replaced by the main body check codes respectively, so that the check codes of the corresponding data units transmitted on the active and standby links will not be saved due to Different check codes are different, thereby reducing the bit error rate during protection switching.
实施例二Embodiment two
本实施例提供了一种数据修正方法,包括:This embodiment provides a data correction method, including:
提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。Extracting the complete check code of the data unit transmitted on the active link; calculating the body check of the data unit transmitted on the active link according to the complete check code of the data unit transmitted on the active link code; replace the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link, and obtain the corrected data unit transmitted on the active link Data unit; extracting the complete check code of the data unit transmitted on the backup link; calculating the body check of the data unit transmitted on the backup link according to the complete check code of the data unit transmitted on the backup link code; replace the complete check code of the data unit transmitted on the standby link with the body check code of the data unit transmitted on the standby link, to obtain the corrected data unit transmitted on the standby link.
当所述主用链路正常时,选择接收所述主用链路上传输的修正后的数据单元;When the active link is normal, select to receive the corrected data unit transmitted on the active link;
当所述主用链路故障时,接收所述备用链路上传输的修正后的数据单元;When the active link fails, receive the corrected data unit transmitted on the standby link;
提取接收的修正后的数据单元的本体校验码;根据所述接收的修正后的数据单元的本体校验码运算获得所述接收的修正后的数据单元的新完整校验码;将所述接收的修正后的数据单元的新完整校验码替换所述接收的修正后的数据单元的本体校验码,获得再次修正后的数据单元;Extracting the body check code of the received corrected data unit; calculating a new complete check code of the received corrected data unit according to the body check code of the received corrected data unit; replacing the body check code of the received corrected data unit with the new complete check code of the received corrected data unit, to obtain the corrected data unit again;
利用所述新完整校验码对所述再次修正后的数据单元进行误码检测。Perform bit error detection on the re-amended data unit by using the new complete check code.
其中,利用新完整校验码对再次修正后数据单元进行误码检测,可以使用标准的误码检测设备,方便与标准设备对接。Among them, using the new complete check code to perform error detection on the re-corrected data unit, standard error detection equipment can be used to facilitate docking with standard equipment.
如图2所示,为本实施例相应的示意图,在校验码插入之后进行校验码修正,在误码检测之前进行校验码的再次修正。As shown in FIG. 2 , which is a schematic diagram corresponding to this embodiment, the check code is corrected after the check code is inserted, and the check code is corrected again before the error detection.
通过本实施例的技术方案,通过分别使用本体校验码替换了主备链路上的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,从而降低了保护倒换时的误码率,利用新完整校验码对修正后的数据单元进行再次修正,利用新完整校验码对再次修正后数据单元进行误码检测,方便与标准设备对接。Through the technical solution of this embodiment, the complete check codes on the main and standby links are replaced by using the main body check codes respectively, so that the check codes of the corresponding data units transmitted on the main and standby links will not be saved due to The different check codes are different, thereby reducing the bit error rate during protection switching. Use the new complete check code to correct the corrected data unit again, and use the new complete check code to correct the corrected data unit again. Code detection, convenient for docking with standard equipment.
实施例三Embodiment three
本实施例提供了一种数据修正方法,包括:This embodiment provides a data correction method, including:
提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。Extracting the complete check code of the data unit transmitted on the active link; calculating the body check of the data unit transmitted on the active link according to the complete check code of the data unit transmitted on the active link code; replace the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link, and obtain the corrected data unit transmitted on the active link Data unit; extracting the complete check code of the data unit transmitted on the backup link; calculating the body check of the data unit transmitted on the backup link according to the complete check code of the data unit transmitted on the backup link code; replace the complete check code of the data unit transmitted on the standby link with the body check code of the data unit transmitted on the standby link, to obtain the corrected data unit transmitted on the standby link.
当所述主用链路正常时,选择接收所述主用链路上传输的修正后的数据单元;When the active link is normal, select to receive the corrected data unit transmitted on the active link;
当所述主用链路故障时,接收所述备用链路上传输的修正后的数据单元;When the active link fails, receive the corrected data unit transmitted on the standby link;
利用接收的修正后的数据单元的本体校验码对所述接收的修正后的数据单元进行误码检测。Bit error detection is performed on the received corrected data unit using the body check code of the received corrected data unit.
如图3所示,为本实施例相应的示意图,在校验码插入装置之后进行校验码修正,直接利用本体校验码对修正后的数据单元进行误码检测。As shown in FIG. 3 , which is a corresponding schematic diagram of this embodiment, the check code is corrected after the check code is inserted into the device, and the corrected data unit is directly used for error detection by the body check code.
通过本实施例的技术方案,通过分别使用本体校验码替换了主备链路上的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,从而降低了保护倒换时的误码率,直接使用本体校验码对修正后的数据单元进行误码检测。Through the technical solution of this embodiment, the complete check codes on the main and standby links are replaced by using the main body check codes respectively, so that the check codes of the corresponding data units transmitted on the main and standby links will not be saved due to Different check codes are different, thereby reducing the bit error rate during protection switching, and directly using the body check code to perform bit error detection on the corrected data unit.
实施例四Embodiment four
本实施例提供了一种数据修正方法,包括:This embodiment provides a data correction method, including:
提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。Extracting the complete check code of the data unit transmitted on the active link; calculating the body check of the data unit transmitted on the active link according to the complete check code of the data unit transmitted on the active link code; replace the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link, and obtain the corrected data unit transmitted on the active link Data unit; extracting the complete check code of the data unit transmitted on the backup link; calculating the body check of the data unit transmitted on the backup link according to the complete check code of the data unit transmitted on the backup link code; replace the complete check code of the data unit transmitted on the standby link with the body check code of the data unit transmitted on the standby link, to obtain the corrected data unit transmitted on the standby link.
下面提供一种具体的修正方法,本实施例中完整校验码的生成方法为:第一个数据单元上保存的校验码随机生成,第二个数据单元上保存的校验码为利用算法对第一个数据单元的所有字节进行运算的结果,第三个数据单元上保存的校验码为利用现有算法对第二个数据单元的所有字节进行运算的结果,其余数据单元上保存的校验码的生成方法类似。其中,上述算法是指对数据单元的所有字节按字节进行异或运算:A specific correction method is provided below. The generation method of the complete check code in this embodiment is: the check code stored on the first data unit is randomly generated, and the check code stored on the second data unit is generated using an algorithm. The result of operating on all the bytes of the first data unit, the check code stored on the third data unit is the result of operating on all the bytes of the second data unit using the existing algorithm, and the remaining data units The method of generating the stored check code is similar. Among them, the above algorithm refers to performing XOR operation on all bytes of the data unit byte by byte:
B(n)=Pld1(n-1)^Pld2(n-1)^......^Pldx(n-1)......B(n)=Pld1(n-1)^Pld2(n-1)^......^Pldx(n-1)......
其中,n为大于1的自然数,“^”为异或运算符,Pld1(n-1)表示第n-1个数据单元第1个字节,Pld2(n-1)表示第n-1个数据单元第2个字节,Pldx(n-1)表示第n-1个数据单元第x个字节,B(n)为第n个数据单元上保存的校验码,是对第n-1个数据单元的所有字节进行运算的结果。在误码检测时对第n-1个数据单元进行同样的运算,然后和B(n)进行比较得到误码信息。Among them, n is a natural number greater than 1, "^" is an XOR operator, Pld1(n-1) represents the first byte of the n-1th data unit, Pld2(n-1) represents the n-1th The second byte of the data unit, Pldx(n-1) indicates the xth byte of the n-1th data unit, and B(n) is the check code stored on the nth data unit, which is for the n-th The result of performing operations on all bytes of a data unit. During bit error detection, the same operation is performed on the n-1th data unit, and then compared with B(n) to obtain bit error information.
令第n-1个数据单元中除去校验码的所有字节的异或结果为Cpld(n-1),第n-1个数据单元上保存的校验码为B(n-1),则Let the XOR result of all bytes except the check code in the n-1th data unit be Cpld(n-1), and the check code stored on the n-1th data unit be B(n-1), but
B(n)=Cpld(n-1)^B(n-1) ①B(n)=Cpld(n-1)^B(n-1) ①
上式两边同时异或B(n-1),得到:XOR B(n-1) on both sides of the above formula at the same time to get:
B(n)^B3(n-1)=Cpld(n-1)^B(n-1)^B(n-1)B(n)^B3(n-1)=Cpld(n-1)^B(n-1)^B(n-1)
根据异或运算定律得到:According to the law of XOR operation:
Cpld(n-1)=B(n-1)^B(n) ②Cpld(n-1)=B(n-1)^B(n) ②
由式②,对于主用链路上的数据单元,提取所述主用链路上传输的相邻的第一、第二数据单元中的完整校验码;对所述第一数据单元的完整校验码与所述第二数据单元的完整校验码进行异或运算,得到所述第一数据单元的本体校验码;将所述第一数据单元的本体校验码替换所述第一数据单元的完整校验码;By formula ②, for the data unit on the main link, extract the complete check code in the adjacent first and second data units transmitted on the main link; for the complete check code of the first data unit performing an XOR operation on the check code and the complete check code of the second data unit to obtain the body check code of the first data unit; replacing the body check code of the first data unit with the first The complete check code of the data unit;
对于备用链路上的数据单元,提取所述备用链路上传输的相邻的第三、第四数据单元中的完整校验码;对所述第三数据单元的完整校验码与所述第四数据单元的完整校验码进行异或运算,得到所述第三数据单元的本体校验码;将所述第三数据单元的本体校验码替换所述第三数据单元的完整校验码。For the data unit on the backup link, extract the complete check code in the adjacent third and fourth data units transmitted on the backup link; the complete check code of the third data unit and the performing an XOR operation on the complete check code of the fourth data unit to obtain the body check code of the third data unit; replacing the complete check code of the third data unit with the body check code of the third data unit code.
为了使本实施例更加清楚,下面提供一种更加详细的修正过程,如图4所示,修正步骤为:In order to make this embodiment more clear, a more detailed correction process is provided below, as shown in Figure 4, the correction steps are:
S401、提取第1个数据单元的完整校验码B(1),设置n=2;S401. Extract the complete check code B(1) of the first data unit, and set n=2;
S402、提取第n个数据单元的完整校验码B(n);S402. Extract the complete check code B(n) of the nth data unit;
S403、利用第n-1个数据单元的完整校验码B(n-1)异或第n个数据单元的完整校验码B(n),得到第n-1个数据单元的本体校验码Cpld(n-1);S403. Using the complete check code B(n-1) of the n-1th data unit to XOR the complete check code B(n) of the n-th data unit to obtain the body check of the n-1th data unit code Cpld(n-1);
S404、利用第n-1个数据单元的本体校验码Cpld(n-1)替换第n-1个数据单元的完整校验码B(n-1);S404. Use the body check code Cpld(n-1) of the n-1th data unit to replace the complete check code B(n-1) of the n-1th data unit;
S405、令n在原来的数值上加1,执行步骤S402,直至修正完所有数据单元。S405. Let n add 1 to the original value, and execute step S402 until all data units are corrected.
本实施例中,n为大于1的自然数,用于校验第n-1个数据单元的校验码保存在第n个数据单元上;In this embodiment, n is a natural number greater than 1, and the check code used to verify the n-1th data unit is stored on the nth data unit;
如果用于校验第n-1个数据单元的校验码保存在第n+1个数据单元上,可以使用类似的方法进行修正。If the check code used to verify the n-1th data unit is stored on the n+1th data unit, a similar method can be used for correction.
采用本实施例的技术方案,通过分别使用本体校验码替换了主备链路上的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,从而降低了保护倒换时的误码率。By adopting the technical solution of this embodiment, the complete check codes on the active and standby links are replaced by the main body check codes respectively, so that the check codes of the corresponding data units transmitted on the active and standby links will not be saved due to Different check codes are different, thereby reducing the bit error rate during protection switching.
实施例五Embodiment five
本实施例提供了一种数据修正方法,包括:This embodiment provides a data correction method, including:
提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。Extracting the complete check code of the data unit transmitted on the active link; calculating the body check of the data unit transmitted on the active link according to the complete check code of the data unit transmitted on the active link code; replace the complete check code of the data unit transmitted on the active link with the body check code of the data unit transmitted on the active link, and obtain the corrected data unit transmitted on the active link Data unit; extracting the complete check code of the data unit transmitted on the backup link; calculating the body check of the data unit transmitted on the backup link according to the complete check code of the data unit transmitted on the backup link code; replace the complete check code of the data unit transmitted on the standby link with the body check code of the data unit transmitted on the standby link, to obtain the corrected data unit transmitted on the standby link.
当所述主用链路正常时,接收所述主用链路上传输的修正后的数据单元;When the active link is normal, receive the corrected data unit transmitted on the active link;
当所述主用链路故障时,接收所述备用链路上传输的修正后的数据单元;When the active link fails, receive the corrected data unit transmitted on the standby link;
提取接收的修正后的数据单元的本体校验码;根据所述接收的修正后的数据单元的本体校验码运算获得所述接收的修正后的数据单元的新完整校验码;将所述接收的修正后的数据单元的新完整校验码替换所述接收的修正后的数据单元的本体校验码,获得再次修正后的数据单元;Extracting the body check code of the received corrected data unit; calculating a new complete check code of the received corrected data unit according to the body check code of the received corrected data unit; replacing the body check code of the received corrected data unit with the new complete check code of the received corrected data unit, to obtain the corrected data unit again;
利用所述新完整校验码对所述再次修正后的数据单元进行误码检测。Perform bit error detection on the re-amended data unit by using the new complete check code.
下面提供一种对修正后的数据单元进行再次修正的具体方法,本实施例中完整校验码的生成方法为:第一个数据单元上保存的校验码随机生成,第二个数据单元上保存的校验码为利用算法对第一个数据单元的所有字节进行运算的结果,第三个数据单元上保存的校验码为利用现有算法对第二个数据单元的所有字节进行运算的结果,其余数据单元上保存的校验码的生成方法类似。其中,上述算法是指对数据单元的所有字节按字节进行异或运算:The following provides a specific method for correcting the corrected data unit again. The generation method of the complete check code in this embodiment is: the check code stored on the first data unit is randomly generated, and the check code stored on the second data unit is generated randomly. The saved check code is the result of using the algorithm to operate on all the bytes of the first data unit, and the check code saved on the third data unit is the result of using the existing algorithm to perform operations on all the bytes of the second data unit As a result of the operation, the generation methods of the check codes stored in the other data units are similar. Among them, the above algorithm refers to performing XOR operation on all bytes of the data unit byte by byte:
B(n)=Pld1(n-1)^Pld2(n-1)^......^Pldx(n-1)......B(n)=Pld1(n-1)^Pld2(n-1)^......^Pldx(n-1)......
其中,n为大于1的自然数,“^”为异或运算符,Pld1(n-1)表示第n-1个数据单元第1个字节,Pld2(n-1)表示第n-1个数据单元第2个字节,Pldx(n-1)表示第n-1个数据单元第x个字节,B(n)为第n个数据单元上保存的校验码,是对第n-1个数据单元的所有字节进行运算的结果。在误码检测时对第n-1个数据单元进行同样的运算,然后和B(n)进行比较得到误码信息。Among them, n is a natural number greater than 1, "^" is an XOR operator, Pld1(n-1) represents the first byte of the n-1th data unit, Pld2(n-1) represents the n-1th The second byte of the data unit, Pldx(n-1) indicates the xth byte of the n-1th data unit, and B(n) is the check code stored on the nth data unit, which is for the n-th The result of performing operations on all bytes of a data unit. During bit error detection, the same operation is performed on the n-1th data unit, and then compared with B(n) to obtain bit error information.
令第n-1个数据单元中除去校验码的所有字节的异或结果为Cpld(n-1),第n-1个数据单元上保存的校验码为B(n-1),则Let the XOR result of all bytes except the check code in the n-1th data unit be Cpld(n-1), and the check code stored on the n-1th data unit be B(n-1), but
B(n)=Cpld(n-1)^B(n-1) ①B(n)=Cpld(n-1)^B(n-1) ①
上式两边同时异或B(n-1),得到:XOR B(n-1) on both sides of the above formula at the same time to get:
B(n)^B3(n-1)=Cpld(n-1)^B(n-1)^B(n-1)B(n)^B3(n-1)=Cpld(n-1)^B(n-1)^B(n-1)
根据异或运算定律得到:According to the law of XOR operation:
Cpld(n-1)=B(n-1)^B(n) ②Cpld(n-1)=B(n-1)^B(n) ②
由式①,本实施例的再次修正方法为:提取接收的修正后的相邻的第五、第六数据单元中的本体校验码;对所述接收的修正后的第五数据单元的本体校验码与所述接收的修正后的第五数据单元的新完整校验码进行异或运算,得到所述接收的修正后的第六数据单元的新完整校验码;将所述接收的修正后的第六数据单元的新完整校验码替换所述接收的修正后的第六数据单元的本体校验码。According to the formula ①, the re-correction method of this embodiment is: extracting the body check codes in the received corrected fifth and sixth data units; Exclusive OR operation is performed on the check code and the new complete check code of the received corrected fifth data unit to obtain the new complete check code of the received corrected sixth data unit; the received The new complete check code of the corrected sixth data unit replaces the received body check code of the corrected sixth data unit.
为了使本实施例更加清楚,下面提供一种更加详细的再次修正过程,如图5所示,修正步骤为:In order to make this embodiment more clear, a more detailed re-correction process is provided below, as shown in Figure 5, the correction steps are:
S501、提取第1个数据单元的本体校验码Cpld(1),随机生成第1个数据单元的新完整校验码b(1),设置n=1;S501. Extract the body check code Cpld(1) of the first data unit, randomly generate a new complete check code b(1) of the first data unit, and set n=1;
S502、提取第n+1个数据单元的本体校验码Cpld(n+1);S502. Extract the body check code Cpld(n+1) of the n+1th data unit;
S503、利用第n个数据单元的新完整校验码b(n)异或第n个数据单元的本体校验码Cpld(n),得到第n+1个数据单元的新完整校验码b(n+1);S503. Using the new complete check code b(n) of the nth data unit to XOR the body check code Cpld(n) of the nth data unit to obtain the new complete check code b of the n+1th data unit (n+1);
S504、利用第n+1个数据单元的新完整校验码b(n+1)替换第n+1个数据单元的本体校验码Cpld(n+1);S504. Use the new complete check code b(n+1) of the n+1th data unit to replace the body check code Cpld(n+1) of the n+1th data unit;
S505、令n在原来的数值上加1,执行步骤S502,直至修正完所有数据单元。S505. Let n add 1 to the original value, and execute step S502 until all data units are corrected.
通过本实施例的技术方案,通过分别使用本体校验码替换了主备链路上的完整校验码,使得主备链路上传输的相应数据单元的校验码,不会因为其上保存的校验码的不同而不同,从而降低了保护倒换时的误码率,利用新完整校验码对修正后的数据单元进行再次修正,利用新完整校验码对再次修正后数据单元进行误码检测,方便与标准设备对接。Through the technical solution of this embodiment, the complete check codes on the main and standby links are replaced by using the main body check codes respectively, so that the check codes of the corresponding data units transmitted on the main and standby links will not be saved due to The different check codes are different, thereby reducing the bit error rate during protection switching. Use the new complete check code to correct the corrected data unit again, and use the new complete check code to correct the corrected data unit again. Code detection, convenient for docking with standard equipment.
实施例六Embodiment six
一种数据修正系统,如图6所示,该系统包括:A data correction system, as shown in Figure 6, the system includes:
主用修正单元601,用于提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;The
备用修正单元602,用于提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元。The
实施例七Embodiment seven
一种数据修正系统,如图7所示,该系统包括:A data correction system, as shown in Figure 7, the system includes:
主用修正单元601,用于提取主用链路上传输的数据单元的完整校验码;根据所述主用链路上传输的数据单元的完整校验码运算获得所述主用链路上传输的数据单元的本体校验码;将所述主用链路上传输的数据单元的本体校验码替换所述主用链路上传输的数据单元的完整校验码,获得所述主用链路上传输的修正后的数据单元;The
备用修正单元602,用于提取备用链路上传输的数据单元的完整校验码;根据所述备用链路上传输的数据单元的完整校验码运算获得所述备用链路上传输的数据单元的本体校验码;将所述备用链路上传输的数据单元的本体校验码替换所述备用链路上传输的数据单元的完整校验码,获得所述备用链路上传输的修正后的数据单元;The
当所述主用链路正常时,选择接收所述主用链路上传输的修正后的数据单元;当所述主用链路故障时,接收所述备用链路上传输的修正后的数据单元,该系统还包括:When the active link is normal, select to receive the corrected data unit transmitted on the active link; when the active link fails, receive the corrected data transmitted on the backup link unit, the system also includes:
再修正单元603,用于提取所述接收的修正后的数据单元的本体校验码;根据所述接收的修正后的数据单元的本体校验码运算获得所述接收的修正后的数据单元的新完整校验码;将所述接收的修正后的数据单元的新完整校验码替换所述接收的修正后的数据单元的本体校验码,获得再次修正后的数据单元。The
采用本发明实施例的技术方案,通过使用本体校验码分别替换主备链路上传输的数据单元的完整校验码,使得主备链路上传输的相应数据单元的校验码不会因为其上保存的校验码的不同而不同,由于保护倒换时使用备用链路上保存的校验码校验主用链路上的数据单元,从而可以降低保护倒换时的误码率,利用新完整校验码对修正后的数据单元进行再次修正,利用新完整校验码对再次修正后数据单元进行误码检测,方便与标准设备对接。Adopting the technical scheme of the embodiment of the present invention, by using the body check code to replace the complete check code of the data unit transmitted on the active and standby links respectively, so that the check code of the corresponding data unit transmitted on the active and standby links will not be affected by The check codes stored on it are different. Since the check code stored on the standby link is used to check the data units on the active link during protection switching, the bit error rate during protection switching can be reduced. Using the new The complete check code corrects the corrected data unit again, and uses the new complete check code to perform error detection on the corrected data unit, which is convenient for docking with standard equipment.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的硬件平台的方式来实现,本发明的技术方案对背景技术做出贡献的全部或者部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be realized by means of software plus a necessary hardware platform, and all or part of the contribution made by the technical solution of the present invention to the background technology can be implemented as It is reflected in the form of a software product. The computer software product can be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device) etc.) to perform the methods described in various embodiments or some parts of the embodiments of the present invention.
以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The foregoing is only a specific embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, some improvements and modifications can also be made without departing from the principle of the present invention. It should be regarded as the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810241993 CN101771495B (en) | 2008-12-30 | 2008-12-30 | Data correction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810241993 CN101771495B (en) | 2008-12-30 | 2008-12-30 | Data correction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101771495A true CN101771495A (en) | 2010-07-07 |
CN101771495B CN101771495B (en) | 2013-04-17 |
Family
ID=42504124
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200810241993 Expired - Fee Related CN101771495B (en) | 2008-12-30 | 2008-12-30 | Data correction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101771495B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764942A (en) * | 2019-09-17 | 2020-02-07 | 平安银行股份有限公司 | Multi-type data checking method, device, computer system and readable storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE19630343B4 (en) * | 1996-07-26 | 2004-08-26 | Telefonaktiebolaget L M Ericsson (Publ) | Method and packet transmission system using error correction of data packets |
CN100499651C (en) * | 2004-12-24 | 2009-06-10 | 华为技术有限公司 | Method for protecting protection protocol of synchronous digital hierarchy |
CN1841255B (en) * | 2005-03-30 | 2011-09-07 | 侯方勇 | Method and apparatus for protecting confidentiality and integrity of data storage |
-
2008
- 2008-12-30 CN CN 200810241993 patent/CN101771495B/en not_active Expired - Fee Related
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110764942A (en) * | 2019-09-17 | 2020-02-07 | 平安银行股份有限公司 | Multi-type data checking method, device, computer system and readable storage medium |
CN110764942B (en) * | 2019-09-17 | 2023-08-18 | 平安银行股份有限公司 | Multi-kind data verification method, device, computer system and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN101771495B (en) | 2013-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108733314B (en) | Method, apparatus, and computer-readable storage medium for Redundant Array of Independent (RAID) reconstruction | |
CN107748702B (en) | A data recovery method and device | |
CN104052576B (en) | Data recovery method based on error correcting codes in cloud storage | |
CN102377521B (en) | Systems and methods for performing forward error correction | |
US8069392B1 (en) | Error correction code system and method | |
CN104935481B (en) | Data reconstruction method based on redundancy scheme under a kind of distributed storage | |
WO2021121352A1 (en) | Data transmission method and apparatus | |
US10073738B2 (en) | XF erasure code for distributed storage systems | |
EP3852275A1 (en) | Method, device and apparatus for storing data, computer readable storage medium | |
KR101023463B1 (en) | Method and apparatus for performing data error reporting | |
JP2011504269A (en) | Parallel Reed-Solomon RAID (RS-RAID) architecture, device, and method | |
TWI322348B (en) | Method and system for syndrome generation and data recovery | |
WO2022127289A1 (en) | Method and system for performing check recovery based on gaussian elimination, device, and medium | |
CN111124738A (en) | Data management method, device and computer program product for redundant array of independent disks | |
CN116501553B (en) | Data recovery method, device, system, electronic equipment and storage medium | |
CN101400043A (en) | Method and system for consistency comparison of front-background data in mobile communication system | |
US20240364455A1 (en) | Sending method, receiving method, apparatus, system, device, and storage medium | |
US12149352B2 (en) | OpenFEC error marking | |
US7257759B2 (en) | Accounting for error carryover in error correction on M-bit encoded links | |
CN111263250B (en) | Business data processing method and device | |
CN101771495A (en) | Data correction method and device | |
CN101848055A (en) | Method and device for correcting data | |
US9059735B2 (en) | Decoding method and decoding device | |
WO2021190031A1 (en) | Wdm-based data transmission method, apparatus, and system, and storage medium | |
CN102004799A (en) | Consistency check method for redundant data of database |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170822 Address after: 523710, No. 3, Ping Shi Road, Pingshan 188 Industrial Zone, Tangxia Town, Dongguan, Guangdong Patentee after: Dongguan Kailong silicone products Co. Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: Huawei Technologies Co., Ltd. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130417 Termination date: 20181230 |
|
CF01 | Termination of patent right due to non-payment of annual fee |