CN101222597A - Method and apparatus for detecting/correcting errors - Google Patents
Method and apparatus for detecting/correcting errors Download PDFInfo
- Publication number
- CN101222597A CN101222597A CNA200710000893XA CN200710000893A CN101222597A CN 101222597 A CN101222597 A CN 101222597A CN A200710000893X A CNA200710000893X A CN A200710000893XA CN 200710000893 A CN200710000893 A CN 200710000893A CN 101222597 A CN101222597 A CN 101222597A
- Authority
- CN
- China
- Prior art keywords
- check code
- data
- equal
- replaces
- comparison module
- 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
- 238000000034 method Methods 0.000 title claims abstract description 94
- 230000015654 memory Effects 0.000 claims description 27
- 230000000052 comparative effect Effects 0.000 claims 20
- 238000001514 detection method Methods 0.000 description 22
- 238000004364 calculation method Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 238000003672 processing method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Landscapes
- Detection And Correction Of Errors (AREA)
Abstract
Description
技术领域 technical field
本发明涉及一种数据处理方法及数据处理装置,尤其涉及一种用于检测/更正错误的数据处理方法及数据处理装置。The present invention relates to a data processing method and a data processing device, in particular to a data processing method and a data processing device for detecting/correcting errors.
背景技术 Background technique
高分辨率多媒体接口(High-definition Multimedia Interface,HDMI)是一种近年来日渐普及的影音接口标准。该技术提供充足的频宽,能在单一缆线中将未经压缩的影音内容由来源装置(例如DVD放影机或数字电视盒)传送至高分辨率的播放装置(例如电视机或投影机)。一般而言,一条HDMI缆线就可以取代十至十二条的模拟传输缆线。因此,除了可容纳高质量的多媒体信号,HDMI还具有线路单纯的优点。High-definition Multimedia Interface (HDMI) is an audio-visual interface standard that has become increasingly popular in recent years. The technology provides sufficient bandwidth to transmit uncompressed audiovisual content from a source device (such as a DVD player or digital TV box) to a high-resolution playback device (such as a TV or projector) over a single cable . Generally speaking, one HDMI cable can replace ten to twelve analog transmission cables. Therefore, in addition to accommodating high-quality multimedia signals, HDMI also has the advantage of simple lines.
为了防止具有著作权的多媒体内容遭到未经授权的复制,有几家软件和硬件厂商针对HDMI规范共同推出了一种可搭配HDMI规范的版权保护协议-高频数字内容保护(High-bandwidth DigitalContent Protection,HDCP)。In order to prevent unauthorized copying of copyrighted multimedia content, several software and hardware manufacturers have jointly launched a copyright protection protocol that can be matched with the HDMI specification - High-bandwidth Digital Content Protection (High-bandwidth Digital Content Protection). , HDCP).
根据HDCP协议,无论是来源装置或播放装置,都必须各自具有一个HDCP密钥(secretdevice key)。这个密钥由40组56位的密码数组组成。在传送多媒体信号前,来源装置与播放装置首先交换彼此的密钥,并各自根据该密钥进行运算。若两者运算出来的结果相符,则该来源装置可判定该播放装置为合法的接收端。经过上述的确认程序之后,来源装置才会开始传送多媒体信号。换句话说,多媒体系统中的光驱、显示卡和显示器等各种装置都必须具有HDCP密钥,该多媒体系统才能正常地播放多媒体档案。若该多媒体系统中任一装置未内建HDCP密钥芯片,多媒体信号的质量可能会大幅降低,甚至不能被播放。According to the HDCP protocol, both the source device and the playback device must each have an HDCP key (secret device key). This key consists of 40 password arrays of 56 bits. Before transmitting the multimedia signal, the source device and the playback device first exchange keys with each other, and perform calculations based on the keys. If the calculated results of the two are consistent, the source device can determine that the playback device is a legitimate receiver. After the above confirmation process, the source device will start to transmit the multimedia signal. In other words, various devices such as optical drives, display cards, and monitors in the multimedia system must have HDCP keys, so that the multimedia system can play multimedia files normally. If any device in the multimedia system does not have a built-in HDCP key chip, the quality of the multimedia signal may be greatly reduced, or even cannot be played.
在现有的显示器中,HDCP密钥通常烧录于电子可抹除可程序化只读存储器(electrically erasable programmable read only memory,EEPROM)。使用者将显示器开机后,该显示器中的主要控制单元(master control unit,MCU)首先会由EEPROM将HDCP密钥读取出来,再将该HDCP密钥传送至后续的处理单元。In existing displays, the HDCP key is usually burned into an electrically erasable programmable read only memory (EEPROM). After the user turns on the display, the main control unit (MCU) in the display will first read the HDCP key from the EEPROM, and then send the HDCP key to the subsequent processing unit.
然而,除了HDCP密钥,显示器的EEPROM中通常还存放有使用者的数据和该显示器的某些设定值。由于MCU可能会频繁地读写该EEPROM,因此可能造成该EEPROM中的数据发生错误。一旦HDCP密钥有错误,则该显示器就无法正确地接收多媒体信号,并可能会显示出不正常的画面。However, in addition to the HDCP key, the display's EEPROM typically also stores user data and certain settings for the display. Because the MCU may frequently read and write the EEPROM, it may cause errors in the data in the EEPROM. Once the HDCP key is incorrect, the display cannot receive multimedia signals correctly and may display abnormal images.
在现有技术中,当使用者发现显示器的画面有异常现象时,并无法确切得知该异常现象是否因HDCP密钥有错误而导致。In the prior art, when a user finds an abnormal phenomenon on the screen of the display, it is impossible to know whether the abnormal phenomenon is caused by an error in the HDCP key.
发明内容 Contents of the invention
为解决上述问题,本发明提供一种用于检测/更正错误的方法及装置。根据本发明的错误检测/更正方法及装置可用于判断HDCP密钥是否有误,也可在HDCP密钥发生错误时尝试更正错误。如果该错误过于严重以致无法被更正,根据本发明的方法和装置可显示错误信息,以告知使用者HDCP密钥有误。To solve the above problems, the present invention provides a method and device for detecting/correcting errors. The error detection/correction method and device according to the present invention can be used to judge whether the HDCP key is wrong, and can also try to correct the error when the HDCP key is wrong. If the error is too severe to be corrected, the method and apparatus according to the present invention can display an error message to inform the user that the HDCP key is incorrect.
根据本发明,正确的HDCP密钥可被视为原始数据。在根据本发明的一个实施例中,该原始数据首先被复制为第一数据和第二数据。该第一数据和第二数据同时储存在一个存储器中或分别储存在两个不同的存储器中。最初,在未受破坏前,该第一数据与第二数据都等于该原始数据。经过一段时间之后,该第一数据和/或第二数据可能因存储器被频繁读写而受到破坏,也即与该原始数据有差异。According to the present invention, the correct HDCP key can be regarded as raw data. In an embodiment according to the present invention, the original data is firstly copied into first data and second data. The first data and the second data are simultaneously stored in one memory or respectively stored in two different memories. Initially, before being damaged, both the first data and the second data are equal to the original data. After a period of time, the first data and/or the second data may be damaged due to frequent reading and writing of the memory, that is, they are different from the original data.
此外,原始检查码预先根据该原始数据与算法产生。该原始检查码被复制为第一检查码和第三检查码。该第一检查码与第三检查码也被储存在上述的至少一个存储器中。同样地,在未受破坏前,该第一检查码与第三检查码都等于该原始检查码。经过一段时间之后,该第一检查码和/或第三检查码也可能因至少一个存储器被频繁读写而受到破坏,也即与该原始检查码有差异。In addition, the original checksum is generated in advance according to the original data and the algorithm. This original checksum is copied as a first checksum and a third checksum. The first check code and the third check code are also stored in the above at least one memory. Similarly, before being damaged, both the first checksum and the third checksum are equal to the original checksum. After a period of time, the first checksum and/or the third checksum may also be damaged due to frequent reading and writing of at least one memory, that is, they are different from the original checksum.
根据本发明的一个优选具体实施例为用于针对该第一数据与该第二数据的错误进行检测/更正的方法。该方法首先根据该第一数据与该算法产生第二检查码,并根据该第二数据与该算法产生第四检查码。接着,该方法比较该第一检查码与第二检查码,并比较该第三检查码与第四检查码。A preferred embodiment according to the present invention is a method for detecting/correcting errors of the first data and the second data. The method first generates a second check code according to the first data and the algorithm, and generates a fourth check code according to the second data and the algorithm. Next, the method compares the first check code with the second check code, and compares the third check code with the fourth check code.
理论上,若第一数据与第一检查码都未受到破坏,则第二检查码应与第一检查码相等。相同地,若第二数据与第三检查码都未受到破坏,则第四检查码应与第三检查码相等。因此,如果该第一检查码等于该第二检查码,并且该第三检查码等于该第四检查码,则该方法判定该第一数据与第二数据都无错误。Theoretically, if neither the first data nor the first checksum is damaged, the second checksum should be equal to the first checksum. Similarly, if neither the second data nor the third check code is damaged, the fourth check code should be equal to the third check code. Therefore, if the first check code is equal to the second check code, and the third check code is equal to the fourth check code, then the method determines that both the first data and the second data are error-free.
更进一步地,若该第一检查码等于第二检查码,并且该第三检查码不等于第四检查码,则该方法判定第一数据与第一检查码无错误。该第二数据和/或第三检查码则被判定为有错误。因此,该方法以该第一数据取代该第二数据,并以该第一检查码取代该第三检查码。Furthermore, if the first check code is equal to the second check code and the third check code is not equal to the fourth check code, then the method determines that there is no error between the first data and the first check code. The second data and/or the third check code are then determined to be erroneous. Therefore, the method replaces the second data with the first data, and replaces the third check code with the first check code.
相反地,如果该第一检查码不等于该第二检查码,并且该第三检查码等于第四检查码,则该方法以第二数据取代第一数据,并以该第三检查码取代该第一检查码。Conversely, if the first check code is not equal to the second check code and the third check code is equal to the fourth check code, the method replaces the first data with the second data and replaces the third check code with the third check code. First checksum.
此外,如果该第一检查码不等于该第二检查码,并且该第三检查码也不等于该第四检查码,则该方法可进一步比较该第二检查码与该第三检查码。若该第二检查码等于该第三检查码,则该方法判定该第一数据与第三检查码无错误,该第二数据与该第一检查码则被判定为有错误。因此,该方法以该第一数据取代该第二数据,并以该第三检查码取代该第一检查码。In addition, if the first check code is not equal to the second check code and the third check code is not equal to the fourth check code, the method may further compare the second check code with the third check code. If the second check code is equal to the third check code, the method determines that the first data and the third check code are correct, and the second data and the first check code are judged to have errors. Therefore, the method replaces the second data with the first data, and replaces the first check code with the third check code.
如果第二检查码也不等于该第三检查码,该方法可进一步判断该第一检查码是否等于该第四检查码。若该第一检查码等于该第四检查码,则该方法判定该第二数据与该第一检查码无错误。因此,该方法以该第二数据取代该第一数据,并以该第一检查码取代该第三检查码。此外,若该第一检查码不等于该第四检查码,该方法可显示错误信息,告知使用者该数据与检查码发生无法修复的错误。If the second check code is also not equal to the third check code, the method may further determine whether the first check code is equal to the fourth check code. If the first check code is equal to the fourth check code, the method determines that there is no error between the second data and the first check code. Therefore, the method replaces the first data with the second data, and replaces the third check code with the first check code. In addition, if the first checksum is not equal to the fourth checksum, the method may display an error message to inform the user that an irreparable error has occurred in the data and the checksum.
本发明的优点与精神可以通过以下的发明详述和所附附图得到进一步的了解。The advantages and spirit of the present invention can be further understood through the following detailed description of the invention and the accompanying drawings.
附图说明 Description of drawings
图1(A)和图1(B)示出了存储器在发生错误前后的情况。FIG. 1(A) and FIG. 1(B) show the condition of the memory before and after an error occurs.
图2(A)为根据本发明的第一优选具体实施例的错误检测/更正方法的流程图;图2(B)示出了由图2(A)的错误检测/更正方法延伸而来的一个实施例。Fig. 2 (A) is the flow chart of the error detection/correction method according to the first preferred embodiment of the present invention; Fig. 2 (B) has shown the error detection/correction method extended from Fig. 2 (A) an example.
图3(A)~(C)为根据本发明的第二优选具体实施例的错误检测/更正装置的方块图。3(A)-(C) are block diagrams of an error detection/correction device according to a second preferred embodiment of the present invention.
图4为根据本发明的第三优选具体实施例的错误检测/更正方法的流程图。Fig. 4 is a flowchart of an error detection/correction method according to a third preferred embodiment of the present invention.
图5为根据本发明的第四优选具体实施例的错误检测/更正装置的方块图。FIG. 5 is a block diagram of an error detection/correction apparatus according to a fourth preferred embodiment of the present invention.
具体实施方式 Detailed ways
本发明提供一种用于检测/更正错误的方法及装置。除了符合HDCP协议的多媒体系统,根据本发明的方法及装置也可应用于各种需防范数字数据发生错误的电子产品。为方便解释说明,以下的实施例主要以显示器的HDCP密钥为检测/更正错误的对象。The present invention provides a method and device for detecting/correcting errors. In addition to multimedia systems conforming to the HDCP protocol, the method and device according to the present invention can also be applied to various electronic products that need to prevent digital data errors. For the convenience of explanation, the following embodiments mainly use the HDCP key of the display as the object of error detection/correction.
根据本发明,显示器的HDCP密钥可被视为原始数据。原始检查码预先根据该原始数据与算法产生。在实际应用中,该原始检查码可以为原始数据的校验和(checksum)。例如,假设该原始数据包含十进制的1~9九个数字。这九个数字的总和为45。如本领域技术人员所熟知的,该原始数据的校验和即为5。According to the present invention, the HDCP key of the display can be regarded as raw data. The original check code is generated in advance according to the original data and the algorithm. In practical applications, the original check code may be a checksum (checksum) of the original data. For example, assume that the original data contains nine numbers from 1 to 9 in decimal. The sum of these nine numbers is 45. As is well known to those skilled in the art, the checksum of the original data is 5.
在根据本发明的一个实施例中,该原始数据首先被复制为第一数据和第二数据。该原始检查码则被复制为第一检查码和第三检查码。In an embodiment according to the present invention, the original data is firstly copied into first data and second data. The original checksum is copied as a first checksum and a third checksum.
某些显示器的主要控制单元包括闪存(flash memory)。该第一数据、第二数据、第一检查码与第三检查码可同时被储存在显示器的EEPROM中,也可同时被储存在主要控制单元的闪存中。此外,该第一数据、第二数据、第一检查码与第三检查码也可分别被储存在EEPROM和/或闪存的不同区域中。该第一数据、第二数据、第一检查码与第三检查码的存放位置可根据EEPROM与闪存中未被使用的存储器空间的大小来决定。The main control unit of some displays includes flash memory. The first data, the second data, the first check code and the third check code can be stored in the EEPROM of the display at the same time, and can also be stored in the flash memory of the main control unit at the same time. In addition, the first data, the second data, the first check code and the third check code may also be stored in different areas of the EEPROM and/or the flash memory. The storage positions of the first data, the second data, the first check code and the third check code can be determined according to the size of the unused memory space in the EEPROM and the flash memory.
上述的产生与储存该第一数据、第二数据、第一检查码以及第三检查码的程序,可在该显示器未出厂前,由制造厂中的自动化设备执行。The above-mentioned procedure of generating and storing the first data, the second data, the first check code and the third check code can be executed by the automation equipment in the factory before the display is shipped.
最初,在未受破坏前,该第一数据和第二数据都等于该原始数据。在该显示器出厂、被使用一段时间之后,该第一数据和/或第二数据可能因其所存放的存储器(EEPROM和/或闪存)被频繁读写而受到破坏,也即与该原始数据有差异。Initially, before being damaged, both the first data and the second data are equal to the original data. After the display is shipped from the factory and used for a period of time, the first data and/or second data may be damaged due to frequent reading and writing of the stored memory (EEPROM and/or flash memory), that is, it is different from the original data. difference.
同样地,在未受破坏前,该第一检查码和第三检查码都等于该原始检查码。经过一段时间之后,该第一检查码和/或第三检查码也可能因其所存放的存储器被频繁读写而受到破坏,也即与该原始检查码有差异。Likewise, before being damaged, both the first checksum and the third checksum are equal to the original checksum. After a period of time, the first check code and/or the third check code may also be damaged due to frequent reading and writing of the stored memory, that is, they are different from the original check code.
参阅图1。图1(A)与图1(B)所示出的实例分别为存储器10发生错误前后的情况。在该实例中,第一数据、第二数据、第一检查码与第三检查码分别储存在存储器10的储存区域11、12、13以及14中。该原始数据被假设为包含{1,2,3,4,5,6,7,8,9}九个数字。此外,本实例假设该原始检查码为该原始数据的校验和,因此该原始检查码为5。See Figure 1. The examples shown in FIG. 1(A) and FIG. 1(B) are respectively before and after an error occurs in the
如图1(A)所示,在存储器10中的数据未受到破坏前,第一数据和第二数据都等于该原始数据,并且第一检查码与第三检查码都等于该原始检查码。假设存储器10被大量读写后,储存区域11中的第一数据与储存区域14中的第三检查码分别受到破坏。如图1(B)所示,第一数据中原本的5变为3,第三检查码则由原本的5变为7。As shown in FIG. 1(A), before the data in the
根据本发明的第一优选具体实施例为用于针对该第一数据与该第二数据的错误进行检测/更正的方法。该方法可在该显示器每次被开机时执行。参阅图2(A),图2(A)示出了用于该错误检测/更正方法的流程图。A first preferred embodiment according to the present invention is a method for detecting/correcting errors of the first data and the second data. The method can be executed each time the display is turned on. Referring to FIG. 2(A), FIG. 2(A) shows a flowchart for the error detection/correction method.
该方法首先执行步骤S200,根据该第一数据与该算法产生第二检查码,并根据该第二数据与该算法产生第四检查码。在该实例中,算法即为计算该第一数据与第二数据各自的校验和。由于第一数据中{1,2,3,4,3,6,7,8,9}这九个数字的总和为43,因此,该第二检查码等于3。另一方面,第二数据中{1,2,3,4,5,6,7,8,9}这九个数字的总和为45,因此,该第四检查码等于5。在实际应用中,该算法当然可为其它用于产生错误检查码的算法。The method first executes step S200, generating a second check code according to the first data and the algorithm, and generating a fourth check code according to the second data and the algorithm. In this example, the algorithm is to calculate the respective checksums of the first data and the second data. Since the sum of the nine numbers {1, 2, 3, 4, 3, 6, 7, 8, 9} in the first data is 43, the second check code is equal to 3. On the other hand, the sum of the nine numbers {1, 2, 3, 4, 5, 6, 7, 8, 9} in the second data is 45, therefore, the fourth check code is equal to 5. In practical applications, the algorithm may of course be other algorithms for generating error checking codes.
接着,该方法执行步骤S201,比较该第一检查码与该第二检查码。如果步骤S201的判断结果为是,则该方法继续执行步骤S202,比较该第三检查码与该第四检查码。理论上,若第一数据与第一检查码都未受到破坏,第二检查码应与第一检查码相等。相同地,若第二数据与第三检查码都未受到破坏,第四检查码应与第三检查码相等。因此,如果步骤S202的判断结果也为是,则该方法在步骤S203中判定该第一数据与第二数据都无错误。Next, the method executes step S201, comparing the first check code with the second check code. If the judgment result of step S201 is yes, then the method continues to execute step S202 to compare the third check code with the fourth check code. Theoretically, if neither the first data nor the first checksum is damaged, the second checksum should be equal to the first checksum. Similarly, if neither the second data nor the third check code is damaged, the fourth check code should be equal to the third check code. Therefore, if the judgment result of step S202 is also yes, then the method judges in step S203 that both the first data and the second data are correct.
另一方面,如果步骤S202的判断结果为否,表示第二数据及/或第三检查码受到破坏。因此,如果步骤S202的判断结果为否,该方法将执行步骤S204,以第一数据取代第二数据,并以第一检查码取代第三检查码。On the other hand, if the determination result of step S202 is no, it means that the second data and/or the third check code are damaged. Therefore, if the judgment result of step S202 is negative, the method will execute step S204 to replace the second data with the first data, and replace the third check code with the first check code.
如图1(B)所示,在该实例中,该第一检查码仍等于5,也即未受到破坏。然而,由于第一数据有误,使得第二检查码为3。因此,步骤S201的判断结果为否。在实际应用中,如果步骤S201的判断结果为否,表示该第一数据和/或该第一检查码有错误。As shown in FIG. 1(B), in this example, the first checksum is still equal to 5, that is, it has not been damaged. However, the second checksum is 3 because the first data is wrong. Therefore, the determination result of step S201 is NO. In practical applications, if the determination result of step S201 is negative, it means that the first data and/or the first check code have errors.
接着,该方法继续执行步骤S205,比较该第三检查码与该第四检查码。如果步骤S205的判断结果为是,表示该第二数据和第三检查码无错误。因此,如果步骤S205的判断结果为是,该方法将继续执行步骤S206,以该第二数据取代该第一数据,并以该第三检查码取代该第一检查码。Next, the method continues to execute step S205, comparing the third check code with the fourth check code. If the judgment result of step S205 is yes, it means that the second data and the third check code are free of errors. Therefore, if the determination result of step S205 is yes, the method will continue to execute step S206 to replace the first data with the second data, and replace the first check code with the third check code.
在图1(B)所示的实例中,该第三检查码受到破坏,由5变为7。另一方面,由于第二数据没有错误,第四检查码与该原始检查码相等,也即等于5。因此步骤S205的判断结果为否。在实际应用中,如果步骤S205的判断结果为否,表示该第二数据和/或该第三检查码有错误。In the example shown in FIG. 1(B), the third checksum is destroyed, changing from 5 to 7. On the other hand, since the second data has no errors, the fourth checksum is equal to the original checksum, that is, equal to 5. Therefore, the determination result of step S205 is NO. In practical application, if the judgment result of step S205 is negative, it means that the second data and/or the third check code have errors.
若步骤S205的判断结果为否,该方法继续执行步骤S207,判断该第二检查码是否等于该第三检查码。如果步骤S207的判断结果为是,表示该第一数据与第三检查码无错误,该第二数据与该第一检查码则被判定为有错误。因此,如果步骤S207的判断结果为是,该方法将执行步骤S208,以该第一数据取代该第二数据,并以该第三检查码取代该第一检查码。If the judgment result of step S205 is negative, the method continues to execute step S207 to judge whether the second check code is equal to the third check code. If the determination result of step S207 is yes, it means that the first data and the third checksum are correct, and the second data and the first checksum are determined to have errors. Therefore, if the determination result of step S207 is yes, the method will execute step S208 to replace the second data with the first data, and replace the first check code with the third check code.
在图1(B)所示的实例中,第二检查码等于3,第三检查码等于7,两者并不相等。因此,步骤S207的判断结果为否。接着,该方法继续执行步骤S209,比较该第一检查码与该第四检查码。In the example shown in FIG. 1(B), the second check code is equal to 3, and the third check code is equal to 7, which are not equal. Therefore, the determination result of step S207 is NO. Next, the method continues to execute step S209, comparing the first check code with the fourth check code.
如果步骤S209的判断结果为是,表示该第二数据与该第一检查码无错误。该第一数据与第三检查码则被判定为有误。因此,该方法将执行步骤S210,以该第二数据取代该第一数据,并以该第一检查码取代该第三检查码。If the determination result of step S209 is yes, it means that there is no error between the second data and the first check code. The first data and the third check code are determined to be incorrect. Therefore, the method will execute step S210 to replace the first data with the second data, and replace the third check code with the first check code.
在图1(B)所示的实例中,第一检查码与第四检查码都等于5。因此,该方法将以储存区域12中的第二数据取代储存区域11中的第一数据,并以储存区域13中的第一检查码取代储存区域14中的第三检查码,由此达到更正错误的效果。经更正后,第一数据与第二数据都等于该原始数据,并且第一检查码与第三检查码都等于该原始检查码。In the example shown in FIG. 1(B), both the first check code and the fourth check code are equal to 5. Therefore, the method will replace the first data in the storage area 11 with the second data in the storage area 12, and replace the third check code in the storage area 14 with the first check code in the storage area 13, thereby achieving correction wrong effect. After correction, both the first data and the second data are equal to the original data, and both the first check code and the third check code are equal to the original check code.
如果步骤S209的判断结果为否,表示第一数据与第二数据都有误,或者是在储存区域11、12、13以及14这四个储存区域中,至少有三个储存区域发生错误。在这种情况下,该方法将执行步骤S211,显示错误信息,告知使用者该数据与检查码发生无法修复的错误。If the result of step S209 is negative, it means that both the first data and the second data are wrong, or at least three of the four storage areas 11 , 12 , 13 and 14 have errors. In this case, the method will execute step S211 to display an error message, informing the user that an irreparable error occurs in the data and the checksum.
参阅图2(B)。图2(B)示出了根据图2(A)的错误检测/更正方法延伸而来的一个实施例。该实施例与图2(A)所示的错误检测/更正方法的主要差别在于,图2(A)的步骤S204被图2(B)的步骤S204A~S204C所取代,并且图2(A)的步骤S206被图2(B)的步骤S206A~S206C所取代。See Figure 2(B). FIG. 2(B) shows an embodiment extended from the error detection/correction method in FIG. 2(A). The main difference between this embodiment and the error detection/correction method shown in FIG. 2(A) is that step S204 of FIG. 2(A) is replaced by steps S204A~S204C of FIG. Step S206 in FIG. 2(B) is replaced by steps S206A to S206C in FIG. 2(B).
如上所述,若步骤S202的判断结果为否,表示第二数据和/或第三检查码受到破坏。如图2(B)所示,若步骤S202的判断结果为否,该实施例执行步骤S204A,判断该第二检查码是否等于该第四检查码。如果步骤S204A的判断结果为是,表示该第二数据无错误,仅该第三检查码受到破坏。因此,如果步骤S204A的判断结果为是,该实施例继续执行步骤S204B,以该第一检查码取代该第三检查码。As mentioned above, if the determination result of step S202 is negative, it means that the second data and/or the third check code are damaged. As shown in FIG. 2(B), if the determination result of step S202 is negative, the embodiment executes step S204A to determine whether the second check code is equal to the fourth check code. If the determination result of step S204A is yes, it means that the second data has no error, and only the third checksum is damaged. Therefore, if the determination result of step S204A is yes, the embodiment continues to execute step S204B to replace the third check code with the first check code.
相反地,如果步骤S204A的判断结果为否,表示该第二数据受到破坏,该第三检查码则未必有误。因此,如果步骤S204A的判断结果为否,该实施例继续执行步骤S204C,以该第一数据取代该第二数据,并以该第一检查码取代该第三检查码。On the contrary, if the determination result of step S204A is no, it means that the second data is damaged, and the third check code may not be wrong. Therefore, if the determination result of step S204A is negative, the embodiment continues to execute step S204C to replace the second data with the first data, and replace the third check code with the first check code.
另一方面,如果步骤S205的判断结果为是,表示该第二数据和第三检查码无错误,而第一数据和/或第一检查码受到破坏。如图2(B)所示,若步骤S205的判断结果为是,该实施例执行步骤S206A,判断该第二检查码是否等于该第四检查码。如果步骤S206A的判断结果为是,表示该第一数据无错误,仅该第一检查码受到破坏。因此,如果步骤S206A的判断结果为是,该实施例继续执行步骤S206B,以该第三检查码取代该第一检查码。On the other hand, if the judgment result of step S205 is yes, it means that the second data and the third checksum are free of errors, but the first data and/or the first checksum are damaged. As shown in FIG. 2(B), if the determination result of step S205 is yes, the embodiment executes step S206A to determine whether the second check code is equal to the fourth check code. If the judgment result of step S206A is yes, it means that the first data has no error, and only the first checksum is damaged. Therefore, if the determination result of step S206A is yes, the embodiment continues to execute step S206B, replacing the first check code with the third check code.
相反地,如果步骤S206A的判断结果为否,表示该第一数据受到破坏,该第一检查码则未必有误。因此,如果步骤S206A的判断结果为否,该实施例继续执行步骤S206C,以该第二数据取代该第一数据,并以该第三检查码取代该第一检查码。On the contrary, if the determination result of step S206A is no, it means that the first data is damaged, and the first check code may not be wrong. Therefore, if the determination result of step S206A is negative, the embodiment continues to execute step S206C to replace the first data with the second data and replace the first check code with the third check code.
图2(A)与图2(B)所示出的错误检测/更正方法可在显示器每次被开机时执行,也可以固定周期每隔一段时间执行。该方法可用于判断HDCP密钥是否有误,也可在HDCP密钥发生错误时实时更正错误。如果该错误过于严重以致无法被更正,根据本发明的方法和装置可显示错误信息,以告知使用者HDCP密钥有误。The error detection/correction methods shown in FIG. 2(A) and FIG. 2(B) can be executed every time the display is turned on, or can be executed at regular intervals. The method can be used to judge whether the HDCP key is wrong, and can also correct the error in real time when the HDCP key is wrong. If the error is too severe to be corrected, the method and apparatus according to the present invention can display an error message to inform the user that the HDCP key is incorrect.
根据本发明的第二优选具体实施例为用于针对该第一数据与该第二数据的错误进行检测/更正的装置。参阅图3(A),图3(A)示出了该错误检测/更正装置的方块图。该错误检测/更正装置30包括计算模块31、第一比较模块32、以及判断模块33。错误检测/更正装置30可用于配合图1所示出的存储器10。A second preferred embodiment according to the present invention is an apparatus for detecting/correcting errors of the first data and the second data. Referring to FIG. 3(A), FIG. 3(A) shows a block diagram of the error detection/correction device. The error detection/
计算模块31用于根据该第一数据产生第二检查码,并根据该第二数据产生第四检查码。第一比较模块32用于比较该第一检查码与该第二检查码,并且比较该第三检查码与该第四检查码。如果第一比较模块32的比较结果显示该第一检查码等于该第二检查码,并且该第三检查码等于该第四检查码,则判断模块33判定该第一数据与该第二数据都等于该原始数据,也即该第一数据与该第二数据都无错误。The calculating
如果第一比较模块32的比较结果显示该第一检查码等于该第二检查码,并且该第三检查码不等于该第四检查码,则判断模块33以该第一数据取代该第二数据,并以该第一检查码取代该第三检查码。If the comparison result of the
另一方面,如果第一比较模块32的比较结果显示该第一检查码不等于该第二检查码,并且该第三检查码等于该第四检查码,则判断模块33以该第二数据取代该第一数据,并以该第三检查码取代该第一检查码。On the other hand, if the comparison result of the
参阅图3(B),该错误检测/更正装置30可进一步包括第二比较模块34和第三比较模块35。如果第一比较模块32的比较结果显示该第一检查码等于该第二检查码,并且该第三检查码不等于该第四检查码,则第二比较模块34比较该第二检查码与该第四检查码。如果第一比较模块32的比较结果显示该第一检查码不等于该第二检查码,并且该第三检查码等于该第四检查码,则第三比较模块35比较该第二检查码与该第四检查码。Referring to FIG. 3(B), the error detection/
如果第二比较模块34的比较结果显示该第二检查码等于该第四检查码,则判断模块33以该第一检查码取代该第三检查码。如果第二比较模块34的比较结果显示该第二检查码不等于该第四检查码,则判断模块33以该第一数据取代该第二数据,并以该第一检查码取代该第三检查码。If the comparison result of the
如果第三比较模块35的比较结果显示该第二检查码等于该第四检查码,则判断模块33以该第三检查码取代该第一检查码。如果第三比较模块35的比较结果显示该第二检查码不等于该第四检查码,则判断模块33以该第二数据取代该第一数据,并以该第三检查码取代该第一检查码。If the comparison result of the
在实际应用中,该错误检测/更正装置30也可如图3(C)所示,进一步包括第四比较模块36和第五比较模块37,以及显示模块38。In practical applications, the error detection/
如果第一比较模块32的比较结果显示该第一检查码不等于该第二检查码,并且该第三检查码不等于该第四检查码,则第四比较模块36比较该第二检查码与该第三检查码。如果第四比较模块36的比较结果显示该第二检查码等于该第三检查码,则判断模块33以该第一数据取代该第二数据,并以该第三检查码取代该第一检查码。If the comparison result of the
如果第四比较模块36的比较结果显示该第二检查码不等于该第三检查码,则第五比较模块37比较该第一检查码与该第四检查码。如果该第五比较模块37的比较结果显示该第一检查码等于该第四检查码,则判断模块33以该第二数据取代该第一数据,并以该第一检查码取代该第三检查码。If the comparison result of the
如果第五比较模块37的比较结果显示该第一检查码不等于该第四检查码,则显示模块38显示错误信息,告知使用者该数据与检查码发生无法修复的错误。If the comparison result of the
根据本发明的第三优选具体实施例也为用于针对该第一数据与该第二数据的错误进行检测/更正的方法。参阅图4,图4示出了该错误检测/更正方法的流程图。在该实施例中,原始数据首先被复制为第一数据和第二数据。原始检查码则被复制为第五检查码。最初,在未受破坏前,该第一数据与第二数据都等于该原始数据。同样地,在未受破坏前,该第五检查码等于该原始检查码。The third preferred embodiment according to the present invention is also a method for detecting/correcting errors of the first data and the second data. Referring to FIG. 4, FIG. 4 shows a flowchart of the error detection/correction method. In this embodiment, original data is first copied as first data and second data. The original checksum is copied as the fifth checksum. Initially, before being damaged, both the first data and the second data are equal to the original data. Likewise, before being damaged, the fifth checksum is equal to the original checksum.
在该实施例中,该方法首先执行步骤S400,根据该第一数据与该算法产生第六检查码,并根据该第二数据与该算法产生第七检查码。接着,该方法执行步骤S401,比较该第五检查码与该第六检查码。In this embodiment, the method first executes step S400, generating a sixth check code according to the first data and the algorithm, and generating a seventh check code according to the second data and the algorithm. Next, the method executes step S401, comparing the fifth check code with the sixth check code.
如果步骤S401的判断结果为是,表示该第一数据与该第五检查码无错误。接着,该方法执行步骤S402,比较该第五检查码与该第七检查码。如果步骤S402的判断结果也为是,表示该第二数据也未遭到破坏。因此,该方法在步骤S403中判定该第一数据与第二数据都无错误。If the determination result of step S401 is yes, it means that there is no error between the first data and the fifth check code. Next, the method executes step S402, comparing the fifth check code with the seventh check code. If the determination result of step S402 is also yes, it means that the second data has not been destroyed. Therefore, the method determines in step S403 that both the first data and the second data are correct.
相反地,如果步骤S402的判断结果为否,表示该第二数据有误。因此,如果步骤S402的判断结果为否,该方法接着执行步骤S404,以第一数据取代第二数据,以达到更正错误的效果。On the contrary, if the determination result of step S402 is no, it means that the second data is wrong. Therefore, if the judgment result of step S402 is negative, the method proceeds to step S404 to replace the second data with the first data, so as to correct the error.
如果步骤S401的判断结果为否,该方法则执行步骤S405,比较该第五检查码与该第七检查码。如果步骤S405的判断结果为是,该方法则执行步骤S406,以该第二数据取代该第一数据。If the determination result of step S401 is no, the method executes step S405 to compare the fifth check code with the seventh check code. If the determination result of step S405 is yes, the method executes step S406 to replace the first data with the second data.
另一方面,如果步骤S405的判断结果为否,该方法则执行步骤S407,判断该第六检查码是否等于该第七检查码。如果步骤S407的判断结果为是,表示该第一数据与第二数据都未受到破坏,但该第五检查码有错误。因此,如果步骤S407的判断结果为是,该方法执行步骤S408,以该第六检查码取代该第五检查码。On the other hand, if the judgment result of step S405 is negative, the method executes step S407 to judge whether the sixth check code is equal to the seventh check code. If the determination result of step S407 is yes, it means that the first data and the second data are not damaged, but the fifth checksum has an error. Therefore, if the determination result of step S407 is yes, the method proceeds to step S408 to replace the fifth check code with the sixth check code.
相反地,如果步骤S407的判断结果为否,表示第一数据、第二数据,以及第五检查码中的至少两个发生错误。在这种情况下,该方法将执行步骤S409,显示错误信息,告知使用者该数据与检查码发生无法修复的错误。On the contrary, if the determination result of step S407 is no, it means that at least two of the first data, the second data, and the fifth check code are wrong. In this case, the method will execute step S409 to display an error message, informing the user that an irreparable error has occurred in the data and the checksum.
根据本发明的第四优选具体实施例为用于错误检测/更正的装置。参阅图5,图5示出了该错误检测/更正装置的方块图。该错误检测/更正装置50包括计算模块51、第一比较模块52、判断模块53、第二比较模块54、以及显示模块55。在该实施例中,原始数据首先被复制为第一数据和第二数据。原始检查码则被复制为第五检查码。该第一数据、第二数据、以及第五检查码都储存在存储器60中。最初,在未受破坏前,该第一数据与第二数据都等于该原始数据。同样地,在未受破坏前,该第五检查码等于该原始检查码。A fourth preferred embodiment according to the invention is an apparatus for error detection/correction. Referring to FIG. 5, FIG. 5 shows a block diagram of the error detection/correction device. The error detection/correction device 50 includes a calculation module 51 , a first comparison module 52 , a judgment module 53 , a second comparison module 54 , and a display module 55 . In this embodiment, original data is first copied as first data and second data. The original checksum is copied as the fifth checksum. The first data, the second data, and the fifth check code are all stored in the memory 60 . Initially, before being damaged, both the first data and the second data are equal to the original data. Likewise, before being damaged, the fifth checksum is equal to the original checksum.
计算模块51用于根据该第一数据产生第六检查码,并根据该第二数据产生第七检查码。第一比较模块52用于比较该第五检查码与该第六检查码,并且比较该第五检查码与该第七检查码。如果第一比较模块52的比较结果显示该第五检查码等于该第六检查码,并且该第五检查码等于该第七检查码,则判断模块53判定该第一数据与该第二数据都等于该原始数据,也即该第一数据与该第二数据都无错误。The calculating module 51 is used for generating a sixth check code according to the first data, and generating a seventh check code according to the second data. The first comparison module 52 is used for comparing the fifth check code with the sixth check code, and comparing the fifth check code with the seventh check code. If the comparison result of the first comparison module 52 shows that the fifth check code is equal to the sixth check code, and the fifth check code is equal to the seventh check code, then the judging module 53 judges that the first data and the second data are both It is equal to the original data, that is, both the first data and the second data are error-free.
如果第一比较模块52的比较结果显示该第五检查码等于该第六检查码,并且该第五检查码不等于该第七检查码,则判断模块53以该第一数据取代该第二数据。如果第一比较模块52的比较结果显示该第五检查码不等于该第六检查码,并且该第五检查码等于该第七检查码,则判断模块53以该第二数据取代该第一数据。If the comparison result of the first comparison module 52 shows that the fifth check code is equal to the sixth check code, and the fifth check code is not equal to the seventh check code, then the judging module 53 replaces the second data with the first data . If the comparison result of the first comparison module 52 shows that the fifth check code is not equal to the sixth check code, and the fifth check code is equal to the seventh check code, then the judging module 53 replaces the first data with the second data .
如果第一比较模块52的比较结果显示该第五检查码不等于该第六检查码,并且该第五检查码不等于该第七检查码,则第二比较模块54比较该第六检查码与该第七检查码。如果第二比较模块54的比较结果显示该第六检查码等于该第七检查码,则判断模块53以该第六检查码取代该第五检查码。此外,如果第二比较模块54的比较结果显示该第六检查码不等于该第七检查码,则显示模块55显示错误信息,告知使用者该数据与检查码发生无法修复的错误。If the comparison result of the first comparison module 52 shows that the fifth check code is not equal to the sixth check code, and the fifth check code is not equal to the seventh check code, then the second comparison module 54 compares the sixth check code with The seventh checksum. If the comparison result of the second comparison module 54 shows that the sixth check code is equal to the seventh check code, the judging module 53 replaces the fifth check code with the sixth check code. In addition, if the comparison result of the second comparison module 54 shows that the sixth checksum is not equal to the seventh checksum, the display module 55 displays an error message to inform the user that an irreparable error occurs between the data and the checksum.
通过上述的判断机制,根据本发明的错误检测/更正方法和装置可判断储存在显示器中的HDCP密钥是否有误,也可在HDCP密钥发生错误时尝试更正错误。与已知技术相比,根据本发明的方法和装置不但可降低HDCP密钥错误达到无法修复的机率,也可在该错误过于严重以致无法被更正时,告知使用者HDCP密钥有误。Through the above judging mechanism, the error detection/correction method and device of the present invention can judge whether the HDCP key stored in the display is wrong, and can also try to correct the error when the HDCP key is wrong. Compared with the known technology, the method and device of the present invention can not only reduce the probability of irreparable HDCP key error, but also inform the user of HDCP key error when the error is too serious to be corrected.
除了符合HDCP协议的多媒体系统,根据本发明的方法和装置也可应用在各种需防范数字数据发生错误的电子产品中。In addition to multimedia systems conforming to the HDCP protocol, the method and device according to the present invention can also be applied to various electronic products that need to prevent digital data errors.
通过以上优选具体实施例的详述,希望能更加清楚描述本发明的特征与精神,而并非以上述所披露的优选具体实施例来对本发明的范围加以限制。相反地,其目的是希望能将各种改变和等同替换的方案涵盖在本发明所希望申请的权利要求范围内。Through the detailed description of the above preferred specific embodiments, it is hoped that the characteristics and spirit of the present invention can be described more clearly, rather than the scope of the present invention is limited by the preferred specific embodiments disclosed above. On the contrary, the intention is to cover various changes and equivalent replacements within the scope of the claims of the present invention.
主要组件符号说明Explanation of main component symbols
10:存储器 11、12、13、14:储存区域10: Storage 11, 12, 13, 14: Storage area
S200~S211:流程步骤 S204A~S204C:流程步骤S200~S211: Process steps S204A~S204C: Process steps
S206A~S206C:流程步骤 30、50:错误检测/更正装置S206A~S206C: process steps 30, 50: error detection/correction device
31、51:计算模块 32、52:第一比较模块31, 51:
33、53:判断模块 34、54:第二比较模块33, 53:
35:第三比较模块 36:第四比较模块35: The third comparison module 36: The fourth comparison module
37:第五比较模块 38、55:显示模块37:
S400~S409:流程步骤 60:存储器S400~S409: Process steps 60: Storage
Claims (25)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA200710000893XA CN101222597A (en) | 2007-01-12 | 2007-01-12 | Method and apparatus for detecting/correcting errors |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA200710000893XA CN101222597A (en) | 2007-01-12 | 2007-01-12 | Method and apparatus for detecting/correcting errors |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN101222597A true CN101222597A (en) | 2008-07-16 |
Family
ID=39632147
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNA200710000893XA Pending CN101222597A (en) | 2007-01-12 | 2007-01-12 | Method and apparatus for detecting/correcting errors |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101222597A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104537089A (en) * | 2015-01-05 | 2015-04-22 | 北京数码大方科技股份有限公司 | Method and device for detecting reliability of label data in computer aided design |
| CN108804952A (en) * | 2018-05-29 | 2018-11-13 | 郑州云海信息技术有限公司 | A kind of server start-up control device and control method |
-
2007
- 2007-01-12 CN CNA200710000893XA patent/CN101222597A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104537089A (en) * | 2015-01-05 | 2015-04-22 | 北京数码大方科技股份有限公司 | Method and device for detecting reliability of label data in computer aided design |
| CN104537089B (en) * | 2015-01-05 | 2018-03-30 | 北京数码大方科技股份有限公司 | Labeled data reliability checking method and device in CAD |
| CN108804952A (en) * | 2018-05-29 | 2018-11-13 | 郑州云海信息技术有限公司 | A kind of server start-up control device and control method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20090027554A1 (en) | Video apparatus and method for recognizing digital interface thereof | |
| US8363164B2 (en) | Apparatus and method for outputting image using a plurality of chroma-key colors | |
| TW201503153A (en) | Flash memory apparatus, memory controller and method for controlling flash memory | |
| US7613982B2 (en) | Data processing apparatus and method for flash memory | |
| JPH03248251A (en) | Information processor | |
| US7243291B1 (en) | System and method for communicating image data using error correction coding | |
| CN1637839A (en) | Display apparatus | |
| JP4819843B2 (en) | ECC code generation method for memory device | |
| CN111052089B (en) | Data protection | |
| US20080263429A1 (en) | Method and Device for Correcting Code Data Error | |
| CN108694339A (en) | Signal switching device and signal switching method | |
| KR20160050296A (en) | Electronic apparatus and controlling method thereof | |
| CN101222597A (en) | Method and apparatus for detecting/correcting errors | |
| KR100662464B1 (en) | Multimedia terminal | |
| US20100095188A1 (en) | Apparatus and method for detecting and correcting errors in control characters of a multimedia interface | |
| KR100450320B1 (en) | Method/Module of Digital TV image signal processing with Auto Error Correction | |
| EP1459536B1 (en) | Data coding | |
| CN118502792A (en) | Electronic product and memory firmware updating method thereof | |
| US8166378B2 (en) | Encoding circuit and encoding method correcting EDC generated from main data according to header | |
| US10606520B2 (en) | Methods and apparatus to read from a nonvolatile memory device | |
| JP2007299222A (en) | Data update method, data update program, and information terminal apparatus using them | |
| US20120216050A1 (en) | Microcode authentication | |
| US20040230864A1 (en) | Checksum writing method and checksum checking apparatus | |
| CN113051544A (en) | External device and verification updating method thereof | |
| KR20220086839A (en) | Programming control system and method of otp memory |
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 |
Open date: 20080716 |