TWI687803B - Computer system and fault tolerance processing method of image file - Google Patents

Computer system and fault tolerance processing method of image file Download PDF

Info

Publication number
TWI687803B
TWI687803B TW107124640A TW107124640A TWI687803B TW I687803 B TWI687803 B TW I687803B TW 107124640 A TW107124640 A TW 107124640A TW 107124640 A TW107124640 A TW 107124640A TW I687803 B TWI687803 B TW I687803B
Authority
TW
Taiwan
Prior art keywords
image file
image
cut
cutting
size
Prior art date
Application number
TW107124640A
Other languages
Chinese (zh)
Other versions
TW202006543A (en
Inventor
陳冠儒
Original Assignee
宏碁股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW107124640A priority Critical patent/TWI687803B/en
Priority to US16/252,742 priority patent/US11468094B2/en
Publication of TW202006543A publication Critical patent/TW202006543A/en
Application granted granted Critical
Publication of TWI687803B publication Critical patent/TWI687803B/en

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A computer system and a fault tolerance processing method of image file are provided. In the method, whether to divide image file(s) is determined. The image file is segment-divided in order and a division history is recorded. The division history relates to a last dividing number, which is accumulated whenever the image file is divided once. In response to a division exception situation, the division of the image file could be continued according to the division history. In addition, image segment files are segment-recovered in order and a recovery history is recorded. The recovery history relates to a last recovering number, which is accumulated whenever one image segment file is recovered. In response to a recovery exception situation, the recovery of the image segment files could be continued according to the recovery history.

Description

電腦系統及映像檔之容錯處理方法Computer system and fault-tolerant processing method of image file

本發明是有關於一種映像檔之處理方法,且特別是有關於一種電腦系統及映像檔之容錯處理方法。 The invention relates to a method for processing image files, and in particular to a computer system and a method for processing fault tolerance of image files.

電腦系統(例如,桌上型電腦、筆記型電腦、一體機(All-in-One,AIO)等)已經是人們在工作、娛樂、休閒甚至日常生活上常用的工具之一。無可避免地,電腦系統可能會遭遇到系統錯誤、更新失敗、驅動程式衝突、惡意程式攻擊等異常情況。部分使用者會將電腦系統中的作業系統(Operating System,OS)、硬碟磁區或檔案還原,以將電腦系統回復到先前正常狀態。然而,電腦系統的還原作業並非能百分之百成功,偶爾還是會遇到作業系統本身問題、硬體相關問題、或是使用者操作不當(例如,使用者踢到電腦系統的電源、電池失去電力等情形導致還原中斷)。而由於目前尚未有還原補救方法,當使用者遇到還原失敗時,通常 還是會將其設備交由維修中心處理。然而,還原失敗的修復流程複雜,導致維修費用昂貴,且電腦系統亦可能無法修復而需要退貨。 Computer systems (for example, desktop computers, notebook computers, All-in-One (AIO), etc.) are already one of the tools commonly used by people in work, entertainment, leisure, and even daily life. Inevitably, the computer system may encounter abnormal conditions such as system errors, update failures, driver conflicts, and malware attacks. Some users will restore the operating system (Operating System, OS), hard disk volume, or files in the computer system to restore the computer system to its previous normal state. However, the recovery operation of the computer system is not 100% successful. Occasionally, the operating system itself, hardware-related problems, or user improper operation (for example, the user kicks the computer system power supply, the battery loses power, etc.) Cause the restore to be interrupted). And because there is no recovery remedy at present, when the user encounters the recovery failure, usually The equipment will still be handed over to the repair center. However, the repair process for restoration failure is complicated, which leads to expensive repair costs, and the computer system may not be repaired and needs to be returned.

有鑑於此,本發明提供一種電腦系統及映像檔之容錯處理方法,其不論電腦系統是否發生異常,能確保映像檔切割成映像散檔後,分段還原映像散檔,從而提升映像檔還原的效率及成功率。 In view of this, the present invention provides a computer system and a fault-tolerant processing method of an image file, which can ensure that the image file is segmented to restore the image file after the image file is cut into image files, regardless of whether the computer system is abnormal or not, thereby improving the image file recovery Efficiency and success rate.

本發明映像檔之容錯處理方法,其包括下列步驟。判斷是否切割映像檔。若決定對映像檔切割,則依序分段切割映像檔並記錄切割歷程。而此切割歷程相關於最後切割個數,此最後切割個數是每映像檔切割一次而累計。此外,反應於切割異常情況,依據切割歷程接續切割映像檔。 The fault-tolerant processing method of the image file of the present invention includes the following steps. Determine whether to cut the image file. If it is decided to cut the image file, the image file is cut sequentially and the cutting history is recorded. The cutting process is related to the number of last cuts. The number of last cuts is accumulated once per image file. In addition, in response to the abnormal cutting situation, the cutting image file is continued according to the cutting process.

本發明的電腦系統,其包括儲存器及處理器。儲存器記錄映像檔及數個模組。處理器耦接儲存器,並存取且載入儲存器所記錄的那些模組。而那些模組包括分割模組。此分割模組判斷是否切割映像檔。若決定映像檔切割,則分割模組依序分段切割映像檔並記錄切割歷程。反應於切割異常情況,分割模組依據此切割歷程接續切割映像檔。而此切割歷程相關於最後切割個數,且此最後切割個數是每對映像檔切割一次而累計。 The computer system of the present invention includes a storage and a processor. The storage records image files and several modules. The processor is coupled to the memory, and accesses and loads those modules recorded in the memory. And those modules include segmentation modules. This segmentation module determines whether to cut the image file. If it is decided to cut the image file, the segmentation module sequentially cuts the image file in segments and records the cutting history. In response to the abnormal cutting situation, the segmentation module continues to cut the image file according to the cutting process. The cutting process is related to the last cutting number, and the last cutting number is accumulated once for each pair of image files.

