TWI483108B - Method and system for storing and accessing data of hard disk - Google Patents

Method and system for storing and accessing data of hard disk Download PDF

Info

Publication number
TWI483108B
TWI483108B TW100126920A TW100126920A TWI483108B TW I483108 B TWI483108 B TW I483108B TW 100126920 A TW100126920 A TW 100126920A TW 100126920 A TW100126920 A TW 100126920A TW I483108 B TWI483108 B TW I483108B
Authority
TW
Taiwan
Prior art keywords
data
hard disk
root directory
storage area
storing
Prior art date
Application number
TW100126920A
Other languages
Chinese (zh)
Other versions
TW201305816A (en
Inventor
Jun-Jia Lin
Jia Li
Original Assignee
Hon Hai Prec Ind Co Ltd
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 Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Publication of TW201305816A publication Critical patent/TW201305816A/en
Application granted granted Critical
Publication of TWI483108B publication Critical patent/TWI483108B/en

Links

Landscapes

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

Description

硬碟資料存取方法及系統Hard disk data access method and system

本發明涉及一種資料存取方法及系統,特別涉及一種硬碟資料存取方法及系統。The present invention relates to a data access method and system, and more particularly to a hard disk data access method and system.

傳統硬碟一般以512Byte為單元等分磁軌得到磁區,因此每個磁區的儲存容量為512Byte。目前許多種磁區儲存容量不為512Byte的硬碟已逐漸問世,如磁區的儲存容量為520Byte的硬碟、磁區儲存容量為4096Byte的硬碟,等等。由於相容性的問題,一些作業系統如Windows XP、Linux等作業系統中沒有磁區儲存容量不為512Byte的硬碟對應的驅動程式,因而這些作業系統不支援對磁區儲存容量不為512Byte的硬碟的資料存取。雖然修改作業系統中硬碟對應的驅動程式可以實現對磁區儲存容量不為512Byte的硬碟的資料存取,但隨著硬碟因磁區儲存容量的不同而種類越來越多,修改硬碟對應的驅動程式也很難使作業系統支援對所有種類的硬碟的資料存取。A conventional hard disk generally divides a magnetic track into 512 Bytes to obtain a magnetic region, so the storage capacity of each magnetic region is 512 Bytes. At present, many kinds of hard disks with a magnetic storage capacity of less than 512 bytes have been gradually introduced, such as a hard disk with a storage capacity of 520 Bytes, a hard disk with a magnetic storage capacity of 4096 Bytes, and the like. Due to the compatibility problem, some operating systems, such as Windows XP and Linux, do not have a hard disk storage driver with a magnetic storage capacity of 512 Bytes. Therefore, these operating systems do not support a storage capacity of 512 Bytes. Data access to the hard drive. Although the driver corresponding to the hard disk in the modified operating system can realize the data access of the hard disk whose magnetic storage capacity is not 512 Byte, as the hard disk is more and more due to the different storage capacity of the magnetic area, the hard disk is modified. The driver corresponding to the disc also makes it difficult for the operating system to support data access to all types of hard drives.

鑒於以上內容,有必要提供一種硬碟存取方法及系統,可以以磁區儲存容量為預設值(如512Byte)的第一硬碟作為資料中轉站,實現作業系統對磁區儲存容量不為該預設值的第二硬碟的資料存取。In view of the above, it is necessary to provide a hard disk access method and system, which can use the first hard disk whose magnetic storage capacity is a preset value (such as 512 Byte) as a data transfer station, so that the operating system does not store the magnetic area. Data access for the second hard disk of the preset value.

一種硬碟資料存取方法,包括以下步驟:建立步驟:在電腦的磁區儲存容量為預設值的第一硬碟中建立一個第二硬碟根目錄,並在磁區儲存容量不為該預設值的第二硬碟中建立一個記錄表,該記錄表用於記錄各個資料在該第二硬碟中的儲存區域;及第二硬碟資料存取步驟:當用戶向該第二硬碟根目錄中儲存資料、訪問資料或刪除資料時,以該第一硬碟為資料中轉站將該資料儲存至該第二硬碟中、或從該第二硬碟中訪問該資料或刪除該資料。A method for accessing a hard disk data, comprising the steps of: establishing a second hard disk root directory in a first hard disk whose storage capacity of the computer is a preset value, and storing the capacity in the magnetic area is not the same a second hard disk of a preset value is used to establish a record table for recording a storage area of each data in the second hard disk; and a second hard disk data access step: when the user is to the second hard disk When storing data, accessing data or deleting data in the root directory, the first hard disk is used as a data transfer station to store the data to the second hard disk, or to access the data from the second hard disk or delete the data. The information.

一種硬碟資料存取系統,包括:建立模組,用於在電腦的磁區儲存容量為預設值的第一硬碟中建立一個第二硬碟根目錄,並在磁區儲存容量不為該預設值的第二硬碟中建立一個記錄表,該記錄表用於記錄各個資料在該第二硬碟中的儲存區域;及第二硬碟資料存取模組,用於當用戶向該第二硬碟根目錄中儲存資料、訪問資料或刪除資料時,以該第一硬碟為資料中轉站將該資料儲存至該第二硬碟中、或從該第二硬碟中訪問該資料或刪除該資料。A hard disk data access system includes: a module for establishing a second hard disk root directory in a first hard disk with a predetermined storage value of a magnetic area of the computer, and the storage capacity in the magnetic area is not a second hard disk of the preset value is used to establish a record table for recording a storage area of each data in the second hard disk; and a second hard disk data access module for when the user When the second hard disk root directory stores data, accesses data, or deletes the data, the first hard disk is used as a data transfer station to store the data to the second hard disk or access the second hard disk. The information or delete the information.

相較於習知技術,本發明硬碟存取方法及系統,可以以磁區儲存容量為預設值(如512Byte)的第一硬碟作為資料中轉站,實現作業系統對磁區儲存容量不為該預設值的第二硬碟的資料存取。Compared with the prior art, the hard disk access method and system of the present invention can use the first hard disk whose magnetic area storage capacity is a preset value (for example, 512 Byte) as a data transfer station, and realize the operating system to the magnetic area storage capacity. Data access of the second hard disk that is not the preset value.

參閱圖1所示,係本發明硬碟資料存取系統較佳實施方式的運行環境圖。在本實施方式中,該硬碟資料存取系統10應用於電腦100中,該電腦100包括一個磁區儲存容量為512位元組(Byte)的第一硬碟(以下簡稱“512硬碟”)1,以及一個磁區儲存容量不為512Byte的第二硬碟(以下簡稱“非512硬碟”)2。該512硬碟1與該非512硬碟2通信連接。Referring to FIG. 1, there is shown an operating environment diagram of a preferred embodiment of the hard disk data access system of the present invention. In the present embodiment, the hard disk data access system 10 is applied to a computer 100. The computer 100 includes a first hard disk having a magnetic area storage capacity of 512 bytes (hereinafter referred to as "512 hard disk". 1), and a second hard disk (hereinafter referred to as "non-512 hard disk") 2 whose magnetic storage capacity is not 512 Bytes. The 512 hard disk 1 is communicatively coupled to the non-512 hard disk 2.

所述硬碟資料存取系統10儲存於該512硬碟1中,該512硬碟1中還安裝有作業系統11。該作業系統11中有512硬碟1對應的驅動程式,該驅動程式使作業系統11可以對512硬碟1中的資料進行存取。同時,由於作業系統11中沒有非512硬碟2對應的驅動程式,作業系統11無法直接對非512硬碟2中的資料進行存取。所述資料為目錄或檔案。該目錄為樹形結構,即父目錄可包含子目錄,子目錄中可包含檔案。該檔案可以是音頻、文本文檔、視頻等。The hard disk data access system 10 is stored in the 512 hard disk 1. The operating system 11 is also installed in the 512 hard disk 1. The operating system 11 has a driver corresponding to 512 hard disk 1, which enables the operating system 11 to access data in the 512 hard disk 1. At the same time, since there is no driver corresponding to the non-512 hard disk 2 in the operating system 11, the operating system 11 cannot directly access the data in the non-512 hard disk 2. The information is a catalog or an archive. The directory is a tree structure, that is, the parent directory can contain subdirectories, and the subdirectories can contain files. The file can be audio, text documents, videos, and the like.

在512硬碟1中建立有一個非512硬碟根目錄12(或稱為第二硬碟根目錄12),該非512硬碟根目錄12為非512硬碟2的對應視窗,即在用戶看來,非512硬碟2為512硬碟1中的一個檔案夾,即非512硬碟根目錄12。若用戶向該非512硬碟根目錄12中儲存資料,則表示用戶希望向該非512硬碟2中儲存資料。A non-512 hard disk root directory 12 (or a second hard disk root directory 12) is created in the 512 hard disk 1. The non-512 hard disk root directory 12 is a corresponding window of the non-512 hard disk 2, that is, viewed by the user. Come, non-512 hard disk 2 is a folder in 512 hard disk 1, that is, non-512 hard disk root directory 12. If the user stores the data in the non-512 hard disk root directory 12, it means that the user wishes to store the data in the non-512 hard disk 2.

硬碟資料存取系統10用於建立所述非512硬碟根目錄12,以及當用戶向該非512硬碟根目錄12中存取資料時,以512硬碟1為資料中轉站將該資料存入非512硬碟2中,或從非512硬碟2中讀取該資料。The hard disk data access system 10 is configured to establish the non-512 hard disk root directory 12, and when the user accesses the data to the non-512 hard disk root directory 12, the data is transferred by using the 512 hard disk 1 as a data transfer station. Save it to non-512 hard disk 2 or read it from non-512 hard disk 2.

參閱圖2所示,係本發明硬碟資料存取系統較佳實施方式的功能模組圖。該硬碟資料存取系統10包括建立模組101、獲取模組102、第一判斷模組103、查找模組104、第一轉移模組105、記錄模組106、查詢模組107、第二轉移模組108、第二判斷模組109和刪除模組110。本實施方式中所稱的模組是完成一特定功能的程式段,比程式更適合於描述軟體在電腦100中的執行過程。在其他實施方式中,也可以將模組102-110合在一起命名為一個模組,如第二硬碟資料存取模組。Referring to FIG. 2, it is a functional block diagram of a preferred embodiment of the hard disk data access system of the present invention. The hard disk data access system 10 includes a setup module 101, an acquisition module 102, a first determination module 103, a lookup module 104, a first transfer module 105, a recording module 106, an inquiry module 107, and a second The transfer module 108, the second determination module 109, and the deletion module 110. The module referred to in this embodiment is a program segment that performs a specific function, and is more suitable for describing the execution process of the software in the computer 100 than the program. In other embodiments, the modules 102-110 may also be collectively named as one module, such as a second hard disk data access module.

建立模組101用於在512硬碟1中建立所述非512硬碟根目錄12,並在非512硬碟2中建立一個記錄表20。記錄表20的初始內容為空。由於非512硬碟2以鏈式儲存的方式儲存資料,因此一個資料可能儲存在非512硬碟2的若干個儲存區域中,記錄表20用於記錄各個資料在非512硬碟2的各儲存區域的起始位址和終止位址。The setup module 101 is configured to create the non-512 hard disk root directory 12 in the 512 hard disk 1 and create a recording table 20 in the non-512 hard disk 2. The initial content of the record table 20 is empty. Since the non-512 hard disk 2 stores the data in a chain storage manner, one data may be stored in a plurality of storage areas of the non-512 hard disk 2, and the record table 20 is used to record the respective data in the non-512 hard disk 2 storage. The start and end addresses of the area.

參閱圖3所示,係記錄表20的一個示例圖。該記錄表20中記錄著目錄A在非512硬碟2中的儲存區域。該目錄A中包含檔案a,該檔案a儲存在非512硬碟2中的兩個儲存區域中,第一個儲存區域的起始位址為**00,終止位址為**01,而第二個儲存區域的起始位址為**05,終止位址為**07。Referring to FIG. 3, an example diagram of the record table 20 is shown. The storage area of the directory A in the non-512 hard disk 2 is recorded in the record table 20. The directory A contains an archive a, which is stored in two storage areas of the non-512 hard disk 2. The first storage area has a starting address of **00 and a termination address of **01. The starting address of the second storage area is **05 and the ending address is **07.

獲取模組102用於當用戶向非512硬碟根目錄12中儲存第一資料時,獲取該第一資料的名稱和大小,並為該第一資料分配相應的ID號。該第一資料可以為目錄或檔案。若該第一資料為檔案,則獲取模組102為該檔案分配相應的ID號,若該第一資料為目錄,則獲取模組102為該目錄以及該目錄下的所有子目錄和檔案都分別分配相應的ID號。The obtaining module 102 is configured to: when the user stores the first data in the non-512 hard disk root directory 12, obtain the name and size of the first data, and assign a corresponding ID number to the first data. The first material can be a directory or a file. If the first data is a file, the obtaining module 102 allocates a corresponding ID number to the file. If the first data is a directory, the obtaining module 102 is the directory and all subdirectories and files under the directory are respectively Assign the corresponding ID number.

第一判斷模組103用於讀取記錄表20中的內容,並根據該內容和該第一資料的大小判斷非512硬碟2是否有足夠的可用儲存空間儲存該第一資料。具體而言,由於記錄表20中記錄了儲存在非512硬碟2中的所有資料在非512硬碟2中的儲存區域,即記錄表20記錄了非512硬碟2已使用的儲存空間,將非512硬碟2的總儲存空間減去該已使用的儲存空間,即可得到非512硬碟2的可用儲存空間。若非512硬碟2的可用儲存空間大於該第一資料的大小,則判斷非512硬碟2有足夠的可用儲存空間儲存該第一資料。The first determining module 103 is configured to read the content in the record table 20, and determine, according to the content and the size of the first data, whether the non-512 hard disk 2 has sufficient available storage space to store the first data. Specifically, since the record table 20 records the storage area of all the data stored in the non-512 hard disk 2 in the non-512 hard disk 2, that is, the record table 20 records the storage space used by the non-512 hard disk 2, By subtracting the used storage space from the total storage space of the non-512 hard disk 2, the available storage space of the non-512 hard disk 2 can be obtained. If the available storage space of the non-512 hard disk 2 is larger than the size of the first data, it is determined that the non-512 hard disk 2 has enough available storage space to store the first data.

查找模組104用於當非512硬碟2有足夠的可用儲存空間儲存該第一資料時,根據記錄表20的內容從非512硬碟2中找出用於儲存該第一資料的儲存區域。The searching module 104 is configured to find a storage area for storing the first data from the non-512 hard disk 2 according to the content of the record table 20 when the non-512 hard disk 2 has sufficient available storage space to store the first data. .

根據記錄表20中非512硬碟2已使用的儲存空間的記錄,可計算出非512硬碟2的可用儲存空間。由於非512硬碟2中的資料可能以不連續的方式儲存,因此所述可用儲存空間可能由不連續的一系列儲存區塊組成。例如圖3所示,檔案a在非512硬碟2中的第一個儲存區域的起始位址為**00,終止位址為**01,第二個儲存區域的起始位址為**05,終止位址為**07,在該第一個儲存區域和第二個儲存區域之間因沒有儲存資料而形成一個儲存區塊,該儲存區塊的起始位址即為該第一個儲存區域的終止位址,而該儲存區塊的終止位址即為該第二個儲存區域的起始位址。According to the record of the storage space used by the non-512 hard disk 2 in the record table 20, the available storage space of the non-512 hard disk 2 can be calculated. Since the data in the non-512 hard disk 2 may be stored in a discontinuous manner, the available storage space may consist of a series of discrete storage blocks. For example, as shown in FIG. 3, the starting address of the first storage area of the file a in the non-512 hard disk 2 is **00, the ending address is **01, and the starting address of the second storage area is **05, the termination address is **07, and a storage block is formed between the first storage area and the second storage area because no data is stored, and the starting address of the storage block is The termination address of the first storage area, and the termination address of the storage block is the start address of the second storage area.

查找模組104根據記錄表20的記錄可分別得出該一系列儲存區塊的起始位址和終止位址,從而遍曆該一系列儲存區塊。當有儲存區塊足夠儲存該第一資料時,查找模組104根據該第一資料的大小從該儲存區塊中找出一塊區域作為該資料的儲存區域,例如該儲存區域的起始位址為該儲存區塊的起始位址,該儲存區域的終止位址為該儲存區域的起始位址加上該第一資料的大小。若該一系列儲存區塊中沒有任何一個儲存區塊足夠儲存該第一資料,則查找模組104從該一系列儲存區塊找出若干個儲存區塊,該若干個儲存區塊組成的儲存空間足夠儲存該第一資料,查找模組104根據該第一資料的大小從該若干個儲存區塊中找出用於儲存該資料的儲存區域。The search module 104 can respectively derive a start address and a stop address of the series of storage blocks according to the record of the record table 20, thereby traversing the series of storage blocks. When a storage block is sufficient for storing the first data, the search module 104 finds an area from the storage block as a storage area of the data according to the size of the first data, for example, a starting address of the storage area. For the starting address of the storage block, the ending address of the storage area is the starting address of the storage area plus the size of the first data. If no storage block in the series of storage blocks is sufficient for storing the first data, the search module 104 finds a plurality of storage blocks from the series of storage blocks, and the storage of the plurality of storage blocks The space is sufficient for storing the first data, and the search module 104 finds a storage area for storing the data from the plurality of storage blocks according to the size of the first data.

第一轉移模組105用於從非512硬碟根目錄12中讀取該第一資料,透過SCSI(Small Computer System Interface,小型電腦系統介面)命令將該第一資料轉移到查找模組104找到的用於儲存該第一資料的儲存區域中,並在非512硬碟根目錄12中儲存該第一資料的標記,該標記包括第一資料的ID號和名稱等屬性。當用戶訪問第一資料的標記時,即可訪問該第一資料。例如,該第一資料是一段視頻,第一資料的標記是該視頻的圖示,當用戶點擊該圖示時,可以啟動播放該視頻。The first transfer module 105 is configured to read the first data from the non-512 hard disk root directory 12, and transfer the first data to the search module 104 through a SCSI (Small Computer System Interface) command. The storage area for storing the first data, and storing the mark of the first data in the non-512 hard disk root directory 12, the mark includes attributes such as an ID number and a name of the first material. When the user accesses the mark of the first material, the first data can be accessed. For example, the first material is a video, and the mark of the first data is an icon of the video, and when the user clicks on the icon, the video can be started to be played.

記錄模組106用於將該第一資料的名稱和ID號,以及該第一資料在非512硬碟2中的所有儲存區域的起始位址和終止位址記錄在記錄表20中。The recording module 106 is configured to record the name and ID number of the first material and the start address and the end address of all the storage areas of the first data in the non-512 hard disk 2 in the record table 20.

獲取模組102還用於當用戶訪問非512硬碟根目錄12中的第二資料的標記時,獲取該第二資料的ID號。該訪問包括查看或修改該第二資料。The obtaining module 102 is further configured to acquire the ID number of the second data when the user accesses the mark of the second material in the non-512 hard disk root directory 12. The access includes viewing or modifying the second material.

查詢模組107用於根據該第二資料的ID號在記錄表20中查詢該第二資料在非512硬碟2中所有儲存區域的起始位址和終止位址。The query module 107 is configured to query, in the record table 20, the start address and the end address of all the storage areas of the second data in the non-512 hard disk 2 according to the ID number of the second data.

第二轉移模組108用於根據該第二資料在非512硬碟2中所有儲存區域的起始位址和終止位址從非512硬碟2中讀取該第二資料,並將該第二資料轉移到非512硬碟根目錄12中,供用戶對該第二資料進行訪問。The second transfer module 108 is configured to read the second data from the non-512 hard disk 2 according to the start address and the end address of all the storage areas in the non-512 hard disk 2 according to the second data, and the second data The second data is transferred to the non-512 hard disk root directory 12 for the user to access the second data.

第二判斷模組109用於當用戶停止訪問該第二資料時,例如用戶關閉作為第二資料的視頻或應用程式等,判斷該第二資料在非512硬碟根目錄12中是否已被修改。The second determining module 109 is configured to determine, when the user stops accessing the second data, for example, the user closes the video or application as the second material, and determines whether the second data has been modified in the non-512 hard disk root directory 12. .

第一轉移模組105還用於當第二判斷模組109判斷該第二資料在非512硬碟根目錄12中已被修改時,將修改後的該第二資料轉移到非512硬碟2中,並由記錄模組106修改該第二資料在記錄表20中的記錄,包括該第二資料在非512硬碟2中的儲存區域的起始位址和終止位址。The first transfer module 105 is further configured to: when the second determining module 109 determines that the second data has been modified in the non-512 hard disk root directory 12, transfer the modified second data to the non-512 hard disk 2 And recording, by the recording module 106, the record of the second data in the record table 20, including the start address and the stop address of the storage area of the second data in the non-512 hard disk 2.

第一轉移模組105還用於當第二判斷模組109判斷該第二資料在非512硬碟根目錄12中未被修改時,直接將該第二資料轉移到非512硬碟2中。The first transfer module 105 is further configured to directly transfer the second data to the non-512 hard disk 2 when the second determining module 109 determines that the second data is not modified in the non-512 hard disk root directory 12.

獲取模組102還用於當用戶刪除非512硬碟根目錄12中的第三資料的標記時,獲取該第三資料的ID號。The obtaining module 102 is further configured to acquire the ID number of the third data when the user deletes the mark of the third material in the non-512 hard disk root directory 12.

查詢模組107還用於根據該第三資料的ID號在記錄表20中查詢該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址。The query module 107 is further configured to query, in the record table 20, the start address and the end address of all the storage areas of the third data in the non-512 hard disk 2 according to the ID number of the third data.

刪除模組110用於根據該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址,在非512硬碟2中找到並刪除該第三資料,同時刪除該第三資料在記錄表20中的所有記錄,包括該第三資料的名稱和ID號,以及該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址。The deleting module 110 is configured to find and delete the third data in the non-512 hard disk 2 according to the start address and the ending address of all the storage areas in the non-512 hard disk 2 according to the third data, and delete the third data. All the records in the record table 20 include the name and ID number of the third material, and the start address and the end address of all the storage areas of the third data in the non-512 hard disk 2.

參閱圖4所示,係本發明硬碟資料存取方法儲存資料較佳實施方式的流程圖。Referring to FIG. 4, it is a flow chart of a preferred embodiment of storing data in the hard disk data access method of the present invention.

在進入步驟S11前,建立模組101先在512硬碟1中建立所述非512硬碟根目錄12,並在非512硬碟2中建立記錄表20。該記錄表20的初始內容為空。該記錄表20用於記錄各個資料在非512硬碟2的各儲存區域的起始位址和終止位址。Before proceeding to step S11, the setup module 101 first creates the non-512 hard disk root directory 12 in the 512 hard disk 1, and creates the record table 20 in the non-512 hard disk 2. The initial content of the record table 20 is empty. The record table 20 is used to record the start address and the end address of each data in each storage area of the non-512 hard disk 2.

步驟S11,當用戶向非512硬碟根目錄12中儲存第一資料時,獲取模組102獲取該第一資料的名稱和大小,並為該第一資料分配相應的ID號。In step S11, when the user stores the first data in the non-512 hard disk root directory 12, the obtaining module 102 acquires the name and size of the first data, and assigns a corresponding ID number to the first data.

步驟S12,第一判斷模組103讀取記錄表20中的內容,並根據該內容和該第一資料的大小判斷非512硬碟2是否有足夠的可用儲存空間儲存該第一資料。若非512硬碟2有足夠的可用儲存空間儲存該第一資料,則進入步驟S13,若非512硬碟2沒有足夠的可用儲存空間儲存該第一資料,則結束流程。In step S12, the first determining module 103 reads the content in the record table 20, and determines whether the non-512 hard disk 2 has sufficient available storage space to store the first data according to the content and the size of the first data. If the non-512 hard disk 2 has enough available storage space to store the first data, the process proceeds to step S13. If the non-512 hard disk 2 does not have enough available storage space to store the first data, the process ends.

步驟S13,查找模組104根據記錄表20的內容從非512硬碟2中找出用於儲存該第一資料的儲存區域。In step S13, the search module 104 finds a storage area for storing the first data from the non-512 hard disk 2 according to the content of the record table 20.

步驟S14,第一轉移模組105從非512硬碟根目錄12中讀取該第一資料,透過SCSI命令將該第一資料轉移到所述用於儲存該第一資料的儲存區域,並在非512硬碟根目錄12中儲存該第一資料標記。Step S14, the first transfer module 105 reads the first data from the non-512 hard disk root directory 12, and transfers the first data to the storage area for storing the first data through a SCSI command, and The first data tag is stored in the non-512 hard disk root directory 12.

步驟S15,記錄模組106將該第一資料的名稱和ID號,以及該第一資料在非512硬碟2中的所有儲存區域的起始位址和終止位址記錄在記錄表20中。In step S15, the recording module 106 records the name and ID number of the first material and the start address and the end address of all the storage areas of the first data in the non-512 hard disk 2 in the record table 20.

參閱圖5所示,係本發明硬碟資料存取方法訪問資料較佳實施方式的流程圖。Referring to FIG. 5, it is a flow chart of a preferred embodiment of the hard disk data access method access data of the present invention.

步驟S21,當訪問非512硬碟根目錄12中的第二資料的標記時,獲取模組102獲取該第二資料的ID號。In step S21, when accessing the mark of the second material in the non-512 hard disk root directory 12, the obtaining module 102 acquires the ID number of the second data.

步驟S22,查詢模組107根據該第二資料的ID號在記錄表20中查詢該第二資料在非512硬碟2中所有儲存區域的起始位址和終止位址。In step S22, the query module 107 queries the record table 20 for the start address and the end address of all the storage areas of the second data in the non-512 hard disk 2 according to the ID number of the second data.

步驟S23,第二轉移模組108根據該第二資料在非512硬碟2中所有儲存區域的起始位址和終止位址從非512硬碟2中讀取該第二資料,並將該第二資料轉移到非512硬碟根目錄12中,供用戶對該第二資料進行訪問。Step S23, the second transfer module 108 reads the second data from the non-512 hard disk 2 according to the start address and the end address of all the storage areas in the non-512 hard disk 2 according to the second data, and the The second data is transferred to the non-512 hard disk root directory 12 for the user to access the second data.

步驟S24,當用戶停止訪問該第二資料時,第二判斷模組109判斷該第二資料在非512硬碟根目錄12中是否已被修改。若該第二資料在非512硬碟根目錄12中已被修改,則進入步驟S25。若該第二資料在非512硬碟根目錄12中未被修改,則進入步驟S26。Step S24, when the user stops accessing the second data, the second determining module 109 determines whether the second data has been modified in the non-512 hard disk root directory 12. If the second material has been modified in the non-512 hard disk root directory 12, the process proceeds to step S25. If the second data has not been modified in the non-512 hard disk root directory 12, the process proceeds to step S26.

步驟S25,第一轉移模組105將修改後的該第二資料轉移到非512硬碟2,並由記錄模組106修改該第二資料在記錄表20中的記錄,包括該第二資料在非512硬碟2中的儲存區域的起始位址和終止位址。In step S25, the first transfer module 105 transfers the modified second data to the non-512 hard disk 2, and the record module 106 modifies the record of the second data in the record table 20, including the second data. The start address and the end address of the storage area in the non-512 hard disk 2.

步驟S26,第一轉移模組105直接將該第二資料轉移到非512硬碟2中。In step S26, the first transfer module 105 directly transfers the second data to the non-512 hard disk 2.

參閱圖6所示,係本發明硬碟資料存取方法刪除資料較佳實施方式的流程圖。Referring to FIG. 6, a flow chart of a preferred embodiment of the method for deleting data in the hard disk data access method of the present invention is shown.

步驟S31,當用戶刪除非512硬碟根目錄12中的第三資料的標記時,獲取模組102獲取該第三資料的ID號。In step S31, when the user deletes the mark of the third material in the non-512 hard disk root directory 12, the obtaining module 102 acquires the ID number of the third data.

步驟S32,查詢模組107根據該第三資料的ID號在記錄表20中查詢該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址。In step S32, the query module 107 queries the record table 20 for the start address and the end address of all the storage areas of the third data in the non-512 hard disk 2 according to the ID number of the third data.

步驟S33,刪除模組110根據該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址在非512硬碟2中找到並刪除該第三資料,同時刪除該第三資料在記錄表20中的所有記錄,包括該第三資料的名稱和ID號,以及該第三資料在非512硬碟2中所有儲存區域的起始位址和終止位址。Step S33, the deleting module 110 finds and deletes the third data in the non-512 hard disk 2 according to the start address and the ending address of all the storage areas in the non-512 hard disk 2 according to the third data, and deletes the third data. All the records in the record table 20 include the name and ID number of the third material, and the start address and the end address of all the storage areas of the third data in the non-512 hard disk 2.

在本實施方式中,是以第一硬碟1的磁區儲存容量為512Byte,第二硬碟2的磁區儲存容量為非512Byte為例進行舉例說明的。本領域技術人員應當可以瞭解,該第一硬碟1的磁區儲存容量也可以為其他預設值,如4096Byte,則第二硬碟2的磁區儲存容量為非4096Byte。In the present embodiment, the magnetic storage capacity of the first hard disk 1 is 512 Bytes, and the magnetic storage capacity of the second hard disk 2 is 512 Bytes as an example. It should be understood by those skilled in the art that the magnetic storage capacity of the first hard disk 1 may also be other preset values, such as 4096 bytes, and the magnetic storage capacity of the second hard disk 2 is not 4096 bytes.

綜上所述,本發明符合發明專利要件,爰依法提出專利申請。惟,以上所述者僅爲本發明之較佳實施例,本發明之範圍並不以上述實施例爲限,舉凡熟悉本案技藝之人士援依本發明之精神所作之等效修飾或變化,皆應涵蓋於以下申請專利範圍內。In summary, the present invention complies with the requirements of the invention patent and submits a patent application according to law. The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited to the above-described embodiments, and equivalent modifications or variations made by those skilled in the art in light of the spirit of the present invention are It should be covered by the following patent application.

100...電腦100. . . computer

1...512硬碟1. . . 512 hard disk

10...硬碟資料存取系統10. . . Hard disk data access system

11...作業系統11. . . working system

12...非512硬碟根目錄12. . . Non-512 hard disk root directory

2...非512硬碟2. . . Non-512 hard disk

20...記錄表20. . . recording sheet

101...建立模組101. . . Building a module

102...獲取模組102. . . Get module

103...第一判斷模組103. . . First judgment module

104...查找模組104. . . Search module

105...第一轉移模組105. . . First transfer module

106...記錄模組106. . . Recording module

107...查詢模組107. . . Query module

108...第二轉移模組108. . . Second transfer module

109...第二判斷模組109. . . Second judgment module

110...刪除模組110. . . Delete module

圖1係本發明硬碟資料存取系統較佳實施方式的運行環境圖。1 is a diagram showing an operating environment of a preferred embodiment of a hard disk data access system of the present invention.

圖2係本發明硬碟資料存取系統較佳實施方式的功能模組圖。2 is a functional block diagram of a preferred embodiment of the hard disk data access system of the present invention.

圖3係圖1中記錄表的一個示例圖。Fig. 3 is a diagram showing an example of a record table in Fig. 1.

圖4係本發明硬碟資料存取方法儲存資料較佳實施方式的流程圖。4 is a flow chart of a preferred embodiment of storing data in the hard disk data access method of the present invention.

圖5係本發明硬碟資料存取方法訪問資料較佳實施方式的流程圖。FIG. 5 is a flow chart of a preferred embodiment of the hard disk data access method access data of the present invention.

圖6係本發明硬碟資料存取方法刪除資料較佳實施方式的流程圖。6 is a flow chart of a preferred embodiment of the method for deleting data in the hard disk data access method of the present invention.

100...電腦100. . . computer

1...512硬碟1. . . 512 hard disk

10...硬碟資料存取系統10. . . Hard disk data access system

11...作業系統11. . . working system

12...非512硬碟根目錄12. . . Non-512 hard disk root directory

2...非512硬碟2. . . Non-512 hard disk

20...記錄表20. . . recording sheet

Claims (10)

一種硬碟資料存取方法,包括以下步驟:
建立步驟:在電腦的磁區儲存容量為預設值的第一硬碟中建立一個第二硬碟根目錄,並在磁區儲存容量不為該預設值的第二硬碟中建立一個記錄表,該記錄表用於記錄各個資料在該第二硬碟中的儲存區域;及
第二硬碟資料存取步驟:當用戶向該第二硬碟根目錄中儲存資料、訪問資料或刪除資料時,以該第一硬碟為資料中轉站將該資料儲存至該第二硬碟中、或從該第二硬碟中訪問該資料或刪除該資料。
A hard disk data access method includes the following steps:
The establishing step is: establishing a second hard disk root directory in the first hard disk whose storage capacity of the computer is a preset value, and establishing a record in the second hard disk whose magnetic storage capacity is not the preset value. a table for recording a storage area of each of the data on the second hard disk; and a second hard disk data accessing step: when the user stores the data, accesses the data, or deletes the data to the second hard disk root directory And storing the data on the second hard disk by using the first hard disk as a data transfer station, or accessing the data from the second hard disk or deleting the data.
如申請專利範圍第1項所述之硬碟資料存取方法,在所述第二硬碟資料存取步驟中,將資料儲存至該第二硬碟的方法包括以下步驟:
獲取步驟一:當向該第二硬碟根目錄中儲存資料時,獲取該資料的名稱和大小,並為該資料分配相應的ID號;
查找步驟:根據該記錄表的內容在第二硬碟中找出用於儲存該資料的儲存區域;
轉移步驟一:將該資料轉移到所述用於儲存該資料的儲存區域中,並在第二硬碟根目錄中儲存該資料的標記,該標記包括該資料的名稱和ID號;
記錄步驟一:將該資料的名稱和ID號,以及該資料在第二硬碟中的儲存區域記錄在記錄表中。
The hard disk data access method of claim 1, wherein the method of storing data to the second hard disk in the second hard disk data accessing step comprises the following steps:
Obtaining step 1: when storing the data in the root directory of the second hard disk, obtaining the name and size of the data, and assigning the corresponding ID number to the data;
a searching step: finding a storage area for storing the data on the second hard disk according to the content of the record table;
Transfer step 1: transferring the data to the storage area for storing the data, and storing the mark of the data in the root directory of the second hard disk, the mark including the name and ID number of the data;
Recording step one: the name and ID number of the material, and the storage area of the data on the second hard disk are recorded in the record table.
如申請專利範圍第2項所述之硬碟資料存取方法,當第二硬碟有足夠的可用儲存空間儲存該資料時,才執行所述查找步驟。The hard disk data access method of claim 2, wherein the searching step is performed when the second hard disk has sufficient available storage space to store the data. 如申請專利範圍第1項所述之硬碟資料存取方法,在所述第二硬碟資料存取步驟中,從該第二硬碟中訪問資料的方法包括以下步驟:
獲取步驟二:當訪問第二硬碟根目錄中的資料的標記時,獲取該資料的ID號;
查詢步驟一:根據該資料的ID號在記錄表中查詢該資料在第二硬碟中的儲存區域;
轉移步驟二:根據該資料在第二硬碟中的儲存區域讀取該資料,並將該資料轉移到第二硬碟根目錄中,供用戶對該資料進行訪問;
判斷步驟:當停止訪問該資料時,判斷該資料在第二硬碟根目錄中是否已被修改;
轉移步驟三:當該資料在第二硬碟根目錄中已被修改時,將修改後的該資料轉移到第二硬碟中,並修改該資料在記錄表中的記錄;
轉移步驟四:當該資料在第二硬碟根目錄中未被修改時,直接將該資料轉移到第二硬碟中。
The hard disk data access method of claim 1, wherein in the second hard disk data accessing step, the method for accessing data from the second hard disk comprises the following steps:
Obtaining step 2: when accessing the mark of the data in the root directory of the second hard disk, obtaining the ID number of the data;
Step 1: Query the storage area of the data on the second hard disk in the record table according to the ID number of the data;
Transfer step 2: reading the data in the storage area of the second hard disk according to the data, and transferring the data to the root directory of the second hard disk for the user to access the data;
Judging step: when the access to the data is stopped, determining whether the data has been modified in the second hard disk root directory;
Transfer step 3: when the data has been modified in the root directory of the second hard disk, transfer the modified data to the second hard disk, and modify the record of the data in the record table;
Transfer step 4: When the data is not modified in the second hard disk root directory, the data is directly transferred to the second hard disk.
如申請專利範圍第1項所述之硬碟資料存取方法,在所述第二硬碟資料存取步驟中,從該第二硬碟中刪除資料的方法包括以下步驟:
獲取步驟三:當刪除第二硬碟根目錄中的資料的標記時,獲取該資料的ID號;
查詢步驟二:根據該資料的ID號在記錄表中查詢該資料在第二硬碟中的儲存區域;
刪除步驟:根據該儲存區域在第二硬碟中找到並刪除該資料,同時刪除該資料在記錄表中的所有記錄。
The hard disk data access method of claim 1, wherein the method of deleting data from the second hard disk in the second hard disk data accessing step comprises the following steps:
Obtaining step 3: when deleting the mark of the data in the root directory of the second hard disk, obtaining the ID number of the data;
Step 2: Query the storage area of the data on the second hard disk in the record table according to the ID number of the data;
Deletion step: Find and delete the data on the second hard disk according to the storage area, and delete all the records in the record table of the data.
一種硬碟資料存取系統,包括:
建立模組,用於在電腦的磁區儲存容量為預設值的第一硬碟中建立一個第二硬碟根目錄,並在磁區儲存容量不為該預設值的第二硬碟中建立一個記錄表,該記錄表用於記錄各個資料在該第二硬碟中的儲存區域;及
第二硬碟資料存取模組,用於當用戶向該第二硬碟根目錄中儲存資料、訪問資料或刪除資料時,以該第一硬碟為資料中轉站將該資料儲存至該第二硬碟中、或從該第二硬碟中訪問該資料或刪除該資料。
A hard disk data access system includes:
Establishing a module for establishing a second hard disk root directory in the first hard disk with a preset storage value of the magnetic volume of the computer, and storing the second hard disk in the magnetic volume whose storage capacity is not the preset value Establishing a record table for recording a storage area of each data on the second hard disk; and a second hard disk data access module for storing data in the root directory of the second hard disk When accessing the data or deleting the data, the first hard disk is used as a data transfer station to store the data to the second hard disk, or to access the data from the second hard disk or delete the data.
如申請專利範圍第6項所述之硬碟資料存取系統,所述第二硬碟資料存取模組透過以下步驟將資料儲存至該第二硬碟中:
當向該第二硬碟根目錄中儲存資料時,獲取該資料的名稱和大小,並為該資料分配相應的ID號;
根據該記錄表的內容在第二硬碟中找出用於儲存該資料的儲存區域;
將該資料轉移到所述用於儲存該資料的儲存區域中,並在第二硬碟根目錄中儲存該資料的標記,該標記包括該資料的名稱和ID號;
將該資料的名稱和ID號,以及該資料在第二硬碟中的儲存區域記錄在記錄表中。
For example, in the hard disk data access system of claim 6, the second hard disk data access module stores data to the second hard disk by the following steps:
When storing the data in the second hard disk root directory, obtaining the name and size of the data, and assigning the corresponding ID number to the data;
Finding a storage area for storing the data in the second hard disk according to the content of the record table;
Transferring the data to the storage area for storing the data, and storing the mark of the material in the second hard disk root directory, the mark including the name and ID number of the data;
The name and ID number of the material, and the storage area of the material on the second hard disk are recorded in the record table.
如申請專利範圍第7項所述之硬碟資料存取系統,當第二硬碟有足夠的可用儲存空間儲存該資料時,所述第二硬碟資料存取模組才根據該記錄表的內容在第二硬碟中找出用於儲存該資料的儲存區域。The hard disk data access system of claim 7, wherein when the second hard disk has sufficient available storage space for storing the data, the second hard disk data access module is based on the record table. The content finds a storage area for storing the material on the second hard disk. 如申請專利範圍第6項所述之硬碟資料存取系統,所述第二硬碟資料存取模組透過以下步驟從該第二硬碟中訪問資料:
當訪問第二硬碟根目錄中的資料的標記時,獲取該資料的ID號;
根據該資料的ID號在記錄表中查詢該資料在第二硬碟中的儲存區域;
根據該資料在第二硬碟中的儲存區域讀取該資料,並將該資料轉移到第二硬碟根目錄中,供用戶對該資料進行訪問;
當停止訪問該資料時,判斷該資料在第二硬碟根目錄中是否已被修改;
當該資料在第二硬碟根目錄中已被修改時,將修改後的該資料轉移到第二硬碟中,並修改該資料在記錄表中的記錄;
當該資料在第二硬碟根目錄中未被修改時,直接將該資料轉移到第二硬碟中。
In the hard disk data access system of claim 6, the second hard disk data access module accesses data from the second hard disk by the following steps:
When accessing the mark of the data in the root directory of the second hard disk, obtaining the ID number of the data;
Querying, in the record table, the storage area of the data on the second hard disk according to the ID number of the data;
Reading the data in the storage area of the second hard disk according to the data, and transferring the data to the root directory of the second hard disk for the user to access the data;
When the access to the material is stopped, it is determined whether the data has been modified in the second hard disk root directory;
When the data has been modified in the second hard disk root directory, the modified data is transferred to the second hard disk, and the record of the data in the record table is modified;
When the data is not modified in the root directory of the second hard disk, the data is directly transferred to the second hard disk.
如申請專利範圍第6項所述之硬碟資料存取系統,所述第二硬碟資料存取模組透過以下步驟從該第二硬碟中刪除資料:
當刪除第二硬碟根目錄中的資料的標記時,獲取該資料的ID號;
根據該資料的ID號在記錄表中查詢該資料在第二硬碟中的儲存區域;
根據該儲存區域在第二硬碟中找到並刪除該資料,同時刪除該資料在記錄表中的所有記錄。
In the hard disk data access system of claim 6, the second hard disk data access module deletes data from the second hard disk by the following steps:
When the mark of the data in the root directory of the second hard disk is deleted, the ID number of the data is obtained;
Querying, in the record table, the storage area of the data on the second hard disk according to the ID number of the data;
The data is found and deleted on the second hard disk according to the storage area, and all the records in the record table are deleted.
TW100126920A 2011-07-25 2011-07-29 Method and system for storing and accessing data of hard disk TWI483108B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110208709.7A CN102902487B (en) 2011-07-25 2011-07-25 Hard disc data access system

Publications (2)

Publication Number Publication Date
TW201305816A TW201305816A (en) 2013-02-01
TWI483108B true TWI483108B (en) 2015-05-01

Family

ID=47574738

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100126920A TWI483108B (en) 2011-07-25 2011-07-29 Method and system for storing and accessing data of hard disk

Country Status (2)

Country Link
CN (1) CN102902487B (en)
TW (1) TWI483108B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110909354A (en) * 2019-11-29 2020-03-24 四川效率源信息安全技术股份有限公司 Method for cleaning malicious codes in firmware area of Western digital hard disk
CN111338576A (en) * 2020-02-20 2020-06-26 深圳供电局有限公司 Big data storage system and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6735671B1 (en) * 1999-07-12 2004-05-11 Nec Corporation System for accessing hard disk drive built in computer in which hard disk drive built in its computer can be accessed from outside its computer even if computer is not driven
TWI249101B (en) * 2002-04-11 2006-02-11 Via Tech Inc Method and related apparatus for using a dynamic random access memory to substitute for a hard disk drive
US7085480B1 (en) * 1998-03-14 2006-08-01 Sony Corporation AV/C commands for accessing a hard disk device
TWI307467B (en) * 2005-12-27 2009-03-11 Inventec Corp
TW200941226A (en) * 2008-03-31 2009-10-01 Hewlett Packard Development Co Systems and methods for accessing hard disk drives
TW201039130A (en) * 2009-04-30 2010-11-01 Inventec Corp Hard drive access method
TWI345711B (en) * 2007-07-27 2011-07-21

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185580B1 (en) * 1998-06-24 2001-02-06 International Business Machines Corporation Physical information and extensions file and file system translator
CN100471112C (en) * 2004-03-26 2009-03-18 清华大学 Memory-network memory-magnetic disc high speed reliable storage system and its reading/writing method
CN101055512A (en) * 2007-06-01 2007-10-17 威盛电子股份有限公司 Data access method
CN101446924B (en) * 2008-12-16 2013-04-17 成都市华为赛门铁克科技有限公司 Method and system for storing and obtaining data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085480B1 (en) * 1998-03-14 2006-08-01 Sony Corporation AV/C commands for accessing a hard disk device
US6735671B1 (en) * 1999-07-12 2004-05-11 Nec Corporation System for accessing hard disk drive built in computer in which hard disk drive built in its computer can be accessed from outside its computer even if computer is not driven
TWI249101B (en) * 2002-04-11 2006-02-11 Via Tech Inc Method and related apparatus for using a dynamic random access memory to substitute for a hard disk drive
TWI307467B (en) * 2005-12-27 2009-03-11 Inventec Corp
TWI345711B (en) * 2007-07-27 2011-07-21
TW200941226A (en) * 2008-03-31 2009-10-01 Hewlett Packard Development Co Systems and methods for accessing hard disk drives
TW201039130A (en) * 2009-04-30 2010-11-01 Inventec Corp Hard drive access method

Also Published As

Publication number Publication date
CN102902487B (en) 2016-06-08
TW201305816A (en) 2013-02-01
CN102902487A (en) 2013-01-30

Similar Documents

Publication Publication Date Title
US7849282B2 (en) Filesystem building method
US10289547B2 (en) Method and apparatus for a network connected storage system
US9189494B2 (en) Object file system
CN106649467B (en) Blue-ray disc library filing management method and system
WO2018010665A1 (en) Large-capacity optical disc library-based file system and file storage method
US20070112891A1 (en) Converting file-systems that organize and store data for computing systems
US7398352B2 (en) Recording method and recording apparatus that limits number of rewrites to the same storage area
JP6008820B2 (en) File system for realizing WORM (Write OnceReadMany)
JP2012510101A (en) Flash-based memory with flash conversion layer and file storage method
US8332351B2 (en) Method and system for preserving files with multiple links during shadow migration
US8046391B2 (en) Storage apparatus and its file control method and storage system
JP4401863B2 (en) Storage system
US20170068686A1 (en) Accessing a block based volume as a file based volume
TWI483108B (en) Method and system for storing and accessing data of hard disk
US8260798B2 (en) Method and system for partial shadow migration
US20170286442A1 (en) File system support for file-level ghosting
US20100161920A1 (en) Data management apparatus, data management system, and data management method
US20110184996A1 (en) Method and system for shadow migration
JP6805501B2 (en) Storage device
KR102170180B1 (en) Method and system for providing mass storage
KR101667760B1 (en) File allocation table file system and method for storing the file
JP2004171739A (en) Recording method and recorder
JP2006344353A (en) Data recording system
JP2017123071A (en) Storage system, storage device, data management program and data management method
WO2015145707A1 (en) Method for determining data written to write-once-type storage device

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees