TW202011192A - Computer system, fault tolerance processing method for external file and computer program product - Google Patents

Computer system, fault tolerance processing method for external file and computer program product Download PDF

Info

Publication number
TW202011192A
TW202011192A TW107131207A TW107131207A TW202011192A TW 202011192 A TW202011192 A TW 202011192A TW 107131207 A TW107131207 A TW 107131207A TW 107131207 A TW107131207 A TW 107131207A TW 202011192 A TW202011192 A TW 202011192A
Authority
TW
Taiwan
Prior art keywords
file
external
computer system
copy
external file
Prior art date
Application number
TW107131207A
Other languages
Chinese (zh)
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 TW107131207A priority Critical patent/TW202011192A/en
Publication of TW202011192A publication Critical patent/TW202011192A/en

Links

Images

Landscapes

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

Abstract

A computer system, a fault tolerance processing method for external file and a computer program product are provided. The computer system includes a transmission interface, storage and a processor. The transmission interface is used for connecting with an external storing apparatus. In addition, the processor performs a file operation on an external file from the external storing apparatus, copies the external file into a file path in the storage, searches a process belong to the external file, and modifies a file source of the process to the aforesaid file path. Then, the file operation can be continued without interruption in response to any exception. Accordingly, when the external storing apparatus is removed from the computer system accidently or is broken, the external file would not be lost, and a warning message would not be displayed.

Description

電腦系統、其外部檔案的容錯處理方法及電腦程式產品Computer system, fault-tolerant processing method of external files and computer program product

本發明是有關於一種檔案處理技術,且特別是有關於一種電腦系統、其外部檔案的容錯處理方法及電腦程式產品。The invention relates to a file processing technology, and in particular to a computer system, a fault-tolerant processing method for external files and a computer program product.

電腦系統(例如,桌上型電腦、筆記型電腦、一體機(All-in-One,AIO)等)已經是人們在工作、娛樂、休閒甚至日常生活上常用的工具之一。為了隨身攜帶或傳輸方便,人們會將電腦系統的檔案透過外部儲存裝置(例如,隨身碟、外接硬碟、智慧型手機等)儲存,以在其他電腦系統使用此檔案。無可避免地,使用者對外部儲存裝置中的外部檔案執行操作(例如,執行、複製、開啟等)的過程中,外部儲存裝置可能被拔離電腦系統、或是外部儲存裝置損毀。此時,電腦系統中已儲存的部分或全部外部檔案可能會遺失,作業系統會提示錯誤訊息,且先前執行的操作將中斷。由此可知,有需要提供一種檔案處理方式以避免前述問題發生。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. In order to carry or transfer easily, people will store the file of the computer system through an external storage device (for example, pen drive, external hard drive, smart phone, etc.) to use this file in other computer systems. Inevitably, during the operation (for example, execution, copying, opening, etc.) of the external file in the external storage device, the external storage device may be unplugged from the computer system or the external storage device may be damaged. At this time, some or all of the external files stored in the computer system may be lost, the operating system will prompt an error message, and the previously performed operation will be interrupted. It can be seen that there is a need to provide a file processing method to avoid the aforementioned problems.

本發明提供一種電腦系統、其外部檔案的容錯處理方法及電腦程式產品,其將外部檔案暫存於電腦系統,並提供檔案複製的容錯機制,以接續對外部檔案執行先前操作而不中斷。The invention provides a computer system, a fault-tolerant processing method for external files and a computer program product, which temporarily stores external files in the computer system, and provides a fault-tolerant mechanism for file copying, so as to continue performing previous operations on external files without interruption.

本發明外部檔案的容錯處理方法,其適用於電腦系統,而此容錯處理方法包括下列步驟。對來自外部儲存裝置的外部檔案進行檔案操作。此外部儲存裝置是可插拔地連接電腦系統。將外部檔案複製(copy)到電腦系統的第一檔案路徑下。搜尋此外部檔案所屬的程序(process)。將程序的檔案來源修改成電腦系統的第一檔案路徑。反應於此檔案操作的異常情況,接續進行檔案操作而不中斷。The fault-tolerant processing method of the external file of the present invention is suitable for computer systems, and the fault-tolerant processing method includes the following steps. Perform file operations on external files from external storage devices. The external storage device is pluggable to the computer system. Copy the external files to the first file path of the computer system. Search for the process to which this external file belongs. Modify the file source of the program to the first file path of the computer system. In response to the abnormal situation of this file operation, the file operation is continued without interruption.

本發明的電腦系統,其包括傳輸介面、儲存器及處理器。傳輸介面用於連接外部儲存裝置。傳輸介面用以連接外部儲存裝置,而此外部儲存裝置儲存有外部檔案。處理器耦接傳輸介面及儲存器。此外,處理器對來自外部儲存裝置的外部檔案進行檔案操作將外部檔案複製到儲存器的第一檔案路徑下,搜尋此外部檔案所屬的程序,且將程序的檔案來源修改成儲存器的第一檔案路徑。而反應於此檔案操作的異常情況,處理器接續進行檔案操作而不中斷。The computer system of the present invention includes a transmission interface, a storage, and a processor. The transmission interface is used to connect an external storage device. The transmission interface is used to connect an external storage device, and the external storage device stores external files. The processor is coupled to the transmission interface and the memory. In addition, the processor performs file operations on the external files from the external storage device, copies the external files to the first file path of the storage, searches for the program to which the external file belongs, and modifies the file source of the program to the first of the storage File path. In response to the abnormal situation of the file operation, the processor continues the file operation without interruption.

此外,本發明的電腦程式產品,其經由電腦系統之處理器載入以執行下列步驟。對來自外部儲存裝置的外部檔案進行檔案操作。此外部儲存裝置是可插拔地連接電腦系統。將外部檔案複製到電腦系統的第一檔案路徑下。搜尋此外部檔案所屬的程序。將程序的檔案來源修改成電腦系統的第一檔案路徑。反應於此檔案操作的異常情況,接續進行檔案操作而不中斷。In addition, the computer program product of the present invention is loaded by the processor of the computer system to perform the following steps. Perform file operations on external files from external storage devices. The external storage device is pluggable to the computer system. Copy the external files to the first file path of the computer system. Search for the program to which this external file belongs. Modify the file source of the program to the first file path of the computer system. In response to the abnormal situation of this file operation, the file operation is continued without interruption.

基於上述,本發明實施例的電腦系統、其外部檔案的容錯處理方法及電腦程式產品,其係將當前操作的外部檔案暫存在電腦系統,並將所屬程序的檔案來源修改成電腦系統暫存外部檔案的檔案路徑。藉此,無論外部儲存裝置是否拔除或毀損,都不會影響電腦系統所暫存外部檔案的執行作業。另一方面,本發明實施例考量外部檔案的複製作業中的中斷情況,記錄外部儲存裝置、檔案路徑及進度百分比等複製歷程,使中斷情況發生後能接續複製作業。Based on the above, the computer system, the external file fault-tolerant processing method, and the computer program product of the embodiments of the present invention temporarily store the currently operating external file in the computer system, and modify the file source of the associated program to the computer system temporary external The file path of the file. In this way, regardless of whether the external storage device is unplugged or damaged, it will not affect the execution of the temporary external files stored in the computer system. On the other hand, the embodiment of the present invention considers the interruption in the external file copy operation, and records the external storage device, file path, progress percentage, and other copy history, so that the copy operation can be continued after the interruption occurs.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。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,此系統包括電腦系統1及外部儲存裝置5。FIG. 1 is a system architecture diagram according to an embodiment of the invention. Please refer to FIG. 1, this system includes a computer system 1 and an external storage device 5.

電腦系統1可以是桌上型電腦、筆記型電腦、伺服器、一體機(AIO)等電子裝置。電腦系統1至少包括但不僅限於儲存器110、傳輸介面130及處理器150。The computer system 1 may be an electronic device such as a desktop computer, a notebook computer, a server, and an all-in-one (AIO). The computer system 1 includes at least but not limited to the storage 110, the transmission interface 130 and the processor 150.

儲存器110可以是任何型態的固定或可移動隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash Memory)、傳統硬碟(Hard Disk Drive,HDD)、固態硬碟(Solid-State Disk,SSD)、非揮發性(non-volatile)記憶體(例如,儲存等級記憶體(Storage Class Memory,SCM)、持久型(persistent)記憶體、3D XPoint記憶體、磁阻式隨機存取記憶體(Magnetoresistive Random Access Memory, MRAM)等具備非揮發性的儲存特性之記憶體)或類似元件或上述元件之組合的儲存器。於本實施例中,儲存器110包括硬碟111(例如HDD、SSD等)及非揮發性記憶體112。儲存器110並用於儲存緩衝的或永久的資料、軟體模組、應用程式、複製歷程113等資料或檔案,且其詳細內容待後續實施例詳述。The storage 110 may be any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory (Flash memory), or traditional hard disk Hard Disk Drive (HDD), Solid-State Disk (SSD), non-volatile (non-volatile) memory (for example, Storage Class Memory (SCM), persistent (persistent ) Memory, 3D XPoint memory, magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM) and other memory with non-volatile storage characteristics) or similar components or a combination of the above components. In this embodiment, the storage 110 includes a hard disk 111 (eg, HDD, SSD, etc.) and a non-volatile memory 112. The storage 110 is also used to store buffered or permanent data, software modules, application programs, copy history 113 and other data or files, and the detailed content thereof will be described in detail in subsequent embodiments.

傳輸介面130可以是串列或並列的匯流排介面(例如,通用串列匯流排(Universal Serial Bus,USB)、Thunderbolt等)。The transmission interface 130 may be a serial or parallel bus interface (for example, Universal Serial Bus (USB), Thunderbolt, etc.).

處理器150與儲存器110及傳輸介面130耦接,並可以是中央處理單元(CPU),或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位信號處理器(DSP)、可程式化控制器、特殊應用積體電路(ASIC)或其他類似元件或上述元件的組合。在本發明實施例中,處理器150用以執行電腦系統1的所有作業,且可載入並執行儲存器110所記錄的各軟體模組、檔案及資料。The processor 150 is coupled to the memory 110 and the transmission interface 130, and may be a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor (Microprocessor), digital signal processor (DSP) ), programmable controller, special application 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 perform all operations of the computer system 1, and can load and execute various software modules, files, and data recorded in the storage 110.

外部儲存裝置5可以是隨身碟、記憶卡、隨身或行動硬碟等儲存媒介,外部儲存裝置5亦可能是平板電腦、智慧型手機等具有儲存器的電子裝置。外部儲存裝置5具有與傳輸介面130相符/相容的介面,以可插拔地透過傳輸介面130與電腦系統1連接。於本實施例中,外部儲存裝置5儲存一個或更多個外部檔案51(例如,執行檔、文件檔、影片檔、音樂檔等)。The external storage device 5 may be a storage medium such as a flash drive, a memory card, a portable or mobile hard drive, and the external storage device 5 may also be an electronic device with a memory such as a tablet computer or a smart phone. The external storage device 5 has an interface that is compatible/compatible with the transmission interface 130, and is removably connected to the computer system 1 through the transmission interface 130. In this embodiment, the external storage device 5 stores one or more external files 51 (eg, execution files, document files, video files, music files, etc.).

為了方便理解本發明實施例的操作流程,以下將舉諸多實施例詳細說明本發明實施例中電腦系統1對外部檔案51的處理流程。下文中,將搭配電腦系統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 computer system 1 on the external file 51 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是依據本發明一實施例外部檔案51的容錯處理方法的流程圖。請參照圖2,假設外部儲存裝置5透過傳輸介面130與電腦系統1連接。而電腦系統1可提供檔案管理程式呈現外部儲存裝置5所儲存的外部檔案51,以供使用者透過輸入裝置(例如,滑鼠、鍵盤、觸控面板等)對外部檔案51進行開啟、編輯、執行、複製等檔案操作。而處理器150反應於使用者的檔案操作,對來自外部儲存裝置5的外部檔案51進行對應的檔案操作(即,開啟、編輯、執行、複製等)(步驟S210)。2 is a flowchart of a fault-tolerant processing method of an external file 51 according to an embodiment of the invention. Referring to FIG. 2, it is assumed that the external storage device 5 is connected to the computer system 1 through the transmission interface 130. The computer system 1 can provide a file management program to present the external files 51 stored in the external storage device 5 for the user to open, edit, and edit the external files 51 through the input device (eg, mouse, keyboard, touch panel, etc.) Execute, copy and other file operations. In response to the user's file operation, the processor 150 performs corresponding file operations (ie, opening, editing, executing, copying, etc.) on the external file 51 from the external storage device 5 (step S210).

在對外部檔案51執行檔案操作的過程中,若遇到任何異常情況(例如,外部儲存裝置5拔離傳輸介面130、外部儲存裝置5毀損等),則現有技術會將當前的檔案操作中斷。也就是說,若外部檔案51僅儲存在外部儲存裝置5中,任何異常情況都會使檔案操作中斷。為了避免前述問題,本發明實施例係先將外部檔案51複製/儲存/暫存到電腦系統的儲存器110的第一檔案路徑下(步驟S230),而之後接續對儲存在儲存器110的外部檔案51進行原先的檔案操作。In the process of performing file operations on the external file 51, if any abnormal conditions are encountered (for example, the external storage device 5 is disconnected from the transmission interface 130, the external storage device 5 is damaged, etc.), the current technology will interrupt the current file operation. That is to say, if the external file 51 is only stored in the external storage device 5, any abnormal situation will interrupt the file operation. In order to avoid the foregoing problems, the embodiment of the present invention first copies/stores/temporates the external file 51 to the first file path of the storage 110 of the computer system (step S230), and then continues to store the external storage in the storage 110 The file 51 performs the original file operation.

具體而言,請參照圖3是依據本發明一實施例的外部檔案暫存的流程圖。當外部檔案51被開啟時,處理器150會取得外部檔案51的檔案大小、在外部儲存裝置5中的檔案路徑,再判斷外部檔案51開啟後的執行時間是否超過門檻值(例如,30秒、1分鐘、5分鐘等)(步驟S310)。若執行時間尚未超過門檻值但外部檔案51已被關閉或結束/停止對外部檔案51的檔案操作,則處理器150不會(禁能)將外部檔案51複製到儲存器110。另一方面,若執行時間已超過門檻值,則處理器150會將外部檔案51複製到儲存器110。需說明的是,判斷執行時間的機制是避免使用者無意開啟外部檔案51、不需要過長(例如超過門檻值)的執行時間或其他狀況,從而節省儲存器110的儲存空間。然而,在其他實施例中,處理器150亦可能不考慮執行時間,只要外部檔案51被開啟即直接將外部檔案51複製到儲存器110。Specifically, please refer to FIG. 3, which is a flowchart of temporary storage of an external file according to an embodiment of the invention. When the external file 51 is opened, the processor 150 will obtain the file size of the external file 51 and the file path in the external storage device 5, and then determine whether the execution time after the external file 51 is opened exceeds the threshold (for example, 30 seconds, 1 minute, 5 minutes, etc.) (step S310). If the execution time has not exceeded the threshold but the external file 51 has been closed or the file operation on the external file 51 has been closed/stopped, the processor 150 will not (disable) copy the external file 51 to the storage 110. On the other hand, if the execution time has exceeded the threshold, the processor 150 will copy the external file 51 to the storage 110. It should be noted that the mechanism for determining the execution time is to prevent the user from unintentionally opening the external file 51, and does not require an excessively long (for example, exceeding a threshold) execution time or other conditions, thereby saving storage space of the storage 110. However, in other embodiments, the processor 150 may not consider the execution time, as long as the external file 51 is opened, the external file 51 is directly copied to the storage 110.

接著,處理器150判斷電腦系統1是否存在非揮發性記憶體112(步驟S320)。具體而言,非揮發性記憶體112結合傳統儲存裝置及記憶體特性,使儲存的檔案不會因電腦系統1斷電而消失,其傳輸速度更比傳統硬碟或固態硬碟更快。若將外部檔案51儲存在非揮發性記憶體112中,則相較於硬碟111,對非揮發性記憶體112的存取速度快上許多。因此,本發明實施例優先考慮將外部檔案51儲存在非揮發性記憶體112中。若電腦系統1沒有內建非揮發性記憶體112,則處理器150將外部檔案51儲存到硬碟111(步驟S330)。Next, the processor 150 determines whether the non-volatile memory 112 exists in the computer system 1 (step S320). Specifically, the non-volatile memory 112 combines traditional storage devices and memory characteristics so that the stored files will not disappear when the computer system 1 is powered off, and its transfer speed is faster than that of the conventional hard disk or solid-state hard disk. If the external file 51 is stored in the non-volatile memory 112, compared with the hard disk 111, the access speed to the non-volatile memory 112 is much faster. Therefore, the embodiment of the present invention preferentially stores the external file 51 in the non-volatile memory 112. If the computer system 1 has no built-in non-volatile memory 112, the processor 150 stores the external file 51 to the hard disk 111 (step S330).

此外,非揮發性記憶體112的儲存空間有限,且當前製造非揮發性記憶體112的成本相較於硬碟111更高,使得硬碟111的空間通常比非揮發性記憶體112更大。因此,若電腦系統1內建有非揮發性記憶體112,則處理器150會進一步判斷非揮發性記憶體112的剩餘儲存空間是否小於容許空間(例如,500MB、100MB、總儲存空間的百分之75等)(步驟S340),並依據非揮發性記憶體112的剩餘儲存空間決定將外部檔案51複製到非揮發性記憶體112及硬碟111中的一者。若剩餘儲存空間小於容許空間,則處理器150將外部檔案51儲存到硬碟111(步驟S330)。另一方面,若剩餘儲存空間未小於容許空間,則處理器150將外部檔案51儲存到非揮發性記憶體112 (步驟S350)。值得注意的是,處理器150可能會對儲存在儲存器110的外部檔案51重新命名(例如,原檔名+使用者帳號+系統時間、原檔名+不同序號等),以避免重複儲存或檔案內容並非最近修改的。或者,當欲複製外部檔案51時,處理器150亦可能是直接將儲存器110中先前儲存的外部檔案51刪除,再複製當前開啟的外部檔案51到儲存器110中。In addition, the storage space of the non-volatile memory 112 is limited, and the current cost of manufacturing the non-volatile memory 112 is higher than that of the hard disk 111, so that the space of the hard disk 111 is usually larger than that of the non-volatile memory 112. Therefore, if the non-volatile memory 112 is built in the computer system 1, the processor 150 will further determine whether the remaining storage space of the non-volatile memory 112 is less than the allowable space (eg, 500MB, 100MB, percentage of the total storage space) 75) (step S340), and decide to copy the external file 51 to one of the non-volatile memory 112 and the hard disk 111 according to the remaining storage space of the non-volatile memory 112. If the remaining storage space is smaller than the allowable space, the processor 150 stores the external file 51 to the hard disk 111 (step S330). On the other hand, if the remaining storage space is not less than the allowable space, the processor 150 stores the external file 51 to the non-volatile memory 112 (step S350). It is worth noting that the processor 150 may rename the external file 51 stored in the storage 110 (eg, original file name + user account + system time, original file name + different serial number, etc.) to avoid repeated storage or The content of the file was not recently modified. Or, when copying the external file 51, the processor 150 may directly delete the previously stored external file 51 in the storage 110, and then copy the currently opened external file 51 to the storage 110.

另需說明的是,在其他實施例中,處理器150亦可能不考慮非揮發性記憶體112的容許空間、或直接將外部檔案51儲存到硬碟111。此外,在一些實施例中,電腦系統1可能僅包括硬碟111及非揮發性記憶體112的其中一者,則處理器150直接將外部檔案51儲存到所具有的儲存器110即可。It should be further noted that, in other embodiments, the processor 150 may not consider the allowable space of the non-volatile memory 112 or directly store the external file 51 to the hard disk 111. In addition, in some embodiments, the computer system 1 may only include one of the hard disk 111 and the non-volatile memory 112, and the processor 150 may directly store the external file 51 to the storage 110 provided.

待外部檔案51完全複製/儲存在儲存器110後,處理器150會搜尋對外部檔案51執行檔案操作的所屬程序(process)(步驟S250、S360)。具體而言,若外部檔案51為文件檔、影像檔、音樂檔等非執行檔,則外部檔案51被使用者選擇開啟後,處理器150會呼叫對應的應用程式或反應於使用者手動選擇應用程式,以透過此對應的應用程式來開啟外部檔案51。而若外部檔案51為執行檔,則處理器150會直接執行此執行檔。值得注意的是,這些應用程式或執行檔被執行後,電腦系統1的作業系統將形成對應程序,以作為已執行程式的實體。而此程序會記錄當前處理檔案的檔案來源(或是磁區來源,以檔案路徑表示)。After the external file 51 is completely copied/stored in the storage 110, the processor 150 searches for the process to perform the file operation on the external file 51 (steps S250, S360). Specifically, if the external file 51 is a non-executable file such as a document file, an image file, a music file, etc., after the external file 51 is selected to be opened by the user, the processor 150 will call the corresponding application program or respond to the user manually selecting the application Program to open the external file 51 through the corresponding application program. If the external file 51 is an executable file, the processor 150 will directly execute the executable file. It is worth noting that after these applications or executable files are executed, the operating system of the computer system 1 will form a corresponding program as the entity of the executed program. And this process will record the file source of the file currently processed (or the source of the magnetic field, represented by the file path).

接著,若外部檔案51是複製到儲存器110的第一檔案路徑下,處理器150則將程序的檔案來源修改成儲存器110儲存外部檔案51的第一檔案路徑(步驟S270、S370)。例如,原先外部檔案51在外部儲存裝置5的檔案路徑為“E:\ABC.EXE”,則所屬程序的檔案來源即為“E:\ABC.EXE”。接著,此外部檔案51複製到儲存器110中“D:\ABC.EXE”的檔案路徑下,處理器150便將所屬程序的檔案來源修改成“D:\ABC.EXE”。Then, if the external file 51 is copied to the first file path of the storage 110, the processor 150 modifies the file source of the program to the first file path of the storage 110 to store the external file 51 (steps S270, S370). For example, if the file path of the external file 51 in the external storage device 5 is “E:\ABC.EXE”, the file source of the associated program is “E:\ABC.EXE”. Then, the external file 51 is copied to the file path of "D:\ABC.EXE" in the storage 110, and the processor 150 changes the file source of the associated program to "D:\ABC.EXE".

由於程序的檔案來源已置換成電腦系統1的第一檔案路徑且外部檔案51已複製到儲存器110中,因此處理器150事實上是對儲存器110中的外部檔案51執行檔案操作。而反應於對儲存器110中外部檔案51的檔案操作的任何異常情況(例如,外部儲存裝置5與電腦系統1分離、外部儲存裝置5毀損等),處理器150都能接續執行檔案操作而不中斷(步驟S290),並確保當前執行應用程式或執行檔不會出現錯誤訊息或被強制關閉。Since the file source of the program has been replaced with the first file path of the computer system 1 and the external file 51 has been copied to the storage 110, the processor 150 is actually performing a file operation on the external file 51 in the storage 110. In response to any abnormality in the file operation of the external file 51 in the storage 110 (for example, the external storage device 5 is separated from the computer system 1, the external storage device 5 is damaged, etc.), the processor 150 can continue to execute the file operation without Interrupt (step S290), and ensure that the currently running application or execution file will not display an error message or be forced to close.

需說明的是,為了避免因使用者對外部檔案51修改而使儲存器110與外部儲存裝置5所記錄外部檔案51的內容不一致,在對外部檔案51進行檔案操作的過程中,處理器150可能會定時(例如,每30秒、每一分鐘等)或反應於內容有修改,而將儲存器110中的外部檔案51複製到外部儲存裝置5中。It should be noted that, in order to prevent the content of the external file 51 recorded by the storage 110 and the external storage device 5 from being inconsistent due to the modification of the external file 51 by the user, during the file operation on the external file 51, the processor 150 may The external file 51 in the storage 110 is copied to the external storage device 5 periodically (for example, every 30 seconds, every minute, etc.) or in response to the content being modified.

值得注意的是,本案實施例的容錯機制是將外部檔案51複製到儲存器110中,若外部檔案51之複製作業的執行過程中發生異常情況,將導致複製失敗且待外部儲存裝置51重新連接電腦系統1後檔案路徑的邏輯位址可能會變動。因此,本發明另提出針對外部檔案51之複製作業(即,針對檔案操作為複製作業)的容錯機制。It is worth noting that the fault tolerance mechanism of the embodiment of the present invention is to copy the external file 51 to the storage 110. If an abnormal situation occurs during the execution of the copy operation of the external file 51, the copy will fail and the external storage device 51 will be reconnected After the computer system 1, the logical address of the file path may change. Therefore, the present invention also proposes a fault tolerance mechanism for the copy operation of the external file 51 (that is, the file operation is a copy operation).

圖4是依據本發明一實施例的複製作業的流程圖。請參照圖4,在前述步驟S330及S340中或是反應於使用者直接對外部檔案51的複製操作,處理器150會複製外部檔案51至儲存器110,並記錄此對應複製作業的複製歷程113(步驟S410)。此複製歷程113可以是日誌檔形式,並記錄有外接儲存裝置5的識別資訊(例如,類型(disk type)、序號、廠牌等)、複製作業的進度百分比及外部檔案51儲存在外部儲存裝置的第二檔案路徑。4 is a flowchart of a copy operation according to an embodiment of the invention. Referring to FIG. 4, in the foregoing steps S330 and S340 or in response to the user's direct copy operation of the external file 51, the processor 150 copies the external file 51 to the storage 110 and records the copy history 113 corresponding to the copy operation (Step S410). The copy history 113 may be in the form of a log file, and records the identification information of the external storage device 5 (eg, disk type, serial number, brand, etc.), the progress percentage of the copy operation, and the external file 51 stored in the external storage device The second file path.

接著,處理器150判斷是否有異常情況(例如,電腦系統1斷電、外部儲存裝置5移除等)(步驟S420)。若無異常情況發生,則處理器150繼續複製作業並記錄複製歷程113(返回步驟S410)。另一方面,若有異常情況發生(代表複製作業失敗),處理器150即依據最近的複製歷程113來進行外部檔案容錯還原(步驟S5)。Next, the processor 150 determines whether there is an abnormal situation (for example, the computer system 1 is powered off, the external storage device 5 is removed, etc.) (step S420). If no abnormality occurs, the processor 150 continues the copy operation and records the copy history 113 (return to step S410). On the other hand, if an abnormal situation occurs (representing the failure of the copy operation), the processor 150 performs external file fault-tolerant restoration according to the latest copy history 113 (step S5).

圖5是依據本發明一實施例的外部檔案容錯還原S5的流程圖。請參照圖5,處理器150將依據複製歷程113中的識別資訊(例如,類型、序號等)來搜尋電腦系統1的作業系統是否有符合原先外部儲存裝置5的識別資訊(步驟S510),以確認電腦系統1是否偵測(或連接)到外部儲存裝置5(步驟S520)。若沒有偵測到外部儲存裝置5,則代表外部儲存裝置5無法即時連接到電腦系統1或損壞無法及時復原。另一方面,若處理器150偵測到外部儲存裝置5,則處理器150將依據複製歷程113中的第二檔案路徑尋找外部儲存裝置5中符合的檔案路徑(步驟S530),並判斷是否偵測到相符的檔案路徑(步驟S540)。若自外部儲存裝置5沒有偵測到相符的第二檔案路徑,則外部檔案51將視為不在外部儲存裝置5中。FIG. 5 is a flowchart of external file fault recovery S5 according to an embodiment of the invention. Referring to FIG. 5, the processor 150 will search the operating system of the computer system 1 according to the identification information (for example, type, serial number, etc.) in the copy history 113 for the identification information of the original external storage device 5 (step S510), Confirm whether the computer system 1 detects (or connects) to the external storage device 5 (step S520). If the external storage device 5 is not detected, it means that the external storage device 5 cannot be connected to the computer system 1 in real time or damaged and cannot be recovered in time. On the other hand, if the processor 150 detects the external storage device 5, the processor 150 will search for a matching file path in the external storage device 5 according to the second file path in the copy history 113 (step S530), and determine whether to detect it. A matching file path is detected (step S540). If no matching second file path is detected from the external storage device 5, the external file 51 will be regarded as not in the external storage device 5.

另一方面,若外部儲存裝置5有偵測到相符的檔案路徑(即,外部檔案51儲存在外部儲存裝置5中的第二檔案路徑),則處理器150計算接續複製作業的還原位址並接續自此第二檔案路徑複製外部檔案51中尚未複製的部分(步驟S550)。具體而言,本發明實施例是採用接續複製的方式來提升恢復複製作業的效率。處理器150會基於複製歷程113中的進度百分比(即,複製作業中斷(或異常情況發生)前或當下的進度百分比)及外部檔案51儲存在外部儲存裝置5的實體位址中的起始位址,來決定異常情況發生時的終止位址。處理器150再依據此終止位址來決定還原位址。而此還原位址是基於公式(1):

