【正文】
t u = 0 u m in t m = tem p M em o ry . len g th 2 in t i = 0 i tempMemory [ 0 ]. getColumng etC o lu m n Dat a ( p ict u reI n co m p [] , in t )獲取該對(duì)象數(shù)組中每個(gè)元素第 i 列的數(shù)據(jù)并組成一個(gè)新的數(shù)組存放在 ( d atac ach e in t [][] ) 中并將該數(shù)據(jù)增加一列根據(jù)公式 ( 8 ) 得到水平校驗(yàn)數(shù)組 SH 根據(jù)公式 ( 9 ) 得到對(duì)角校驗(yàn)數(shù)組 SDK = ( m ( error 2 error 1 ) 1 )% mK != m 1dataCache [ k ][ error 2 ] = sd [( error 2 + k + m )% m ] ^ dataCache [( k + error 2 error 1 + m )% m ][ error 1 ] 。 tempMatrix2 = new int[tempMemory[0].getColumn()][tempMemory[0].getRow()]。 i 。 }else if((error1 = 0 amp。 dataCache = new int[tempMemory[0].getRow() + 1][]。 l++){ s = s ^ dataCache[(error1 l 1 + m)%m][l]。//修復(fù)數(shù)據(jù) /**恢復(fù)第 error2 個(gè) 數(shù)據(jù)塊 的數(shù)據(jù) */ corectObj = new pictureInComp[m]。 tempMemory[error2].read(temp)。 for(int i = 0 , j = 0。 tempMemory[error1].read(temp)。 }else if((error1 = 0 amp。 int[][] tempCache = new int[tempMemory[0].getRow()][m + 2]。 int k = 0。 u++){ for(int l = 0 。 l++){ if(l != error1 amp。 j 。amp。 error1 =0){//出錯(cuò) 數(shù)據(jù)塊 是水平校驗(yàn)位或者原數(shù)據(jù) for(int i = 0 ,j = 0。 tempMemory[error1].read(temp)。 }else{ ( error : fail to find the error disk !!)。因此后面的過程顯得相當(dāng)?shù)谋匾? 編碼功能接口流程圖 編碼功能接口的流程圖 如圖 5: 譯碼功能接口設(shè)計(jì) 譯 碼功能接口的實(shí)現(xiàn)與編碼功能類似,他們處理的對(duì)象都是圖片格式的。其中快捷鍵欄中的快捷按鈕功能在菜單欄中均能找到。注意:在執(zhí)行該功能之前一定要將 data data data data data5 的 5 個(gè)復(fù)選框選中,否則系統(tǒng)會(huì)提示你選擇復(fù)選框。其執(zhí)行后的效果圖如圖 11。在選擇文件后,圖片顯示如圖 10 所示: 圖 8 打開文件出錯(cuò)提示 圖 9 選擇文件對(duì)話框 圖 10 打開圖片顯示效 果 編碼 在對(duì)數(shù)據(jù)顯示域 data data data data data5都添加了數(shù)據(jù)后,我們就可以按照下列順序生成冗余校驗(yàn)圖片了。 在運(yùn)行該軟件時(shí)首先出現(xiàn)在用戶面前的是一個(gè)十分友好的用戶界面,如圖 7。這樣才能通過圖像表達(dá)功能顯示出與原數(shù)據(jù)大小相符的冗余圖像。 編碼功能接口設(shè)計(jì) 通過對(duì)“ EVENODD 編碼算法”的介紹我們可以知道,編碼算法的接口是一個(gè)pictureInComp 對(duì)象數(shù)組。 } (tempMatrix, temp)。 tempMatrix[i] = (dataCache)。//充當(dāng)數(shù)組轉(zhuǎn)置時(shí)的臨時(shí)變量 if(error1 1 amp。 (0)。 k = (k (error2 error1) + m) % m。 for(int l = 0 。 /**求 sh、 sd(公式 3 38) */ for(int u = 0 。 int[] sh = new int[m]。 error2 2)){//兩個(gè)原數(shù)據(jù) 塊 出錯(cuò) int m = 2。 } (tempMatrix2, temp)。 tempMatrix1[i] = (dataCache)。 /**修復(fù) 數(shù)據(jù)塊 error1*/ corectObj = new pictureInComp[m]。 tempMatrix2[i] = (dataCache)。 l++){ if(l != error1){ tempMatrix1[k][i] = tempMatrix1[k][i] ^ dataCache[(k + error1 l + m)%m][l]。 for(int l = 0 。 tempMatrix1 = new int[tempMemory[0].getRow()][tempMemory[0].getColumn()]。 (tempMatrix2, temp)。 //將正確的對(duì)象數(shù) 組拷貝到 correctObj 中 dataCache = new int[tempMemory[0].getRow()][]。 pictureInComp[] corectObj。 與 encode 算法思想一樣,我們同樣由待處理的 7 個(gè)不同對(duì)象( 5 個(gè)原數(shù)據(jù)塊, 2 個(gè)冗余校驗(yàn)數(shù)據(jù)塊),獲得最小數(shù)據(jù)單元,然后根據(jù) 譯碼 原理對(duì)最小數(shù)據(jù)單元進(jìn)行處理。 diagRedun = new pictureInComp(temp)。 for(int i = 0 。這個(gè)數(shù)組就是最小的處理單元。 3. 譯碼 該功能是在實(shí)際生活中運(yùn)用最廣的一部分,它通過尚未有數(shù)據(jù)損失的原始圖像和通過編碼形成的尚未遭到數(shù)據(jù)破壞的校驗(yàn)數(shù)據(jù)將已破壞的數(shù)據(jù)恢復(fù)出來(已破壞數(shù)據(jù)塊的數(shù)目≤2)。因此,圖像處理功能模塊又可以分成以下幾個(gè)子功能模塊,如:圖像載入、圖像保存、圖像破壞、圖像分割、圖像表達(dá)等。 第一步給 s 賦初值 s = (j i)1m 得到 s。因此所有的對(duì)角線都有相同的公共因子 S。我們將在后面的證明中很好地利用 m 是素?cái)?shù)的這個(gè)條件。 表 4 初始數(shù)據(jù) ? 0 ? 1 0 1 1 ? 1 ? 0 0 0 1 ? 1 ? 0 0 1 1 ? 1 ? 1 1 0 0 11 , 1 1 ,0( ) 4mmmi m i l llS a a?? ? ? ? ? ? ? ??? ? ? , 公 式 ( )1, 1 , 1 ,0( ) 0 2 5mmmk i i m k i l lllia S a a k m?? ? ? ? ? ? ? ???? ? ? ? ? ? ?, , 公 式 ( ),0 0 2 6mk i k lllka a k m??? ? ? ? ? , 公 式 ( )22, , 100( ) ( ) 7mml m l mllS a a?? ???? ? ? ? , 公 式 ( )( 0 ),0,1( 1 ), 1 ,0,8( ) 9mmu u lll i jmu u m u l lll i jSaS S a a???? ? ? ?????? ? ? ?, 公 式 ( ), 公 式 ( )( 1 )1,( 0 ), ( ) , , ,( 1 ) ( ) 1 0 0 1( 2 )( 3 ) ( ) 1 , 2mmm m ls j s j i i s i s s jjsmS e t s j i a n d a for l mLe t a a a n d a S aS e t s s j i if s m the n sto p e lse g o to ste pS?? ? ? ?? ? ?? ? ? ? ? ? ? ? ? ?? ? ? ?? ? ? ? ? ? ? 第一步要做的就是 找到公共因子 S,即將這個(gè)數(shù)組最后兩列相異或。 表 2 ( 6, 4)數(shù)組 ( 2) 在兩列 冗余校驗(yàn)中,其中有一列的冗余校驗(yàn)和參數(shù) S 進(jìn)行以后,參數(shù) S( m1,1) ,(m3,2),… (0,m1)可能是奇或偶,也是由于這個(gè)原因, 稱這類陣列碼為 EVENODD code。 4) 為了譯碼描述方便, EVENODD 碼增加一行信息位,數(shù)據(jù)全為 0。例如: 75 = 2, 25 = 3。它不僅可以糾正突發(fā)錯(cuò)誤 , 還可以糾正隨機(jī)錯(cuò)誤 , 特別適用于糾正信號(hào)的突發(fā)錯(cuò)誤。例如,假定信息位 X是兩個(gè)不同的組 C1 和 C2 兩個(gè)組的成員,在 C1 組超過 k 個(gè)信息位出錯(cuò),但是 C2 中少于 k個(gè)信息位出錯(cuò),那么 X可以通過 C2來恢復(fù)。所謂“冗余”指的是如果系統(tǒng)是無缺陷的,那么這些部件和算法是不需要的。越來越多的關(guān)鍵數(shù)據(jù)被存儲(chǔ)在計(jì)算機(jī)系統(tǒng)中,這些數(shù)據(jù)的丟失和損壞將對(duì)企業(yè)造成難以估量 的損失。本論文從 EVENODD 編碼原理出發(fā),詳細(xì)介紹了 EVENODD 的編碼和 譯碼 過程,以及從理論上對(duì)該譯碼的算法進(jìn)行了分析證明,同時(shí)使用 java編譯技術(shù)實(shí)現(xiàn)了該編碼過程的仿真。它已經(jīng)被廣泛應(yīng)用在 RAID( Redundant Arrays of Independent Disks)等技術(shù)中。 Java technology 目 錄 論文總頁數(shù): 31 頁 1 引言 .................................................................. 6 選題背景及意義 ...................................................... 6 相近課題研究 ....................................................... 6 2D奇偶校驗(yàn)編碼方案 ............................................. 6 糾雙錯(cuò) RS碼 ..................................................... 7 本課題要達(dá)到的設(shè)計(jì)目標(biāo) .............................................. 7 2 EVENODD碼 ............................................................. 7 預(yù)先定義 ........................................................... 7 編碼原理 ........................................................... 8 EVENODD碼譯碼算法 .................................................. 9 譯碼原理證明 ...................................................... 10 3 軟件設(shè)計(jì)與目標(biāo) ....................................................... 12 設(shè)計(jì)目標(biāo)及內(nèi)容 ..................................................... 12 軟件總體功能結(jié)構(gòu) ................................................... 12 功能結(jié)構(gòu)圖 ..................................................... 12 功能說明 ...................................................... 12 設(shè)計(jì)實(shí)現(xiàn)的策略及主要算法描述 ....................................... 13 VENODD編碼算法 ................................................ 13 EVENODD 譯碼算法 ............................................... 15 算法接口實(shí)現(xiàn) ...................................................... 25 編碼功能接口設(shè)計(jì) ............................................