基於上述,本發明實施例的電腦系統及映像檔之容錯處 理方法,其在對映像檔還原之前,將映像檔切割成數筆映像散檔或確認為映像散檔。在切割的過程中,電腦系統會記錄切割歷程,使切割異常情況發生後,仍可接續切割作業。另一方面,本發明實施例是對映像散檔分段還原,若還原過程中電腦系統不幸發生任何還原異常情況,電腦系統都能接續還原。相較於對單一映像檔還原,當本發明實施例的容錯機制遭遇到任何異常情況時,還原作業都不用重頭開始,明顯提升效率及成功率,讓大眾都能輕易應付異常情況。 Based on the above, the fault tolerance of the computer system and the image file according to the embodiment of the invention The method is to cut the image file into several image files or confirm it as an image file before restoring the image file. During the cutting process, the computer system will record the cutting process, so that the cutting operation can still be continued after abnormal cutting occurs. On the other hand, the embodiment of the present invention is to restore the image bulk in stages. If any abnormality in the computer system unfortunately occurs during the restoration process, the computer system can continue the restoration. Compared with restoring a single image file, when the fault tolerance mechanism of the embodiment of the present invention encounters any abnormal situation, the restoration operation does not need to be restarted, which significantly improves efficiency and success rate, so that the public can easily cope with the abnormal situation.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 In order to make the above-mentioned features and advantages of the present invention more obvious and understandable, the embodiments are specifically described below in conjunction with the accompanying drawings for detailed description as follows.

1:電腦系統 1: Computer system

110:儲存器 110: storage

111:還原介面模組 111: Restore interface module

112:分割模組 112: Split module

113:分段還原模組 113: Segmented Restore Module

114:日誌 114: Log

115:計數器 115: counter

S210~S250、S310~S350:步驟 S210~S250, S310~S350: Steps

圖1是依據本發明一實施例之電腦系統的元件方塊圖。 FIG. 1 is a block diagram of components of a computer system according to an embodiment of the invention.

圖2是依據本發明一實施例映像檔之容錯處理方法-切割階段的流程圖。 FIG. 2 is a flowchart of a cutting-out stage of a fault-tolerant processing method for image files according to an embodiment of the present invention.

圖3是依據本發明一實施例映像檔之容錯處理方法-還原階段的流程圖。 FIG. 3 is a flowchart of the restoration process of the image file fault-tolerant processing method according to an embodiment of the present invention.

圖1是依據本發明一實施例之電腦系統1的元件方塊圖。請參照圖1,電腦系統1至少包括但不僅限於儲存器110及處 理器150。此電腦系統1可以是桌上型電腦、筆記型電腦、伺服器、一體機(All-in-One,AIO)、智慧型手機、平板電腦等電子裝置。 FIG. 1 is a block diagram of components of a computer system 1 according to an embodiment of the invention. Please refer to FIG. 1, the computer system 1 includes at least but not limited to the storage 110 and its location 理器150。 150. The computer system 1 may be an electronic device such as a desktop computer, a notebook computer, a server, an All-in-One (AIO), a smart phone, and a tablet computer.

儲存器110可以是任何型態的固定或可移動隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash Memory)或類似元件或上述元件之組合的儲存器,儲存器110並用於儲存緩衝的或永久的資料、軟體模組(還原介面模組111、分割模組112、分段還原模組113、計數器115等)、日誌114、映像檔、映像散檔、切割歷程、分段還原歷程等資料,且其詳細內容待後續實施例詳述。 The memory 110 may be any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory (Flash memory), or the like Or a combination of the above components, the storage 110 is used to store buffered or permanent data, software modules (restore interface module 111, partition module 112, segment restore module 113, counter 115, etc.), logs 114. Image files, image files, cutting history, segmented restoration history and other data, and the detailed content thereof will be described in detail in subsequent embodiments.

處理器150與儲存器110耦接,並可以是中央處理單元(CPU),或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位信號處理器(DSP)、可程式化控制器、特殊應用積體電路(ASIC)或其他類似元件或上述元件的組合。在本發明實施例中,處理器150用以執行電腦系統1的所有作業,且可載入並執行(例如,透過應用程式介面(Application Programming Interface,API)或函數呼叫等方式)儲存器110所記錄的各軟體模組、檔案及資料。 The processor 150 is coupled to the storage 110, and may be a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor (Microprocessor), digital signal processor (DSP), programmable Controller, application specific integrated circuit (ASIC) or other similar components or a combination of the above components. In the embodiment of the present invention, the processor 150 is used to execute all operations of the computer system 1, and can be loaded and executed (for example, through an application programming interface (API) or function call, etc.) in the storage 110 Recorded software modules, files and data.

為了方便理解本發明實施例的操作流程,以下將舉諸多實施例詳細說明本發明實施例中電腦系統1對映像檔的處理流程。下文中,將搭配電腦系統1的各項元件及模組說明本發明實施例所述之方法。本方法的各個流程可依照實施情形而隨之調整,且並不僅限於此。 In order to facilitate understanding of the operation flow of the embodiment of the present invention, a number of embodiments will be given below to describe in detail the processing flow of the image file by the computer system 1 in the embodiment of the present invention. In the following, the methods described in the embodiments of the present invention will be described with various components and modules of the computer system 1. The various processes of the method can be adjusted according to the implementation situation, and it is not limited to this.

圖2是依據本發明一實施例說明映像檔之容錯處理方法-分割階段之流程圖。請參照圖2,還原介面模組111透過電腦系統1的顯示器(例如,液晶顯示器(LCD)、發光二極體(LED)顯示器等)呈現還原介面。此還原介面例如是整合於作業系統(Operating System,OS)(例如,Windows、Mac OS、Linux等)的還原功能、或屬於獨立的應用程式,並提供諸如還原啟動及中止操作接收、資訊呈現等功能。而當還原介面模組111透過輸入裝置(例如,鍵盤、滑鼠、觸控螢幕等)接收使用者對於還原介面上還原啟動的操作時,還原介面模組111即觸發本發明實施例的容錯機制。 FIG. 2 is a flowchart illustrating a fault-tolerant processing method of image file-segmentation stage according to an embodiment of the invention. Referring to FIG. 2, the restoration interface module 111 presents the restoration interface through the display of the computer system 1 (for example, a liquid crystal display (LCD), a light emitting diode (LED) display, etc.). The restoration interface is, for example, a restoration function integrated into an operating system (OS) (for example, Windows, Mac OS, Linux, etc.), or belongs to an independent application, and provides such as restoration startup and suspension operation reception, information presentation, etc. Features. When the restoration interface module 111 receives the user's operation of restoration activation on the restoration interface through the input device (for example, keyboard, mouse, touch screen, etc.), the restoration interface module 111 triggers the fault tolerance mechanism of the embodiment of the present invention .

此容錯機制會與作業系統的還原功能與硬碟裡的還原分區(partition)進行存取及訊息傳遞。具體而言,處理器150會把啟動載入器(bootloader)及其他系統啟動相關檔案(例如,啟動組態資料(Boot Configuration Data,BCD)檔案、啟動管理器等)複製到儲存器110的還原分區(即,儲存用於還原之映像檔的分區),並指示重新開機後進入此還原分區,且記錄系統啟動相關檔案的儲存路徑。需說明的是,在其他實施例中,這些系統啟動相關檔案亦可能儲存在儲存器110的其他分區中,只要這些檔案的儲存路徑被記錄並可供存取即可。 This fault-tolerant mechanism will access and communicate with the recovery function of the operating system and the recovery partition in the hard disk. Specifically, the processor 150 will copy the bootloader (bootloader) and other system startup related files (for example, boot configuration data (Boot Configuration Data, BCD) files, boot manager, etc.) to the restore of the storage 110 Partition (that is, the partition that stores the image file for restoration), and instructs to enter this restoration partition after rebooting, and records the storage path of the system startup related files. It should be noted that in other embodiments, these system startup related files may also be stored in other partitions of the storage 110, as long as the storage paths of these files are recorded and available for access.

接著,分割模組112會檢查用於還原的映像檔的型態是否為單一映像檔,以判斷是否切割映像檔(步驟S210)。值得注意的是,單一映像檔是由數個映像散檔所組成。而為了使本發明實施例的容錯機制能順利分段運行,後續用於還原的映像檔需要先 切割成映像散檔。換句而言,分割模組112是檢查儲存器110所儲存的映像檔是否為映像散檔。於本實施例中,分割模組112依據儲存器110所儲存的映像檔的數量、名稱關係及大小中的至少一者判斷這些映像檔是否為映像散檔。例如,分割模組112依序判斷這些映像檔的數量是否超過一個,判斷其名稱關係是否有順序關係(例如,數字順序(例如,結尾為111、112、113…)、字母順序(例如,結尾為a、b、c…)關係等),並判斷各映像檔的檔案大小是否小於或等於最大散檔值(例如,50、60、100百萬位元組(megabyte,MB)等)。只要映像檔的數量、名稱關係及大小不符合上述的任一條件,分割模組112即判斷映像檔不為映像散檔(可能是單一映像檔、大小不一致的映像散檔),並決定對映像檔切割。 Next, the segmentation module 112 checks whether the type of the image file used for restoration is a single image file to determine whether to cut the image file (step S210). It is worth noting that a single image file is composed of several image files. In order for the fault-tolerance mechanism of the embodiment of the present invention to run smoothly in stages, the subsequent image files for restoration need to be Cut into image files. In other words, the segmentation module 112 checks whether the image file stored in the storage 110 is an image file. In this embodiment, the segmentation module 112 determines whether these image files are image bulk files according to at least one of the number, name relationship, and size of the image files stored in the storage 110. For example, the segmentation module 112 sequentially determines whether the number of these image files exceeds one, whether the name relationship has a sequential relationship (for example, numerical order (for example, ending in 111, 112, 113...), and alphabetical order (for example, for ending (A, b, c...) relationship, etc.), and determine whether the file size of each image file is less than or equal to the maximum bulk value (for example, 50, 60, 100 megabytes (MB), etc.). As long as the number, name relationship and size of the image files do not meet any of the above conditions, the segmentation module 112 determines that the image file is not an image file (may be a single image file, an image file with an inconsistent size) and decides on the image File cutting.

需說明的是,前述數量、名稱關係及大小都是依據一般映像檔分割程式對於映像散檔的設定規則,然不同映像檔分割程式還可能有其他設定規則,本發明實施例不以前述設定規則為限,並可視其他映像檔分割程式的設定規則而調整。此外,判斷數量、名稱關係及大小的順序不限於前述範例,應用者可視需求而自行調整或增減條件。 It should be noted that the aforementioned number, name relationship and size are based on the general image file splitting program's setting rules for image bulk, but different image file splitting programs may also have other setting rules. The embodiments of the present invention do not use the aforementioned setting rules To limit, and can be adjusted according to the setting rules of other image file division programs. In addition, the order of judging the number, the relationship of names and the size is not limited to the foregoing examples, and the users can adjust or increase or decrease the conditions according to their needs.

而當決定對映像檔切割時,分割模組112可壓縮(shrink)儲存器110中還原分區的剩餘空間,以供後續切割所得之映像散檔儲存。需說明的是,於其他實施例中,分割模組112亦可先判斷剩餘空間是否大於或等於映像檔的大小;若符合條件,則分割模組112可省略壓縮空間的步驟,也就是還原分區可供尚未切割 的映像檔與切割所得之映像散檔儲存(大概是映像檔大小的兩倍);反之,分割模組112才需要壓縮空間。 When it is decided to cut the image file, the partitioning module 112 can shrink the remaining space of the restored partition in the storage 110 to store the image bulk file obtained by subsequent cutting. It should be noted that, in other embodiments, the partition module 112 may also first determine whether the remaining space is greater than or equal to the size of the image file; if the conditions are met, the partition module 112 may omit the step of compressing the space, that is, restore the partition Available for not yet cut The image file and the resulting image image are stored in bulk (approximately twice the size of the image file); otherwise, the segmentation module 112 requires compressed space.

例如,表(1)是一範例說明磁碟分區。供還原所用之映像檔儲存的還原分區通常規劃在最後一個磁碟分區(第五分區)(分區啟動記錄(Partition boot record,PBR)還可能記錄降版還原分區(downgrade right recovery partition))。視情況需要,處理器150會透過壓縮功能加大還原分區的空間,以利用未使用的磁碟空間。 For example, Table (1) is an example of disk partitions. The recovery partition for image files used for restoration is usually planned on the last disk partition (fifth partition) (Partition boot record (PBR) may also record downgrade right recovery partition). If necessary, the processor 150 will increase the space of the recovery partition through the compression function to use unused disk space.

Figure 107124640-A0305-02-0009-1
Figure 107124640-A0305-02-0009-1

若儲存器110、還原分區或其他磁碟分區具有足夠空間儲存切割所得之映像散檔,則分割模組112會執行依序分段切割映 像檔並記錄切割歷程(步驟S230)。具體而言,在檔案切割過程中,處理器150會透過計數器115記錄目前切割到哪個映像散檔,其中每對映像檔切割一次,計數器115會累計最後切割個數。例如,分割模組112切割第三次,則計數器115記錄最後切割個數為三個。分割模組112會將此最後切割個數作為切割歷程,並將此切割歷程記錄於日誌114中。此外,分割模組112還會將映像檔儲存在儲存器110的起始位址寫入日誌114。 If the storage 110, the recovery partition, or other disk partitions have enough space to store the cut image bins, the split module 112 will perform a sequential split map Image file and record the cutting history (step S230). Specifically, during the file cutting process, the processor 150 will record through the counter 115 which image partition is currently cut, where the counter 115 will accumulate the last number of cuts for each pair of image files. For example, if the dividing module 112 cuts for the third time, the counter 115 records the number of the last cut as three. The segmentation module 112 will use this last number of cuts as the cutting history, and record the cutting history in the log 114. In addition, the segmentation module 112 also writes the image file to the log 114 at the starting address of the storage 110.

接著,反應於切割異常情況(例如,OS或程式發出失敗異常(fail exception)、電源中斷等),分割模組112可依據切割歷程接續切割映像檔(步驟S250)。於本實施例中,分割模組112會基於日誌114所記錄的最後切割個數及映像檔的起始位址(磁碟中的實體位址)決定接續切割位址。此接續切割位址是基於公式1:SA=IMG_Init_Address+[Counter*(ImageTotalSize/DF)]*1024*1024*8...(1)SA是接續切割位址,IMG_Init_Address是映像檔的實體起始位址,Counter是最後切割個數,ImageTotalSize是映像檔的大小,DF是切割總數(即,映像檔被切割的總數)。分割模組112即可依據此接續切割位址切割尚未切割的映像檔。 Then, in response to the abnormal cutting situation (for example, a failure exception issued by the OS or the program, a power interruption, etc.), the segmentation module 112 may continue to cut the image file according to the cutting process (step S250). In this embodiment, the dividing module 112 will determine the subsequent cutting address based on the last number of cuts recorded in the log 114 and the starting address of the image file (physical address in the disk). This continuous cutting address is based on formula 1: SA=IMG_Init_Address+[Counter*(ImageTotalSize/DF)]*1024*1024*8... (1) SA is the continuous cutting address, and IMG_Init_Address is the physical start bit of the image file Address, Counter is the last number of cuts, ImageTotalSize is the size of the image file, DF is the total number of cuts (ie, the total number of image files being cut). The dividing module 112 can cut the uncut image file according to the continuous cutting address.

假設映像檔的起始位址為2500,映像檔的大小為10十億位元組(Gigabytes,GBs),切割總數為200,切割到第85個檔案時流程出現中止(即,最後切割個數為85)。分割模組112帶入公式1,2500+[85*(10000MB/200)]*1024*1024*8,從而得知下次要從實體 位址35651586500開始進行映像檔切割。 Assume that the starting address of the image file is 2500, the size of the image file is 10 gigabytes (Gigabytes, GBs), the total number of cuts is 200, and the process is aborted when cutting to the 85th file (ie, the last number of cuts) Is 85). The segmentation module 112 brings the formula 1, 2500+[85*(10000MB/200)]*1024*1024*8, so as to know the next time from the entity The address 35651586500 starts image file cutting.

由於本發明實施例是採用分段切割方式,因此切割異常情況發生之後,分割模組112只要接續對切割異常情況發生當時所處理的實體位址切割,已完成切割的映像散檔則繼續保留在儲存器110中,處理器150無須重新對映像檔切割。 Since the embodiment of the present invention adopts the segmented cutting method, after the cutting abnormality occurs, the segmentation module 112 continues to cut the physical address processed at the time when the cutting abnormality occurs, and the image scattered files that have been cut will continue to remain in In the storage 110, the processor 150 does not need to cut the image file again.

需說明的是,前述接續切割位址可在每次切割完成後計算,亦可能是反應於切割異常情況才計算。此外,在一些實施例中,針對部分大小不一致但屬於相同映像檔的映像散檔,處理器150可先將這些映像散檔組合成單一映像檔,再透過分割模組112對單一映像檔切割。 It should be noted that the aforementioned continuous cutting address can be calculated after each cutting is completed, or it may be calculated in response to abnormal cutting conditions. In addition, in some embodiments, for some image files with inconsistent sizes but belonging to the same image file, the processor 150 may first combine the image files into a single image file, and then cut the single image file through the splitting module 112.

另一方面,現有技術通常會以固定檔案大小來對映像檔進行切割,導致某一個映像散檔的檔案大小與其他映像散檔不同,進而影響後續還原作業。而為了讓影像散檔的大小一致,本發明實施例的分割模組112會先初始切割總數(例如,50、100、200個等),並依據此切割總數計算各映像散檔的大小。此映像散檔的大小是基於公式2:Split_Size=Image_Size/DF...(2)Split_Size是映像散檔的大小,Image_Size是映像檔的大小,DF是切割總數。分割模組112接著判斷映像散檔的大小是否大於最大散檔值(例如,50、80、150MB等)。若映像散檔的大小大於此最大散檔值,則分割模組112會增加切割總數(例如,增加50、100、150等)並重新計算映像散檔的大小。而若映像散檔的大小未大於 此最大散檔值,則分割模組112即依據此映像散檔的大小依序分段切割映像檔。 On the other hand, the prior art usually cuts the image file with a fixed file size, resulting in the file size of a certain image file being different from other image files, which in turn affects subsequent restoration operations. In order to make the size of the image files consistent, the segmentation module 112 of the embodiment of the present invention first initializes the total number of cuts (for example, 50, 100, 200, etc.), and calculates the size of each image file based on the total number of cuts. The size of this image file is based on formula 2: Split_Size=Image_Size/DF... (2) Split_Size is the size of the image file, Image_Size is the size of the image file, and DF is the total number of cuts. The segmentation module 112 then determines whether the size of the image bin is greater than the maximum bin value (eg, 50, 80, 150MB, etc.). If the size of the image file is greater than this maximum file value, the segmentation module 112 will increase the total number of cuts (eg, increase by 50, 100, 150, etc.) and recalculate the size of the image file. If the size of the image file is not greater than With this maximum bin value, the segmentation module 112 sequentially cuts the image file segment by segment according to the size of the image bin.

例如,如果分割模組112計算映像散檔的大小超過50MB(即,最大散檔值),則將DF變數(即,切割總數)加上100,再重新計算映像散檔的大小,直到映像散檔的大小小於或等於50MB為止。假設還原分區裡面的還原映像檔為8452MB,帶入公式2可得到切割總數DF=200,其是因為8452/100,得出來的映像散檔的大小Split_Size大於50MB;而8452/200,得出來的映像散檔的大小Splize_Size為42.26MB。 For example, if the segmentation module 112 calculates that the size of the image bulk exceeds 50MB (ie, the maximum value of the bulk), add 100 to the DF variable (ie, the total number of cuts), and then recalculate the size of the image bulk until the image is scattered The file size is less than or equal to 50MB. Assuming that the restored image file in the restored partition is 8452MB, the total number of cuts DF=200 can be obtained by entering formula 2, which is because 8452/100, the size of the resulting image split Split_Size is greater than 50MB; and 8452/200, the derived The size of the image bulk Splize_Size is 42.26MB.

需說明的是,此處所用最大散檔值是相同於前述判斷是否為為單一映像檔的最大散檔值,然於其他實施例中此二值亦可能不同。此外,公式2所用切割總數可供公式1使用。 It should be noted that the maximum bin value used here is the same as the maximum bin value of the aforementioned determination whether it is a single image file, but in other embodiments, the two values may also be different. In addition, the total number of cuts used in Equation 2 can be used in Equation 1.

此外,在一實施例中,為了有效利用空間,當分割階段完成時(即,最後切割個數等於切割總數),分割模組112可將原始的映像檔刪除。然於其他實施例中,分割模組112亦可能保留此映像檔。 In addition, in an embodiment, in order to effectively use the space, when the segmentation stage is completed (that is, the number of last cuts equals the total number of cuts), the splitting module 112 may delete the original image file. However, in other embodiments, the segmentation module 112 may also retain this image file.

而若分割階段完成或在步驟S210後決定不對映像檔切割(即,這些映像檔的數量、名稱關係及大小符合條件,而將這些映像檔視為映像散檔),請接續參照圖3是依據本發明一實施例映像檔之容錯處理方法-還原階段的流程圖,分段還原模組113會依序分段還原映像散檔且記錄分段還原歷程(步驟S310)。具體而言,在映像檔還原過程中,處理器150會透過計數器115記錄還原到 哪個映像散檔,其中每對這些映像散檔中的一者還原,計數器115會累計最後還原個數。例如,分段還原模組113對第五個映像散檔還原,則計數器115記錄最後還原個數為五個。分段還原模組113會將此最後還原個數作為分段還原歷程,並將此分段還原歷程記錄在日誌114中。 If the segmentation phase is completed or after step S210, it is decided not to cut the image files (ie, the number, name relationship and size of these image files meet the conditions, and these image files are regarded as image files), please refer to FIG. 3 According to an embodiment of the present invention, a fault-tolerant processing method for image files-a flowchart of the restoration stage, the segment restoration module 113 sequentially restores the image files in stages and records the stage restoration history (step S310). Specifically, during the restoration of the image file, the processor 150 records the restoration to the counter 115 through the counter 115. Which image bin is restored for each of these pair of image bins, the counter 115 will accumulate the last number of restores. For example, if the segment restoration module 113 restores the fifth image file, the counter 115 records that the last restoration number is five. The segment restoration module 113 will use the last restored number as the segment restoration history, and record the segment restoration history in the log 114.

接著,反應於還原異常情況(例如,OS或程式發出失敗異常(fail exception)、電源中斷等),分段還原模組113可依據分段還原歷程接續還原尚未還原的映像散檔(步驟S350)。於本實施例中,最後還原個數代表排序第幾個映像散檔已順利還原,分段還原模組113只要接續對排序後一個(即,順序為最後還原個數加一)映像散檔繼續還原即可,無須重新自第一個映像散檔還原。 Then, in response to the restoration abnormality (for example, a failure exception issued by the OS or the program, a power interruption, etc.), the segment restoration module 113 may successively restore the unrestored image bin according to the segment restoration process (step S350) . In this embodiment, the last restored number represents the number of sorted image bins that have been successfully restored, and the segmentation restore module 113 only needs to continue to sort the last one (ie, the order is the last restored number plus one). Just restore, no need to restore from the first image bulk again.

需說明的是,在一些實施例中,處理器150可依據分割階段的切割順序而決定各映像散檔的名稱,以方便分段還原階段對還原的順序排序,或者處理器150另透過指標或參數記錄各映像散檔的順序,並供分段還原模組113存取。 It should be noted that, in some embodiments, the processor 150 may determine the name of each image file according to the cutting order of the segmentation stage, so as to facilitate the ordering of the restoration order in the staged restoration stage, or the processor 150 may use the index or The parameter records the order of each image file and is accessed by the segment restoration module 113.

表(2)是應用本發明實施例之實驗比較。以8GB映像檔為例,檔案分割時間(即,分割階段的處理時間)所占還原時間不到二分之一,而判斷還原分區路徑、還原執行等處理時間正常狀況不超過3秒鐘。 Table (2) is an experimental comparison of the embodiments of the present invention. Taking an 8GB image file as an example, the file splitting time (ie, the processing time of the splitting stage) takes less than one-half of the restoration time, and the normal processing time for determining the restoration partition path and restoration execution does not exceed 3 seconds.

Figure 107124640-A0305-02-0013-2
Figure 107124640-A0305-02-0013-2
Figure 107124640-A0305-02-0014-7
Figure 107124640-A0305-02-0014-7

當還原過程中發生問題時,復原時間導入本發明實施例前後比較表(3)如下。在映像檔還原過程中,會先把磁碟進行格式化,再把映像檔安裝至磁碟。因此,在導入本發明實施例前(即,現有技術),若還原過程中止,映像檔必須重安裝,耗費時間恐包括將複製映像檔、映像檔載入和OS客製化安裝等硬性檔部署時間,故耗費時間較長。導入本發明實施例後,還原過程中止,耗費時間縮短許多。以A牌CPU與傳統硬碟的硬體架構為例,若還原到60%中止,修復耗費時間為37-37*0.6=14.8分鐘。 When a problem occurs during the restoration process, the recovery time is introduced into the comparison table (3) before and after the embodiment of the present invention as follows. During the restoration of the image file, the disk will be formatted first, and then the image file will be installed on the disk. Therefore, before importing the embodiment of the present invention (ie, the prior art), if the restoration process is aborted, the image file must be reinstalled, which may take time to include the deployment of hard files such as copying the image file, loading the image file, and customizing the OS Time, so it takes a long time. After the embodiment of the present invention is introduced, the restoration process is suspended, and the time consumption is much shorter. Taking the hardware architecture of an A-brand CPU and a traditional hard disk as an example, if the restoration is aborted to 60%, the repair takes 37-37*0.6=14.8 minutes.

Figure 107124640-A0305-02-0014-4
Figure 107124640-A0305-02-0014-4
Figure 107124640-A0305-02-0015-8
Figure 107124640-A0305-02-0015-8

由以上兩者實驗結果,導入本實施例相較於現有技術雖增加了分割時間,但當還原過程中發生異常情況時,由於映像檔不需重新部署,因此修復時間明顯縮短許多。 Based on the experimental results of the above two, the introduction of this embodiment increases the splitting time compared to the prior art, but when an abnormal situation occurs during the restoration process, since the image file does not need to be redeployed, the repair time is significantly shortened.

綜上所述,本發明實施例的電腦系統及映像檔之容錯處理方法,其對映像檔採用分段切割及還原處理,並記錄切割及還原過程中的歷程,使任何異常情況發生後,都能接續執行切割及還原作業,明顯提升還原效率及成功率。此外,映像散檔切割後的大小一致,使後續還原作業能順利進行。 In summary, the computer system and the fault-tolerant processing method of the image file according to the embodiments of the present invention use segmented cutting and restoration processing on the image file, and record the history of the cutting and restoration process, so that any abnormal situation occurs. It can continue to perform cutting and restoration operations, significantly improving the restoration efficiency and success rate. In addition, the size of the image after the file is cut is the same, so that the subsequent restoration operation can be carried out smoothly.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed as above with examples, it is not intended to limit the present invention. Any person with ordinary knowledge in the technical field can make some changes and modifications without departing from the spirit and scope of the present invention. The scope of protection of the present invention shall be subject to the scope defined in the appended patent application.

S210~S250:步驟S210~S250: Steps

Claims (10)