Figure 02_image001
…(1) RDC是還原位址,P是複製歷程113所記錄中斷前的進度百分比,T是外部檔案51儲存在外部儲存裝置5的終止位址,而I是外部檔案51儲存在外部儲存裝置5的起始位址。接著,處理器150即可依據此還原位址來接續複製作業,並判斷是否完成複製作業(即,進度百分比為百分之百)(步驟S560)。若尚未完成複製作業,則處理器150持續進行複製作業至完成。On the other hand, if the external storage device 5 detects a matching file path (ie, the second file path where the external file 51 is stored in the external storage device 5), the processor 150 calculates the restoration address of the subsequent copy operation and Next, the part of the external file 51 that has not been copied is copied from this second file path (step S550). Specifically, the embodiment of the present invention adopts the method of continuous copying to improve the efficiency of the recovery copying operation. The processor 150 will store the external file 51 in the physical address of the external storage device 5 based on the percentage of progress in the replication history 113 (ie, the percentage of progress before or when the replication operation is interrupted (or an abnormal situation occurs)). Address to determine the termination address when an abnormal situation occurs. The processor 150 then determines the restoration address according to the termination address. The restoration address is based on formula (1):
Figure 02_image001
…(1) RDC is the restore address, P is the percentage of progress before the interruption recorded in the copy history 113, T is the termination address of the external file 51 stored in the external storage device 5, and I is the external file 51 stored in the external storage device The starting address of 5. Then, the processor 150 can continue the copy operation according to the restored address, and determine whether the copy operation is completed (ie, the progress percentage is 100%) (step S560). If the copy operation has not been completed, the processor 150 continues the copy operation until it is completed.

舉例而言,使用者播放隨身碟(即,外部儲存裝置5)中的音樂檔(即,外部檔案51)。而此音樂檔播放一分鐘後,處理器150開始複製此音樂檔至儲存器110。假設複製作業的進度百分比到百分之35時,使用者不小心將隨身碟拔離電腦系統1。假設音樂檔的檔案大小為10MB,且其區塊起始位址為0×5000,則終止位址為

Figure 02_image003
。處理器150便自隨身碟中位址為0×2935128開始接續複製作業。For example, the user plays the music file (ie, external file 51) in the flash drive (ie, external storage device 5). After the music file is played for one minute, the processor 150 starts to copy the music file to the storage 110. Assuming that the progress percentage of the copy operation reaches 35%, the user accidentally pulls the pen drive away from the computer system 1. Assuming that the file size of the music file is 10MB and its block start address is 0×5000, the end address is
Figure 02_image003
. The processor 150 starts the copy operation from the address 0x2935128 in the flash drive.

另值得注意的是,若步驟S210中處理器150所接收使用者的檔案操作是複製作業,則處理器150會將外部檔案51複製到此複製操作所指定的電腦系統1的第三檔案路徑下,並仍會執行步驟S230的複製作業。由於步驟S230的複製作業可能將外部檔案51儲存於非揮發性記憶體112,結合非揮發性記憶體112的高速存取特性,因此外部檔案51能更快完整儲存到電腦系統1中。而反應於確認外部檔案51已完整複製到使用者的複製操作所指定的第三檔案路徑下,為了避免空間浪費,處理器115會將步驟S230所儲存的第一檔案路徑下的外部檔案51刪除。It is also worth noting that if the file operation of the user received by the processor 150 in step S210 is a copy operation, the processor 150 will copy the external file 51 to the third file path of the computer system 1 specified by the copy operation , And will still execute the copy job in step S230. Since the copying operation in step S230 may store the external file 51 in the non-volatile memory 112, combined with the high-speed access characteristics of the non-volatile memory 112, the external file 51 can be quickly and completely stored in the computer system 1. In response to confirming that the external file 51 has been completely copied to the third file path specified by the user's copy operation, in order to avoid wasting space, the processor 115 deletes the external file 51 under the first file path stored in step S230 .

本揭露的另一範例實施例提出一種電腦程式產品,用以執行上述外部檔案51的容錯處理方法的各個步驟(圖2~圖5所示實施例)。此電腦程式產品包括多個程式指令,且電腦系統1中的處理器150載入並執行這些程式指令之後,可完成上述的容錯處理方法以及實現電腦系統1的功能。Another exemplary embodiment of the present disclosure provides a computer program product for executing the steps of the above-mentioned fault-tolerant processing method of the external file 51 (the embodiments shown in FIGS. 2 to 5 ). The computer program product includes a plurality of program instructions, and after the processor 150 in the computer system 1 loads and executes the program instructions, the above fault-tolerant processing method and the functions of the computer system 1 can be completed.

綜上所述,本發明實施例的電腦系統、其外部檔案的容錯處理方法及電腦程式產品具有以下特點。將開啟的外部檔案暫存到內建儲存器中,且修改所屬程序的檔案來源為前述暫存的檔案路徑,以避免異常情況(例如,無預警拔除外部儲存裝置、外部儲存裝置毀損等)發生所造成的中斷現象。將外部檔案複製到內建硬碟與非揮發性記憶體的中介協調。依據複製歷程來計算復原位址,以接續恢復外部檔案的複製作業,從而提升複製效率。In summary, the computer system, the fault-tolerant processing method of external files and the computer program product of the embodiments of the present invention have the following characteristics. Temporarily open the open external files to the built-in storage, and modify the file source of the associated program to the aforementioned temporary file path to avoid abnormal situations (such as unplugging the external storage device without warning, damage to the external storage device, etc.) The disruption caused. Copy external files to internal hard drive and coordinate with non-volatile memory intermediary. Calculate the recovery address according to the copying process, so as to continue the copying operation of restoring external files, thereby improving copying efficiency.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。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.

1:電腦系統110:儲存器111:硬碟112:非揮發性記憶體113:複製歷程130:傳輸介面150:處理器5:外部儲存裝置51:外部檔案S210~S290、S310~S370、S410~S420、S5、S510~S560:步驟1: Computer system 110: Storage 111: Hard disk 112: Non-volatile memory 113: Copy history 130: Transfer interface 150: Processor 5: External storage device 51: External files S210~S290, S310~S370, S410~ S420, S5, S510~S560: steps

圖1是依據本發明一實施例的系統架構圖。 圖2是依據本發明一實施例外部檔案的容錯處理方法的流程圖。 圖3是依據本發明一實施例的外部檔案暫存的流程圖。 圖4是依據本發明一實施例的複製作業的流程圖。 圖5是依據本發明一實施例的外部檔案容錯還原的流程圖。FIG. 1 is a system architecture diagram according to an embodiment of the invention. 2 is a flowchart of an external file fault-tolerant processing method according to an embodiment of the invention. FIG. 3 is a flowchart of external file temporary storage according to an embodiment of the invention. 4 is a flowchart of a copy operation according to an embodiment of the invention. 5 is a flowchart of external file fault-tolerant restoration according to an embodiment of the invention.

S210~S290:步驟 S210~S290: Steps

Claims (10)

一種外部檔案的容錯處理方法,適用於一電腦系統,而該容錯處理方法包括: 對來自一外部儲存裝置的外部檔案進行一檔案操作,其中該外部儲存裝置是可插拔地連接該電腦系統; 將該外部檔案複製(copy)到該電腦系統的一第一檔案路徑下; 搜尋該外部檔案所屬的至少一程序(process); 將該至少一程序的檔案來源修改成該電腦系統的該第一檔案路徑;以及 反應該檔案操作的異常情況,接續進行該檔案操作而不中斷。A fault-tolerant processing method for external files is suitable for a computer system, and the fault-tolerant processing method includes: performing a file operation on an external file from an external storage device, wherein the external storage device is pluggably connected to the computer system; Copy the external file to a first file path of the computer system; search for at least one process to which the external file belongs; modify the file source of the at least one program to the first file of the computer system File path; and reflect the abnormal situation of the file operation, continue the file operation without interruption. 如申請專利範圍第1項所述的外部檔案的容錯處理方法,其將該外部檔案複製到該電腦系統的該第一檔案路徑下的步驟包括: 判斷該電腦系統是否有一非揮發性(non-volatility)記憶體; 判斷該非揮發性記憶體的剩餘儲存空間;以及 依據該非揮發性記憶體的剩餘儲存空間,決定將該外部檔案複製到該非揮發性記憶體及該電腦系統的硬碟中的一者。The fault-tolerant processing method for an external file as described in item 1 of the scope of patent application, the steps of copying the external file to the first file path of the computer system include: determining whether the computer system has a non-volatile (non- volatility) memory; determine the remaining storage space of the non-volatile memory; and according to the remaining storage space of the non-volatile memory, decide to copy the external file to the non-volatile memory and a hard disk of the computer system By. 如申請專利範圍第1項所述的外部檔案的容錯處理方法,其中將該外部檔案複製到該電腦系統的該第一檔案路徑下的步驟包括: 將該外部檔案複製到該電腦系統並記錄該複製作業的一複製歷程,其中該複製歷程相關於一進度百分比及該外部檔案儲存在該外部儲存裝置的一第二檔案路徑;以及 依據該複製歷程接續複製該外部檔案。A fault-tolerant processing method for an external file as described in item 1 of the scope of the patent application, wherein the step of copying the external file to the first file path of the computer system includes: copying the external file to the computer system and recording the A copy history of the copy operation, wherein the copy history is related to a progress percentage and a second file path where the external file is stored in the external storage device; and the external file is continuously copied according to the copy history. 如申請專利範圍第3項所述的外部檔案的容錯處理方法,其中依據該複製歷程接續複製該外部檔案的步驟包括: 基於該進度百分比及該外部檔案的起始位址決定一終止位址;以及 依據該終止位址接續自該第二檔案路徑複製該外部檔案中尚未複製的部分。The fault-tolerant processing method of an external file as described in item 3 of the patent application scope, wherein the step of successively copying the external file according to the copying process includes: determining a termination address based on the progress percentage and the starting address of the external file; And continue to copy the part of the external file that has not been copied from the second file path according to the termination address. 如申請專利範圍第1項所述的外部檔案的容錯處理方法,其中該檔案操作係一複製操作,而對來自該外部儲存裝置的外部檔案進行該檔案操作包括: 將該外部檔案複製到該複製操作所指定的該電腦系統的一第三檔案路徑下;而將該外部檔案複製到該電腦系統的該第一檔案路徑下的步驟之後,更包括: 反應於確認該外部檔案已完整複製到該第三檔案路徑下,將該第一檔案路徑下的該外部檔案刪除。A fault-tolerant processing method for an external file as described in item 1 of the patent application scope, wherein the file operation is a copy operation, and performing the file operation on the external file from the external storage device includes: copying the external file to the copy Operate the designated third file path of the computer system; and after copying the external file to the first file path of the computer system, the method further includes: In response to confirming that the external file has been completely copied to the Under the third file path, delete the external file under the first file path. 一種電腦系統,包括: 一傳輸介面,用於連接一外部儲存裝置,其中該外部儲存裝置儲存有至少一外部檔案; 至少一儲存器;以及 一處理器,耦接該傳輸介面及該至少一儲存器,並對來自該外部儲存裝置的該至少一外部檔案進行一檔案操作,該處理器將該至少一外部檔案複製到該至少一儲存器的一第一檔案路徑下,搜尋該至少一外部檔案所屬的至少一程序,並將該至少一程序的檔案來源修改成該至少一儲存器的該第一檔案路徑,且反應於該檔案操作的異常情況,該處理器接續進行該檔案操作而不中斷。A computer system includes: a transmission interface for connecting an external storage device, wherein the external storage device stores at least one external file; at least one storage; and a processor, coupled to the transmission interface and the at least one storage And perform a file operation on the at least one external file from the external storage device, the processor copies the at least one external file to a first file path of the at least one storage, and searches for the at least one external file Belonging to at least one program, and modifying the file source of the at least one program to the first file path of the at least one storage, and in response to the abnormality of the file operation, the processor continues the file operation without interruption . 如申請專利範圍第6項所述的電腦系統,其中該電腦系統更包括至少一儲存器,且該至少一儲存器包括一硬碟及一非揮發性記憶體中的至少一者,而該處理器判斷是否有該非揮發性記憶體,判斷該非揮發性記憶體的剩餘儲存空間,並依據該非揮發性記憶體的剩餘儲存空間,決定將該至少一外部檔案複製到該非揮發性記憶體及該硬碟中的一者。The computer system according to item 6 of the patent application scope, wherein the computer system further includes at least one storage, and the at least one storage includes at least one of a hard disk and a non-volatile memory, and the processing Determine whether there is the non-volatile memory, determine the remaining storage space of the non-volatile memory, and decide to copy the at least one external file to the non-volatile memory and the hard disk according to the remaining storage space of the non-volatile memory One of the dishes. 如申請專利範圍第6項所述的電腦系統,其中該檔案操作是一複製作業,而該處理器將該至少一外部檔案複製到該至少一儲存器並記錄該複製作業的一複製歷程,其中該複製歷程相關於一進度百分比及該至少一外部檔案儲存在該外部儲存裝置的一第二檔案路徑,該處理器並基於該進度百分比及該至少一外部檔案的起始位址決定一終止位址,且依據該終止位址接續自該第二檔案路徑複製該至少一外部檔案中尚未複製的部分。The computer system as described in item 6 of the patent application scope, wherein the file operation is a copy operation, and the processor copies the at least one external file to the at least one storage and records a copy history of the copy operation, wherein The copy process is related to a progress percentage and a second file path where the at least one external file is stored in the external storage device, and the processor determines a termination bit based on the progress percentage and the start address of the at least one external file Address, and continue to copy the part of the at least one external file that has not been copied from the second file path according to the termination address. 如申請專利範圍第6項所述的電腦系統,其中該檔案操作是一複製作業,而該處理器將該至少一外部檔案複製到該複製操作所指定的該電腦系統的一第三檔案路徑下,且反應於確認該至少一外部檔案已完整複製到該第三檔案路徑下,該處理器將該第一檔案路徑下的該至少一外部檔案刪除。The computer system as described in item 6 of the patent application scope, wherein the file operation is a copy operation, and the processor copies the at least one external file to a third file path of the computer system specified by the copy operation , And in response to confirming that the at least one external file has been completely copied to the third file path, the processor deletes the at least one external file under the first file path. 一種電腦程式產品,經由一電腦系統之處理器載入程式以執行: 對來自一外部儲存裝置的外部檔案進行一檔案操作,其中該外部儲存裝置是可插拔地連接該電腦系統; 將該外部檔案複製到該電腦系統的一第一檔案路徑下; 搜尋該外部檔案所屬的至少一程序; 將該至少一程序的檔案來源修改成該電腦系統的該第一檔案路徑;以及 反應該檔案操作的異常情況,接續進行該檔案操作而不中斷。A computer program product that is loaded by a processor of a computer system to execute a program: perform a file operation on an external file from an external storage device, wherein the external storage device is pluggable connected to the computer system; connect the external Copy the file to a first file path of the computer system; search for at least one program to which the external file belongs; modify the file source of the at least one program to the first file path of the computer system; and reflect the operation of the file In case of abnormal situation, continue to operate the file without interruption.
TW107131207A 2018-09-05 2018-09-05 Computer system, fault tolerance processing method for external file and computer program product TW202011192A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107131207A TW202011192A (en) 2018-09-05 2018-09-05 Computer system, fault tolerance processing method for external file and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107131207A TW202011192A (en) 2018-09-05 2018-09-05 Computer system, fault tolerance processing method for external file and computer program product

