TWI396987B - Method for storing files in network attached storage and network attached storage using the method - Google Patents

Method for storing files in network attached storage and network attached storage using the method Download PDF

Info

Publication number
TWI396987B
TWI396987B TW98137221A TW98137221A TWI396987B TW I396987 B TWI396987 B TW I396987B TW 98137221 A TW98137221 A TW 98137221A TW 98137221 A TW98137221 A TW 98137221A TW I396987 B TWI396987 B TW I396987B
Authority
TW
Taiwan
Prior art keywords
file
storage device
failures
network storage
storing
Prior art date
Application number
TW98137221A
Other languages
Chinese (zh)
Other versions
TW201117025A (en
Inventor
Chien Hang Chen
Original Assignee
Wistron Corp
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 Wistron Corp filed Critical Wistron Corp
Priority to TW98137221A priority Critical patent/TWI396987B/en
Publication of TW201117025A publication Critical patent/TW201117025A/en
Application granted granted Critical
Publication of TWI396987B publication Critical patent/TWI396987B/en

Links

Landscapes

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

Description

儲存檔案於一網路儲存裝置的方法及應用該方法的網路儲存裝置Method for storing files in a network storage device and network storage device using the same

本發明是有關於一種儲存檔案的方法,特別是指一種儲存檔案於一網路儲存裝置的方法。The present invention relates to a method of storing files, and more particularly to a method of storing files in a network storage device.

在網路世界中,UNIX作業系統和Windows作業系統彼此在傳送檔案時,可透過一套架構在NetBIOS(Network Basic Input/Output System)通訊協定上的軟體Samba,來使彼此能夠互相交換資源。In the online world, the UNIX operating system and the Windows operating system can exchange resources with each other through a software Samba that is structured on the NetBIOS (Network Basic Input/Output System) protocol when transferring files to each other.

舉例來說,使用Windows作業系統的電腦透過網路連接使用UNIX作業系統(Linux)的網路儲存裝置,當兩者皆裝設有Samba,而電腦欲將檔案透過Samba儲存到網路儲存裝置時,Samba會先執行預先配置(pre-allocation)動作,以在網路儲存裝置的硬碟中盡可能搜尋一夠大的儲存空間來存放檔案,使得檔案不會被零散地儲存於硬碟,並以特定的容量大小將檔案整體或分散的儲存於硬碟,如此一來,在讀取檔案時會有較好的效能。For example, a computer using a Windows operating system uses a UNIX operating system (Linux) network storage device via a network connection, when both are equipped with Samba, and the computer wants to store the file through Samba to the network storage device. Samba will perform a pre-allocation action to search for a large enough storage space on the network storage device's hard drive to store the files so that the files are not scattered on the hard disk. The files are stored on the hard disk in a specific capacity or in a distributed manner, so that the file will have better performance when the file is read.

然而,此預先配置動作會消耗網路儲存裝置的中央處理單元(Central Processing Unit,CPU)的資源,如果網路儲存裝置的硬碟本身已無夠大的儲存空間,而依舊執行預先配置動作的話,無疑是造成網路儲存裝置的CPU不必要的負擔,因此,如何有效地運用預先配置動作將是一值得研究改進的課題。However, this pre-configuration action consumes the resources of the central processing unit (CPU) of the network storage device. If the hard disk of the network storage device itself does not have enough storage space, and the pre-configured action is still performed, It is undoubtedly an unnecessary burden on the CPU of the network storage device. Therefore, how to effectively use the pre-configured action will be a problem worthy of research and improvement.

因此,本發明之目的,即在提供一種彈性使用預先配置動作的儲存檔案於一網路儲存裝置的方法。Accordingly, it is an object of the present invention to provide a method of resiliently storing a file of a pre-configured action in a network storage device.

於是,本發明儲存檔案於一網路儲存裝置的方法,應用於具有一儲存單元的網路儲存裝置,該方法包含:Therefore, the method for storing a file in a network storage device of the present invention is applied to a network storage device having a storage unit, the method comprising:

(A)於網路儲存裝置在儲存一檔案時,先執行一預先配置動作,以在儲存單元中搜尋是否有一特定大小的儲存空間,若是,則儲存檔案於該儲存空間,若否,則進行步驟(B);(A) when the network storage device stores a file, first perform a pre-configuration action to search the storage unit for a specific size storage space, and if so, store the file in the storage space, if not, proceed Step (B);

(B)於網路儲存裝置的一記憶模組中累計一次失敗次數,並且判斷累計的失敗次數是否達到一第一預設次數,若是,則停止執行預先配置動作並直接儲存檔案於儲存單元,若否,則進行步驟(C);及(B) accumulating the number of failures in a memory module of the network storage device, and determining whether the accumulated number of failures reaches a first predetermined number of times, and if so, stopping the pre-configuring action and directly storing the file in the storage unit. If no, proceed to step (C); and

(C)重新執行預先配置動作以搜尋儲存單元中是否有一較前次搜尋的儲存空間小的次儲存空間,若是,則儲存檔案於次儲存空間,若否,則重覆步驟(B)。(C) Re-execute the pre-configuration action to search whether the storage unit has a smaller storage space than the previous searched storage space, and if so, store the file in the secondary storage space, and if not, repeat step (B).

本發明之另一目的,在於提供一種應用上述之方法的網路儲存裝置。Another object of the present invention is to provide a network storage device using the above method.

於是,本發明網路儲存裝置,包含一存取介面、一儲存單元、一控制模組、一記憶模組及一處理模組,存取介面能接收來自電子裝置的檔案,儲存單元儲存存取介面所接收的檔案,控制模組在存取介面接收一檔案時會執行一預先配置動作,以在儲存單元中搜尋一特定大小的儲存空間,而當控制模組執行儲存檔案的預先配置動作失敗時,記憶模組會累計一次的失敗次數,處理模組會判斷記憶模組所累計的失敗次數是否達到一第一預定次數,若是,則令控制模組停止執行預先配置動作並直接儲存檔案於儲存單元,若否,則令控制模組重新執行預先配置動作,以搜尋一較前次搜尋的儲存空間小的次儲存空間。Therefore, the network storage device of the present invention comprises an access interface, a storage unit, a control module, a memory module and a processing module. The access interface can receive files from the electronic device, and the storage unit stores the access. The file received by the interface, the control module performs a pre-configured action when the access interface receives a file to search for a specific size storage space in the storage unit, and the control module fails to perform the pre-configured action of storing the file. When the memory module accumulates the number of failures, the processing module determines whether the number of failures accumulated by the memory module reaches a first predetermined number of times. If so, the control module stops performing the pre-configured action and directly stores the file. The storage unit, if not, causes the control module to re-execute the pre-configured action to search for a secondary storage space that is smaller than the previously searched storage space.

本發明之功效在於,儲存檔案於一網路儲存裝置的方法能應用於網路儲存裝置,使網路儲存裝置在儲存檔案前的預先配置動作能彈性地被使用,藉此控管網路儲存裝置的中央處理單元之效能,使得網路儲存裝置能順利地運作。The method of the present invention is that the method for storing a file in a network storage device can be applied to a network storage device, so that the pre-configured action of the network storage device before storing the file can be flexibly used, thereby controlling the network storage. The performance of the central processing unit of the device enables the network storage device to operate smoothly.

有關本發明之前述及其他技術內容、特點與功效,在以下配合參考圖式之二個較佳實施例的詳細說明中,將可清楚的呈現。The above and other technical contents, features and advantages of the present invention will be apparent from the following detailed description of the preferred embodiments of the invention.

在本發明被詳細描述之前,要注意的是,在以下的說明內容中,類似的元件是以相同的編號來表示。Before the present invention is described in detail, it is noted that in the following description, similar elements are denoted by the same reference numerals.

參閱圖1,為本發明儲存檔案於一網路儲存裝置的方法之第一較佳實施例,該方法應用於一網路儲存裝置2,網路儲存裝置2與電子裝置3藉網路連接並且皆裝設有Samba,網路儲存裝置2與電子裝置3能透過Samba相互傳送檔案,在本實施例中,該方法是以一軟體程式實現,該軟體程式可整合於Samba軟體中,亦可與Samba相互獨立運作。在本實施例中,網路儲存裝置2為UNIX作業系統(Linux)的NAS(Network Attached Storage),亦可為其他網路伺服器,而電子裝置3為Windows作業系統的電腦或其他可以連接上網的電子裝置。Referring to FIG. 1 , a first preferred embodiment of a method for storing a file in a network storage device according to the present invention is applied to a network storage device 2, and the network storage device 2 is connected to the electronic device 3 via a network and Samba is installed, and the network storage device 2 and the electronic device 3 can transmit files through Samba. In this embodiment, the method is implemented by a software program, which can be integrated into the Samba software, or Samba operates independently of each other. In this embodiment, the network storage device 2 is a NAS (Network Attached Storage) of a UNIX operating system (Linux), and may be another network server, and the electronic device 3 is a computer of the Windows operating system or other Internet connection. Electronic device.

參閱圖2,網路儲存裝置2包含一存取介面21、一儲存單元(在本實施例是以硬碟22為例,但不以此為限)及一中央處理單元23,存取介面21、硬碟22及中央處理單元23三者相互耦接,其中,存取介面21是用以接收來自網路上電子裝置3的檔案,硬碟22包含一能儲存存取介面21所接收之檔案的儲存模組221及一記憶模組222,中央處理單元23包含一控制模組231及一處理模組233,而上述之功能區塊的作用將在下面做進一步說明。Referring to FIG. 2, the network storage device 2 includes an access interface 21, a storage unit (in this embodiment, the hard disk 22 is taken as an example, but not limited thereto), and a central processing unit 23, the access interface 21 The hard disk 22 and the central processing unit 23 are coupled to each other. The access interface 21 is for receiving files from the electronic device 3 on the network, and the hard disk 22 includes a file capable of storing the file received by the access interface 21. The storage module 221 and a memory module 222, the central processing unit 23 includes a control module 231 and a processing module 233, and the functions of the above functional blocks will be further described below.

配合參閱圖2及圖3,當電子裝置3欲將一檔案(例如:9GB)傳送至網路儲存裝置2時,首先,網路儲存裝置2的存取介面21接收檔案,之後,如步驟901所示,由於作業系統會記錄中央處理單元23的目前使用率,故中央處理單元23的處理模組233可讀取作業系統所記錄之中央處理單元23的目前使用率,並判斷中央處理單元23的使用率是否達到一預設值(例如:80%),若是,則處理模組233令控制模組231將存取介面21所接收的檔案不經Samba執行預先配置(pre-allocation)動作即直接儲存於硬碟22的儲存模組221,如步驟902;若否,則處理模組233接著判斷記憶模組222中累計執行預先配置(pre-allocation)動作的失敗總次數是否達到一第二預設次數,如步驟903,而關於失敗總次數的定義請容後說明。若失敗總次數達到第二預設值,則處理模組233令控制模組231將存取介面21所接收的檔案不經Samba執行預先配置(pre-allocation)動作即直接儲存於硬碟22的儲存模組221,如步驟904;若失敗總次數未達到第二預設值,則進行步驟905。Referring to FIG. 2 and FIG. 3, when the electronic device 3 wants to transfer a file (for example, 9 GB) to the network storage device 2, first, the access interface 21 of the network storage device 2 receives the file, and then, as in step 901. As shown, since the operating system records the current usage rate of the central processing unit 23, the processing module 233 of the central processing unit 23 can read the current usage rate of the central processing unit 23 recorded by the operating system, and determine the central processing unit 23 Whether the usage rate reaches a preset value (for example, 80%), and if so, the processing module 233 causes the control module 231 to perform the pre-allocation action of the file received by the access interface 21 without Samba. The storage module 221 is directly stored in the hard disk 22, as in step 902. If not, the processing module 233 then determines whether the total number of failed pre-allocation actions in the memory module 222 reaches a second. The preset number of times, as in step 903, and the definition of the total number of failures, please explain later. If the total number of failures reaches the second preset value, the processing module 233 causes the control module 231 to store the file received by the access interface 21 directly on the hard disk 22 without performing a pre-allocation action by Samba. The storage module 221 is as shown in step 904. If the total number of failures does not reach the second preset value, step 905 is performed.

在步驟905中,處理模組233令控制模組231執行Samba並執行預先配置(pre-allocation)動作以搜尋硬碟22的儲存模組221中是否有一使檔案不必分散地儲存於硬碟22的儲存模組221之大於該檔案大小的儲存空間(例如:10GB),然後,若控制模組231執行預先配置動作成功,則執行步驟906,處理模組233令控制模組231將檔案儲存於搜尋到的儲存空間;若控制模組231執行預先配置動作失敗,則執行步驟907,處理模組233令記憶模組222累計一次的失敗次數。接著,於步驟907後進行步驟908,如步驟908所示,處理模組233會先判斷記憶模組222累計的失敗次數是否達到一第一預設次數,若是,則處理模組233令控制模組231停止執行預先配置(pre-allocation)動作並將存取介面21所接收的檔案直接儲存於硬碟22的儲存模組221,如步驟909;若否,則處理單元233令控制模組231重新執行預先配置動作以搜尋硬碟22的儲存模組221中是否有一較前次搜尋的儲存空間小的次儲存空間(例如:8GB),如步驟910。In step 905, the processing module 233 causes the control module 231 to execute Samba and perform a pre-allocation action to search the storage module 221 of the hard disk 22 for storing the file on the hard disk 22 without being distributed. The storage module 221 is larger than the storage size of the file (for example, 10 GB). Then, if the control module 231 performs the pre-configuration operation successfully, step 906 is executed, and the processing module 233 causes the control module 231 to store the file in the search. If the control module 231 fails to perform the pre-configuration operation, step 907 is executed, and the processing module 233 causes the memory module 222 to accumulate the number of failures. Then, after step 907, step 908 is performed. As shown in step 908, the processing module 233 first determines whether the number of failures accumulated by the memory module 222 reaches a first predetermined number of times. If so, the processing module 233 causes the control module to The group 231 stops performing the pre-allocation operation and stores the file received by the access interface 21 directly in the storage module 221 of the hard disk 22, as in step 909; if not, the processing unit 233 causes the control module 231 to execute the control module 231. The pre-configured action is re-executed to search whether the storage module 221 of the hard disk 22 has a smaller storage space (for example, 8 GB) than the previous searched storage space, as in step 910.

在步驟910中,若控制模組231執行預先配置動作成功,如步驟911所示,處理模組233令控制模組231將檔案儲存於搜尋到的次儲存空間,此時,由於次儲存空間小於檔案大小,所以檔案將被分散儲存,而檔案剩餘的部分將藉同樣的方法由步驟901開始尋找硬碟22的儲存模組221中一適合的儲存空間;若控制模組231執行預先配置動作失敗,將重新執行步驟907,直到步驟908判斷累計的失敗次數達到第一預設次數,或是重新執行步驟907的預先配置動作已搜尋到更小的次儲存空間。之後,不論是執行步驟909或是步驟911都會進入步驟912,處理模組233令記憶模組222將累計的失敗次數加入失敗總次數,而失敗總次數即是指網路儲存裝置2在儲存每一檔案所執行預先配置(pre-allocation)動作失敗次數的總和,最後,執行步驟913,處理模組233令記憶模組222將失敗次數歸零,即完成檔案儲存作業。其中上述的第一預設次數、第二預設次數與預設值可透過內部程式設定完成。In step 910, if the control module 231 performs the pre-configuration operation successfully, as shown in step 911, the processing module 233 causes the control module 231 to store the file in the searched secondary storage space. The file size, so the file will be stored in a distributed manner, and the remaining part of the file will be searched for a suitable storage space in the storage module 221 of the hard disk 22 by the same method; if the control module 231 fails to perform the pre-configuration operation Step 907 will be re-executed until step 908 determines that the accumulated number of failures reaches the first predetermined number of times, or re-executes the pre-configured action of step 907 to search for a smaller secondary storage space. Then, whether step 909 or step 911 is performed, the process module 233 causes the memory module 222 to add the accumulated number of failures to the total number of failures, and the total number of failures refers to the network storage device 2 storing each time. The sum of the number of failed pre-allocation actions performed by a file. Finally, in step 913, the processing module 233 causes the memory module 222 to reset the number of failures to zero, that is, to complete the file storage operation. The first preset number of times, the second preset number of times, and the preset value may be completed by an internal program setting.

附帶說明的是,於步驟902中,不經Samba執行預先配置(pre-allocation)動作時,則控制模組233是將檔案直接儲存於硬碟22的儲存模組221零星或分散的儲存空間中,但是同時處理模組233還是會繼續判斷中央處理單元23的使用率,一旦使用率低於預設值,處理模組233將令控制模組231先暫停儲存檔案,而進行步驟903,判斷是否能先執行預先配置(pre-allocation)動作,因為如能透過預先配置動作來儲存檔案,之後在讀取或利用檔案時會有較佳的效能。此外,由於步驟901與步驟903兩者判斷機制並無先後關係,而且步驟902與步驟904相同,所以亦可先執行步驟903再執行步驟901,其執行先後順序可視實際應用情況調整。It should be noted that, in step 902, when the pre-allocation action is not performed by Samba, the control module 233 stores the file directly in the sporadic or scattered storage space of the storage module 221 of the hard disk 22. However, the processing module 233 will continue to determine the usage rate of the central processing unit 23. Once the usage rate is lower than the preset value, the processing module 233 will cause the control module 231 to suspend the storage of the file first, and step 903 is performed to determine whether Perform pre-allocation actions first, because if you can save files through pre-configured actions, then you will have better performance when reading or using files. In addition, since there is no relationship between the determining mechanism of step 901 and step 903, and step 902 is the same as step 904, step 903 may be performed first and then step 901 may be performed, and the sequence of execution may be adjusted according to actual application conditions.

值得說明的是,當網路儲存裝置2的中央處理單元23同時處理很多事情(例如:執行傳送接收檔案的加解密功能或同時有多數個電子裝置在存取檔案)而使用率過高時,能透過步驟901的設定,在儲存檔案方面,採用直接將檔案儲存至硬碟22的儲存模組221中,而不需執行預先配置(pre-allocation)動作,將使中央處理單元23減輕負擔正常運作,而不會因負載過度而當機。It should be noted that when the central processing unit 23 of the network storage device 2 processes a lot of things at the same time (for example, performing the encryption and decryption function of transmitting and receiving files or having a plurality of electronic devices accessing files at the same time) and the usage rate is too high, Through the setting of step 901, in the storage of the file, the file is directly stored in the storage module 221 of the hard disk 22 without performing a pre-allocation action, so that the central processing unit 23 can reduce the burden. Operate without crashing due to excessive load.

再者,當記憶模組222累計的失敗總次數過多時,代表硬碟22的儲存模組221中所剩餘的空間不多或是剩餘的空間為零碎的小空間,此時,若繼續於儲存每一檔案前執行預先配置動作將會徒勞無功,反而浪費中央處理單元23的資源,因此,透過步驟903的設定,將可以在執行預先配置動作之前,先藉失敗總次數判讀硬碟22的儲存模組221的狀態,若失敗總次數過高,則不需執行預先配置動作,改將檔案直接儲存至硬碟22的儲存模組221中,以減輕中央處理單元23的負擔。Moreover, when the total number of failures accumulated by the memory module 222 is too large, there is not much space left in the storage module 221 representing the hard disk 22 or a small space in which the remaining space is fragmented. Performing the pre-configured action in front of each file will be useless, but will waste the resources of the central processing unit 23. Therefore, through the setting of step 903, the storage mode of the hard disk 22 can be interpreted by the total number of failures before performing the pre-configured action. If the total number of failures is too high, the status of the group 221 is not required to be pre-configured, and the file is directly stored in the storage module 221 of the hard disk 22 to reduce the burden on the central processing unit 23.

此外,當失敗總次數達到第二預設次數後,本發明儲存檔案於一網路儲存裝置的方法更可執行一於步驟904之後的步驟914,如步驟914所示,處理模組233判斷硬碟22的儲存模組221是否釋出一特定大小的儲存空間,若是,則將失敗總次數歸零。在此步驟中,處理模組233會判斷硬碟22的儲存模組221中是否增加一特定的儲存空間,像是硬碟22的儲存模組221中的檔案被刪除或是硬碟22的儲存模組221經磁碟重組而釋放空間,若是,處理模組233令記憶模組222的失敗總次數歸零,如步驟915,如此一來,當有檔案需存入硬碟22的儲存模組221時,則又可以開始執行圖3本實施例之步驟;若否,則重複步驟914,處理模組233繼續判斷硬碟22的儲存模組221中是否增加一特定的儲存空間。其中,特定的儲存空間是可透過內部程式,按照釋放空間與硬碟22的儲存模組221所剩容量的比例來設定,舉例來說,當處理模組233判斷釋放空間超過硬碟22的儲存模組221所剩容量的20%,則將失敗總次數歸零。In addition, after the total number of failures reaches the second predetermined number of times, the method for storing the file in a network storage device of the present invention can be further performed in step 914 after step 904. As shown in step 914, the processing module 233 determines the hard Whether the storage module 221 of the disc 22 releases a storage space of a certain size, and if so, zeros the total number of failures. In this step, the processing module 233 determines whether a specific storage space is added to the storage module 221 of the hard disk 22. For example, the file in the storage module 221 of the hard disk 22 is deleted or the storage of the hard disk 22 is stored. The module 221 is reorganized by the disk to release the space. If so, the processing module 233 resets the total number of failures of the memory module 222 to zero, as in step 915, so that when there is a file to be stored in the storage module of the hard disk 22 At 221, the step of the embodiment of FIG. 3 can be started. If no, step 914 is repeated. The processing module 233 continues to determine whether a specific storage space is added to the storage module 221 of the hard disk 22. The specific storage space is set by the internal program according to the ratio of the release space to the remaining capacity of the storage module 221 of the hard disk 22. For example, when the processing module 233 determines that the release space exceeds the storage of the hard disk 22 If 20% of the remaining capacity of the module 221 is zero, the total number of failures is zeroed.

參閱圖4,是本實施例的一變化實施例,亦即調整步驟903、步驟904、步驟914及步驟915的執行順序同樣可達到如同上述的功效,詳細說明如下。將步驟903調整至步驟912之後,若處理單元233判斷累計執行預先配置(pre-allocation)動作的失敗總次數達到第二預設次數,則令執行模組231在執行後續收到的檔案儲存時,則停止執行預先配置(pre-allocation)動作而直接將後續收到的檔案儲存至硬碟22的儲存模組221中,如步驟916,並進行步驟913;若未達到第二預設次數,則進行步驟913。此外,在執行步驟916之後,會進行步驟914及步驟915,如先前所述以將失敗總次數歸零,而能夠啟動預先配置(pre-allocation)動作,於是,經過步驟的調整,同樣可達到上述之功效。Referring to FIG. 4, a modified embodiment of the present embodiment, that is, the execution sequence of the adjustment step 903, the step 904, the step 914, and the step 915 can also achieve the same functions as described above, and the details are as follows. After the step 903 is adjusted to the step 912, if the processing unit 233 determines that the total number of failed executions of the pre-allocation action reaches the second preset number of times, the execution module 231 causes the subsequent received file storage to be executed. If the pre-configuration (pre-allocation) action is stopped, the subsequently received file is directly stored in the storage module 221 of the hard disk 22, as in step 916, and step 913 is performed; if the second preset number of times is not reached, Then proceed to step 913. In addition, after step 916 is performed, step 914 and step 915 are performed, and as described above, the total number of failures is zeroed, and a pre-allocation action can be initiated, and thus, after the adjustment of the steps, the same can be achieved. The above effects.

參閱圖5,為本發明儲存檔案於一網路儲存裝置的方法之第二較佳實施例,該方法應用於一網路儲存裝置2,網路儲存裝置2與多數個電子裝置3藉網路連接並且皆裝設有Samba,網路儲存裝置2與多數個電子裝置3能透過Samba相互傳送檔案,本實施例儲存檔案於一網路儲存裝置的方法是以一軟體程式實現,該軟體程式可整合於Samba軟體中,也可以與Samba相互獨立運作。在本實施例中,網路儲存裝置2與多數個電子裝置3可架構成一區域網路架構,使電子裝置3共享網路儲存裝置2的資源及儲存容量。Referring to FIG. 5, a second preferred embodiment of a method for storing a file in a network storage device according to the present invention is applied to a network storage device 2, and the network storage device 2 and a plurality of electronic devices 3 borrow a network. Samba is connected and installed, and the network storage device 2 and the plurality of electronic devices 3 can transmit files through Samba. The method for storing files in a network storage device in this embodiment is implemented by a software program, and the software program can be implemented. Integrated into Samba software, it can also operate independently of Samba. In this embodiment, the network storage device 2 and the plurality of electronic devices 3 can be configured to form a regional network architecture, so that the electronic device 3 shares the resources and storage capacity of the network storage device 2.

在每一電子裝置3欲儲存檔案至網路儲存裝置2時,同樣地會執行如同圖3之第一較佳實施例的判斷是否執行預先配置(pre-allocation)動作的步驟,而第二較佳實施例與第一較佳實施例的差異在於網路儲存裝置2設有互斥機制,亦即處理模組233會避免多個電子裝置3同時在記憶模組222中寫入失敗總次數而發生失敗總次數錯誤的情況,而其餘的流程步驟與第一較佳實施例相同。When each electronic device 3 wants to store a file to the network storage device 2, the same step as the first preferred embodiment of FIG. 3 is performed to determine whether to perform a pre-allocation action, and the second comparison is performed. The difference between the preferred embodiment and the first preferred embodiment is that the network storage device 2 is provided with a mutual exclusion mechanism, that is, the processing module 233 can prevent the total number of write failures of the plurality of electronic devices 3 in the memory module 222 at the same time. The case where the total number of failures is erroneous occurs, and the remaining flow steps are the same as in the first preferred embodiment.

綜上所述,本發明儲存檔案於一網路儲存裝置的方法能應用於網路儲存裝置2,使網路儲存裝置2在儲存檔案前的預先配置動作能有效率及彈性地被使用,藉此控管網路儲存裝置2的中央處理單元23之效能,使得網路儲存裝置2能順利地運作,故確實能達成本發明之目的。In summary, the method for storing a file in a network storage device of the present invention can be applied to the network storage device 2, so that the pre-configured action of the network storage device 2 before the file is stored can be used efficiently and flexibly. This control of the performance of the central processing unit 23 of the network storage device 2 enables the network storage device 2 to operate smoothly, so that the object of the present invention can be achieved.

惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍,即大凡依本發明申請專利範圍及發明說明內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。The above is only the preferred embodiment of the present invention, and the scope of the invention is not limited thereto, that is, the simple equivalent changes and modifications made by the scope of the invention and the description of the invention are All remain within the scope of the invention patent.

2...網路儲存裝置2. . . Network storage device

21...存取介面twenty one. . . Access interface

22...硬碟twenty two. . . Hard disk

221...儲存模組221. . . Storage module

222...記憶模組222. . . Memory module

23...中央處理單元twenty three. . . Central processing unit

231...控制模組231. . . Control module

233...處理模組233. . . Processing module

3...電子裝置3. . . Electronic device

901~916...步驟901~916. . . step

圖1是一示意圖,說明本發明儲存檔案於一網路儲存裝置的方法應用於一網路儲存裝置及一電子裝置之間;1 is a schematic diagram showing a method for storing a file in a network storage device of the present invention applied between a network storage device and an electronic device;

圖2是一架構方塊圖,說明該網路儲存裝置的內部硬體架構;2 is a block diagram showing the internal hardware architecture of the network storage device;

圖3是一流程圖,說明本發明儲存檔案於一網路儲存裝置的方法;3 is a flow chart illustrating a method of storing a file in a network storage device of the present invention;

圖4是一流程圖,說明另一流程的儲存檔案於一網路儲存裝置的方法;及4 is a flow chart illustrating another method of storing a file in a network storage device; and

圖5是一示意圖,說明本發明儲存檔案於一網路儲存裝置的方法應用於一網路儲存裝置及多數個電子裝置之間。FIG. 5 is a schematic diagram showing the method of storing a file in a network storage device of the present invention applied between a network storage device and a plurality of electronic devices.

901~915...步驟901~915. . . step

Claims (12)

一種儲存檔案於一網路儲存裝置的方法,應用於具有一儲存單元的網路儲存裝置,該方法包含:(A)於該網路儲存裝置在儲存一檔案時,先執行一預先配置動作,以在該儲存單元中搜尋是否有一特定大小的儲存空間,若是,則儲存該檔案於該儲存空間,若否,則進行步驟(B);(B)於該網路儲存裝置的一記憶模組中累計一次失敗次數,並且判斷累計的失敗次數是否達到一第一預設次數,若是,則停止執行該預先配置動作並直接儲存該檔案於該儲存單元,若否,則進行步驟(C);及(C)重新執行該預先配置動作以搜尋該儲存單元中是否有一較前次搜尋的儲存空間小的次儲存空間,若是,則儲存該檔案於該次儲存空間,若否,則重覆步驟(B)。A method for storing a file in a network storage device is applied to a network storage device having a storage unit, the method comprising: (A) performing a pre-configured action on the network storage device when storing a file, Searching for the storage unit for a specific size of storage space, and if so, storing the file in the storage space; if not, proceeding to step (B); (B) a memory module of the network storage device The number of failures is accumulated, and it is determined whether the cumulative number of failures reaches a first predetermined number of times, and if so, the execution of the pre-configured action is stopped and the file is directly stored in the storage unit, and if not, step (C) is performed; And (C) re-executing the pre-configured action to search whether the storage unit has a smaller storage space than the previous searched storage space, and if so, storing the file in the storage space, and if not, repeating the step ( B). 依據申請專利範圍第1項所述之儲存檔案於一網路儲存裝置的方法,更包含於步驟(B)中,將儲存該檔案所累計的失敗次數加入一失敗總次數,該失敗總次數係累計每一檔案執行該預先配置動作的失敗次數。The method for storing a file in a network storage device according to claim 1 is further included in step (B), adding the total number of failures stored in the file to a total number of failures, the total number of failures being The number of failures of each pre-configured action for each file is accumulated. 依據申請專利範圍第2項所述之儲存檔案於一網路儲存裝置的方法,更包含於該步驟(A)之前進行判斷累計的失敗總次數是否達到一第二預設次數,若是,則令該網路儲存裝置直接儲存該檔案於該儲存單元,若否,則進行步驟(A)。The method for storing a file in a network storage device according to the second aspect of the patent application includes, before the step (A), determining whether the total number of failed failures reaches a second predetermined number of times, and if so, The network storage device directly stores the file in the storage unit, and if not, proceeds to step (A). 依據申請專利範圍第3項所述之儲存檔案於一網路儲存裝置的方法,更包含當該失敗總次數達到該第二預設次數後,進行判斷該儲存單元是否釋出一特定大小的儲存空間,若是,則將該失敗總次數歸零。The method for storing a file in a network storage device according to claim 3, further comprising determining whether the storage unit releases a certain size of storage after the total number of failures reaches the second predetermined number of times Space, if it is, zero the total number of failures. 依據申請專利範圍第1項所述之儲存檔案於一網路儲存裝置的方法,更包含一於該步驟(A)之前進行判斷該網路儲存裝置的一中央處理單元的使用率是否達到一預設值,若是,則令該網路儲存裝置直接儲存該檔案於該儲存單元,若否,則進行步驟(A)。The method for storing a file in a network storage device according to the scope of claim 1 further includes determining whether the usage rate of a central processing unit of the network storage device reaches a pre-determination before the step (A) The value is set, and if so, the network storage device directly stores the file in the storage unit, and if not, proceeds to step (A). 依據申請專利範圍第2項所述之儲存檔案於一網路儲存裝置的方法,更包含一於該步驟(C)之後進行判斷累計的失敗總次數是否達到一第二預設次數,若是,則令該網路儲存裝置將之後收到的檔案直接儲存於該儲存單元內。The method for storing a file in a network storage device according to claim 2, further comprising: determining whether the total number of failed failures after the step (C) reaches a second predetermined number of times, and if so, The network storage device stores the files received later in the storage unit directly. 一種網路儲存裝置,適於透過網路連接至少一電子裝置,該網路儲存裝置包含:一存取介面,能接收來自該電子裝置的檔案;一儲存單元,儲存該存取介面所接收的檔案;一控制模組,在該存取介面接收一檔案時會執行一預先配置動作,以在該儲存單元中搜尋一特定大小的儲存空間;一記憶模組,當該控制模組執行儲存該檔案的預先配置動作失敗時,該記憶模組會累計一次的失敗次數;及一處理模組,會判斷該記憶模組所累計的失敗次數是否達到一第一預定次數,若是,則令該控制模組停止執行該預先配置動作並直接儲存該檔案於該儲存單元,若否,則令該控制模組重新執行該預先配置動作,以搜尋一較前次搜尋的儲存空間小的次儲存空間。A network storage device is adapted to connect at least one electronic device through a network, the network storage device comprising: an access interface capable of receiving files from the electronic device; and a storage unit storing the received by the access interface a control module, when the access interface receives a file, performs a pre-configured action to search for a specific size storage space in the storage unit; a memory module, when the control module performs storage When the pre-configure action of the file fails, the memory module accumulates the number of failures; and a processing module determines whether the number of failures accumulated by the memory module reaches a first predetermined number of times, and if so, the control is performed. The module stops executing the pre-configured action and directly stores the file in the storage unit. If not, the control module re-executes the pre-configured action to search for a secondary storage space that is smaller than the storage space of the previous search. 依據申請專利範圍第7項所述之網路儲存裝置,其中,當該控制模組完成執行儲存該檔案,該處理模組令該記憶模組將累計的失敗次數加入失敗總次數,以累計每一檔案執行該預先配置動作的失敗次數。According to the network storage device of claim 7, wherein the processing module causes the memory module to add the accumulated number of failures to the total number of failures to accumulate each time when the control module finishes executing the storage of the file. The number of failures of a file to perform this pre-configured action. 依據申請專利範圍第8項所述之網路儲存裝置,其中,在儲存該檔案之前,該處理模組會判斷該失敗總次數是否達到一第二預定次數,若是,則令該控制模組使該檔案直接儲存於該儲存單元。According to the network storage device of claim 8, wherein the processing module determines whether the total number of failures reaches a second predetermined number of times before storing the file, and if so, causes the control module to make The file is stored directly in the storage unit. 依據申請專利範圍第9項所述之網路儲存裝置,其中,當該失敗總次數達到該第二預定次數後,該處理模組會判斷該儲存單元是否增加一特定大小的儲存空間,若是,則令該控制模組重新執行該預先配置動作。According to the network storage device of claim 9, wherein, when the total number of failures reaches the second predetermined number of times, the processing module determines whether the storage unit increases a storage space of a certain size, and if so, Then the control module re-executes the pre-configured action. 依據申請專利範圍第7項所述之網路儲存裝置,其中,該處理模組與該控制模組由一中央處理單元實現,在儲存該檔案之前,該處理模組會判斷該中央處理單元的使用率是否達到一預設值,若是,則令該控制模組停止執行該預先配置動作且使該檔案直接儲存於該儲存單元。The network storage device of claim 7, wherein the processing module and the control module are implemented by a central processing unit, and the processing module determines the central processing unit before storing the file. Whether the usage rate reaches a preset value, and if so, causes the control module to stop performing the pre-configured action and store the file directly in the storage unit. 依據申請專利範圍第8項所述之網路儲存裝置,其中,在儲存該檔案之後,該處理模組會判斷該失敗總次數是否達到一第二預定次數,若是,則令該控制模組將之後收到的檔案直接儲存於該儲存單元。According to the network storage device of claim 8, wherein after the file is stored, the processing module determines whether the total number of failures reaches a second predetermined number of times, and if so, causes the control module to The received file is then stored directly in the storage unit.
TW98137221A 2009-11-03 2009-11-03 Method for storing files in network attached storage and network attached storage using the method TWI396987B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98137221A TWI396987B (en) 2009-11-03 2009-11-03 Method for storing files in network attached storage and network attached storage using the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98137221A TWI396987B (en) 2009-11-03 2009-11-03 Method for storing files in network attached storage and network attached storage using the method

Publications (2)

Publication Number Publication Date
TW201117025A TW201117025A (en) 2011-05-16
TWI396987B true TWI396987B (en) 2013-05-21

Family

ID=44935076

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98137221A TWI396987B (en) 2009-11-03 2009-11-03 Method for storing files in network attached storage and network attached storage using the method

Country Status (1)

Country Link
TW (1) TWI396987B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200521676A (en) * 2003-10-07 2005-07-01 Ibm Method, system, and program for processing a file request
US20070078914A1 (en) * 2005-09-30 2007-04-05 International Business Machines Corporation Method, apparatus and program storage device for providing a centralized policy based preallocation in a distributed file system
TW200842630A (en) * 2007-03-02 2008-11-01 Manual System Sdn Bhd E A method of data storage and management
US20080288738A1 (en) * 2006-12-22 2008-11-20 Parag Gokhale Systems and methods of data storage management, such as pre-allocation of storage space

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200521676A (en) * 2003-10-07 2005-07-01 Ibm Method, system, and program for processing a file request
US20070078914A1 (en) * 2005-09-30 2007-04-05 International Business Machines Corporation Method, apparatus and program storage device for providing a centralized policy based preallocation in a distributed file system
US20080288738A1 (en) * 2006-12-22 2008-11-20 Parag Gokhale Systems and methods of data storage management, such as pre-allocation of storage space
TW200842630A (en) * 2007-03-02 2008-11-01 Manual System Sdn Bhd E A method of data storage and management

Also Published As

Publication number Publication date
TW201117025A (en) 2011-05-16

Similar Documents

Publication Publication Date Title
US9146684B2 (en) Storage architecture for server flash and storage array operation
US20210096840A1 (en) Soc-assisted resilient boot
CN104685476B (en) For restoring the method, system and product of virtual machine
US9377964B2 (en) Systems and methods for improving snapshot performance
WO2019195969A1 (en) Data synchronization processing method and apparatus
US20150089287A1 (en) Event-triggered storage of data to non-volatile memory
US10645164B1 (en) Consistent latency for solid state drives
JP6305976B2 (en) Method, apparatus and system for delaying packets during execution of a network-driven wakeup operation on a computing device
JP5647624B2 (en) Multi-server application synchronization method, program, and system without interrupting I / O
US8924785B2 (en) Power shutdown prediction for non-volatile storage devices
US10860447B2 (en) Database cluster architecture based on dual port solid state disk
JP2010524053A (en) In-band problem log data collection method between host and storage system, computer program, and system (in-band problem log data collection between host and storage system)
JP6005116B2 (en) Automated migration of files recalled by specific applications
US8578064B2 (en) Interception and management of I/O operations on portable storage devices
US8732429B2 (en) Preserving a deleted data volume
US9032414B1 (en) Systems and methods for managing system resources allocated for backup validation
US20150081979A1 (en) Storage integration for host-based write-back caching
WO2021104383A1 (en) Data backup method and apparatus, device, and storage medium
TW201443774A (en) Rebuild of redundant secondary storage cache
US9785641B2 (en) Reducing a backup time of a backup of data files
JP6652647B2 (en) Storage system
EP4148572B1 (en) Computational storage device and storage system including the computational storage device
TWI396987B (en) Method for storing files in network attached storage and network attached storage using the method
US8984336B1 (en) Systems and methods for performing first failure data captures
TWI778295B (en) Information handling system, power operation controller thereof and method of handling power requests during cluster operations