一種映像檔之容錯處理方法,包括: 判斷是否切割至少一映像檔; 若決定對該至少一映像檔切割,則依序分段切割該至少一映像檔並記錄一切割歷程,其中該切割歷程相關於一最後切割個數,而該最後切割個數是每對該至少一映像檔切割一次而累計;以及 反應於一切割異常情況,依據該切割歷程接續切割該至少一映像檔。A fault-tolerant processing method for image files, comprising: determining whether to cut at least one image file; if it is decided to cut the at least one image file, sequentially cutting the at least one image file in sections and recording a cutting history, wherein the cutting history is related In a final cut number, the last cut number is accumulated every time the at least one image file is cut; and in response to an abnormal cutting condition, the at least one image file is continuously cut according to the cutting process. 如申請專利範圍第1項所述的映像檔之容錯處理方法,其中依據該切割歷程接續切割該至少一映像檔的步驟包括: 基於該最後切割個數及該至少一映像檔的起始位址決定一接續切割位址;以及 依據該接續切割位址切割尚未切割的該至少一映像檔。The fault-tolerant processing method for image files as described in item 1 of the patent application scope, wherein the step of successively cutting the at least one image file according to the cutting process includes: based on the number of the last cut and the starting address of the at least one image file Determining a continuous cutting address; and cutting the at least one image file that has not been cut according to the continuous cutting address. 如申請專利範圍第1項所述的映像檔之容錯處理方法,其中判斷是否切割該至少一映像檔的步驟包括: 依據該至少一映像檔的數量、名稱關係及大小中的至少一者判斷該至少一映像檔是否為至少一映像散檔,其中該至少一映像散檔中的部分或全部組成單一映像檔;以及 若該至少一映像檔不為該至少一映像散檔,則決定對該至少一映像檔切割。The fault-tolerant processing method for image files as described in item 1 of the patent application scope, wherein the step of judging whether to cut the at least one image file includes: judging the at least one of the number, name relationship and size of the at least one image file Whether at least one image file is at least one image file, wherein part or all of the at least one image file constitutes a single image file; and if the at least one image file is not the at least one image file, the One image file is cut. 如申請專利範圍第1項所述的映像檔之容錯處理方法,其中決定對該至少一映像檔切割的步驟之後,更包括: 依據一切割總數計算至少一映像散檔的大小,其中該至少一映像散檔組成該至少一映像檔; 判斷該至少一映像散檔的大小是否大於一最大散檔值; 若該至少一映像散檔的大小大於該最大散檔值,則增加該切割總數並重新計算該至少一映像散檔的大小;以及 若該至少一映像散檔的大小未大於該最大散檔值,則依據該至少一映像散檔的大小依序分段切割該至少一映像檔。The fault-tolerant processing method for image files as described in item 1 of the patent application scope, wherein after determining the step of cutting the at least one image file, the method further includes: calculating the size of at least one image file based on a total number of cuts, wherein the at least one The image files constitute the at least one image file; determine whether the size of the at least one image file is greater than a maximum file value; if the size of the at least one image file is greater than the maximum file value, increase the total number of cuts and restart Calculating the size of the at least one image file; and if the size of the at least one image file is not greater than the maximum file value, then the at least one image file is sequentially segmented according to the size of the at least one image file. 如申請專利範圍第1項所述的映像檔之容錯處理方法,其中決定對該至少一映像檔切割的步驟之前,更包括: 壓縮剩餘空間,以供至少一映像散檔儲存,其中該至少一映像散檔是對該至少一映像檔切割所得。The fault-tolerant processing method of the image file as described in item 1 of the patent application scope, wherein before the step of cutting the at least one image file is determined, the method further includes: compressing the remaining space for storing at least one image file, wherein the at least one The image file is obtained by cutting the at least one image file. 如申請專利範圍第1項所述的映像檔之容錯處理方法,其中判斷是否切割該至少一映像檔的步驟之後,更包括: 若決定不對該至少一映像檔切割,則將該至少一映像檔視為至少一映像散檔,並依序分段還原該至少一映像散檔且記錄一分段還原歷程,其中該分段還原歷程相關於一最後還原個數,而該最後還原個數是每對該至少一映像散檔中的一者還原而累計;以及 反應於一還原異常情況,依據該最後還原個數接續還原尚未還原的該至少一映像散檔。The fault-tolerant processing method of the image file as described in item 1 of the patent application scope, wherein after the step of determining whether to cut the at least one image file, the method further includes: if it is decided not to cut the at least one image file, then the at least one image file It is regarded as at least one image file, and the at least one image file is restored sequentially and a segment restoration process is recorded, wherein the segment restoration process is related to a last restoration number, and the last restoration number is every Restore and accumulate one of the at least one image file; and in response to a restore abnormal situation, restore the at least one image file that has not been restored successively according to the last restored number. 一種電腦系統,包括: 一儲存器,記錄至少一映像檔、及多個模組;以及 一處理器,耦接該儲存器,並存取且載入該儲存器所記錄的該些模組,而該些模組包括:       一分割模組,判斷是否切割該至少一映像檔,若決定對該至少一映像檔切割,則依序分段切割該至少一映像檔並記錄一切割歷程,並反應於一切割異常情況,依據該切割歷程接續切割該至少一映像檔,其中該切割歷程相關於一最後切割個數,而該最後切割個數是每對該至少一映像檔切割一次而累計。A computer system includes: a storage, recording at least one image file, and multiple modules; and a processor, coupled to the storage, and accessing and loading the modules recorded in the storage, The modules include: a segmentation module to determine whether to cut the at least one image file, and if it is decided to cut the at least one image file, sequentially cut the at least one image file in sections and record a cutting history, and react In an abnormal cutting situation, the at least one image file is successively cut according to the cutting history, wherein the cutting history is related to a number of last cuts, and the number of last cuts is accumulated every time the at least one image file is cut. 如申請專利範圍第7項所述的電腦系統,其中該分割模組基於該最後切割個數及該至少一映像檔的起始位址決定一接續切割位址,並依據該接續切割位址切割尚未切割的該至少一映像檔。The computer system as described in item 7 of the patent application scope, wherein the segmentation module determines a continuous cutting address based on the number of the last cut and the starting address of the at least one image file, and cuts according to the continuous cutting address The at least one image file that has not been cut. 如申請專利範圍第7項所述的電腦系統,其中該分割模組依據該至少一映像檔的數量、名稱關係及大小中的至少一者判斷該至少一映像檔是否為至少一映像散檔,其中該至少一映像散檔中的部分或全部組成單一映像檔,若該至少一映像檔不為該至少一映像散檔,則該分割模組決定對該至少一映像檔切割,若該至少一映像檔為該至少一映像散檔,則該分割模組決定不對該至少一映像檔切割,而該些模組更包括: 一分段還原模組,若該分割模組決定不對該至少一映像檔切割,則該分段還原模組依序分段還原該至少一映像散檔且記錄一分段還原歷程,其中該分段還原歷程相關於一最後還原個數,而該最後還原個數是每對該至少一映像散檔中的一者還原而累計,分段還原模組並反應於一還原異常情況,而依據該最後還原個數接續還原尚未還原的該至少一映像散檔。The computer system as recited in item 7 of the patent application scope, wherein the segmentation module determines whether the at least one image file is at least one image bulk based on at least one of the number, name relationship, and size of the at least one image file, Part or all of the at least one image file constitutes a single image file, if the at least one image file is not the at least one image file, the segmentation module decides to cut the at least one image file, if the at least one If the image file is the at least one image file, the partition module decides not to cut the at least one image file, and the modules further include: a segment restoration module, if the partition module decides not to at least one image File cutting, the segment restoration module sequentially restores the at least one image bulk and records a segment restoration history, wherein the segment restoration history is related to a last restoration number, and the last restoration number is Each time one of the at least one image file is restored and accumulated, the segmented restore module reacts to a restore abnormal condition, and restores the at least one image file that has not been restored successively according to the last restored number. 如申請專利範圍第7項所述的電腦系統,其中該分割模組依據一切割總數計算至少一映像散檔的大小,其中該至少一映像散檔組成該至少一映像檔,該分割模組判斷該至少一映像散檔的大小是否大於一最大散檔值,若該至少一映像散檔的大小大於該最大散檔值,則該分割模組增加該切割總數並重新計算該至少一映像散檔的大小,而若該至少一映像散檔的大小未大於該最大散檔值,則該分割模組依據該至少一映像散檔的大小依序分段切割該至少一映像檔。The computer system according to item 7 of the patent application scope, wherein the segmentation module calculates the size of at least one image file based on a total number of cuts, wherein the at least one image file constitutes the at least one image file, and the segmentation module determines Whether the size of the at least one image bin is greater than a maximum bin value, if the size of the at least one image bin is greater than the maximum bin value, the segmentation module increases the total number of cuts and recalculates the at least one image bin The size of the at least one image file, if the size of the at least one image file is not greater than the maximum file value, the segmentation module sequentially cuts the at least one image file according to the size of the at least one image file.
TW107124640A 2018-07-17 2018-07-17 Computer system and fault tolerance processing method of image file TWI687803B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW107124640A TWI687803B (en) 2018-07-17 2018-07-17 Computer system and fault tolerance processing method of image file
US16/252,742 US11468094B2 (en) 2018-07-17 2019-01-21 Computer system and fault tolerance processing method thereof of image file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107124640A TWI687803B (en) 2018-07-17 2018-07-17 Computer system and fault tolerance processing method of image file