Publications (1)

Publication Number Publication Date
TW202011192A true TW202011192A (en) 2020-03-16

Family

ID=70766776

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107131207A TW202011192A (en) 2018-09-05 2018-09-05 Computer system, fault tolerance processing method for external file and computer program product

Country Status (1)

Country Link
TW (1) TW202011192A (en)

Similar Documents

Publication Publication Date Title
JP6219305B2 (en) System and method for restoring application data
US11422907B2 (en) Disconnected operation for systems utilizing cloud storage
US9317374B2 (en) Performing a background copy process during a backup operation
WO2013157103A1 (en) Storage device and storage control method
US8095510B2 (en) Data restoration in a storage system using multiple restore points
WO2018006587A1 (en) File storage method, terminal, and storage medium
US20170132095A1 (en) Data restoration
US8769627B1 (en) Systems and methods for validating ownership of deduplicated data
US20160239221A1 (en) Systems and methods for increasing restore speeds of backups stored in deduplicated storage systems
WO2013170702A1 (en) File processing method based on snapshot and solid state disk with snapshot function
EP2320313B1 (en) Method and system for offline data access on computer systems
US8311986B2 (en) Determining database record content changes
CN110597660A (en) Data backup method, device, equipment and medium for virtual machine
US10437784B2 (en) Method and system for endurance enhancing, deferred deduplication with hardware-hash-enabled storage device
WO2014103037A1 (en) Information processing device, information processing method, and information processing program
US7594043B2 (en) Reducing dismount time for mass storage class devices
TW202011192A (en) Computer system, fault tolerance processing method for external file and computer program product
US11003380B1 (en) Minimizing data transfer during snapshot-based replication
TWI698740B (en) Deployment method of recovery images and electronic device using the same
WO2017016139A1 (en) System recovery method and apparatus
CN110955388A (en) Storage server, data storage method and device thereof and storage medium
WO2018233216A1 (en) Method and electronic device for processing data
JP2008242524A (en) File management device, file management method, program and computer-readable recording medium
WO2014019145A1 (en) Method and apparatus for metadata processing
TWI528190B (en) Heterogeneous storing server and file storing method thereof