Publications (2)

Publication Number Publication Date
TW202006543A TW202006543A (en) 2020-02-01
TWI687803B true TWI687803B (en) 2020-03-11

Family

ID=70412862

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107124640A TWI687803B (en) 2018-07-17 2018-07-17 Computer system and fault tolerance processing method of image file

Country Status (1)

Country Link
TW (1) TWI687803B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6615365B1 (en) * 2000-03-11 2003-09-02 Powerquest Corporation Storing a computer disk image within an imaged partition
TW200622868A (en) * 2004-12-30 2006-07-01 Mitac Technology Corp Recovery method and its system for an operating system
TW200713235A (en) * 2005-09-19 2007-04-01 Cyberlink Corp Distributed copying method and system
TW201614495A (en) * 2014-10-08 2016-04-16 Farstone Technology Inc Backup method, recovery method and computer, computer program product and computer readable recording medium thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6615365B1 (en) * 2000-03-11 2003-09-02 Powerquest Corporation Storing a computer disk image within an imaged partition
TW200622868A (en) * 2004-12-30 2006-07-01 Mitac Technology Corp Recovery method and its system for an operating system
TW200713235A (en) * 2005-09-19 2007-04-01 Cyberlink Corp Distributed copying method and system
TW201614495A (en) * 2014-10-08 2016-04-16 Farstone Technology Inc Backup method, recovery method and computer, computer program product and computer readable recording medium thereof

Also Published As

Publication number Publication date
TW202006543A (en) 2020-02-01

Similar Documents

Publication Publication Date Title
US9317373B2 (en) Snapshots in a hybrid storage device comprising a magnetic disk and a solid state disk
US9886439B2 (en) Archival management of database logs
US9235474B1 (en) Systems and methods for maintaining a virtual failover volume of a target computing system
CN109445861B (en) System starting method, device, computer device and storage medium
US11698808B2 (en) System and method of selectively restoring a computer system to an operational state
US11221927B2 (en) Method for the implementation of a high performance, high resiliency and high availability dual controller storage system
US20040193866A1 (en) Backup method for interface BIOS
CN111258666A (en) Reading method and device of computer file, computer system and storage medium
US9280431B2 (en) Prioritizing backups on a disk level within enterprise storage
US8504869B2 (en) Kernel swapping systems and methods for recovering a network device
TWI687803B (en) Computer system and fault tolerance processing method of image file
US20030037279A1 (en) HDD data backup and recovery method
US8666947B2 (en) Ensuring partitioned dataset extended (PDSE) critical dataset redundancy (CDR)
CN110764951B (en) Computer system and fault-tolerant processing method of mapping file
TWI698740B (en) Deployment method of recovery images and electronic device using the same
US20190138407A1 (en) Systems and methods of deploying an operating system from a resilient virtual drive
US9547457B1 (en) Detection of file system mounts of storage devices
US11468094B2 (en) Computer system and fault tolerance processing method thereof of image file
JP7291107B2 (en) Electronic computer, reproduction test method and program
CN115576743B (en) Operating system recovery method, operating system recovery device, computer equipment and storage medium
CN117519810B (en) Processing method and device for disk partition, electronic equipment and medium
CN116048630A (en) Method for accessing hidden area data, electronic equipment and storage medium
US20050066223A1 (en) Access control method and module with data recovery option for a hard disk
CN115858251A (en) Control method and device for substrate control unit, electronic equipment and storage medium
CN117666950A (en) Hard disk data migration method, device, medium and NAS equipment