CN102055738B - Method for storing file in network storage device and network storage device - Google Patents

Method for storing file in network storage device and network storage device Download PDF

Info

Publication number
CN102055738B
CN102055738B CN 200910210789 CN200910210789A CN102055738B CN 102055738 B CN102055738 B CN 102055738B CN 200910210789 CN200910210789 CN 200910210789 CN 200910210789 A CN200910210789 A CN 200910210789A CN 102055738 B CN102055738 B CN 102055738B
Authority
CN
China
Prior art keywords
storage devices
network storage
failure
document
file
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN 200910210789
Other languages
Chinese (zh)
Other versions
CN102055738A (en
Inventor
陈剑航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wistron Corp
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 CN 200910210789 priority Critical patent/CN102055738B/en
Publication of CN102055738A publication Critical patent/CN102055738A/en
Application granted granted Critical
Publication of CN102055738B publication Critical patent/CN102055738B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention discloses a method for storing a file in a network storage device and the network storage device. The method is applied to the network storage device with a storage unit, and comprises the following steps of: (A) in the process of storing the file in the network storage device, executing a pre-configured action to search whether a storage space in specified size is present in the storage unit, if so, storing the file in the storage space, otherwise, performing a step (B); (B) accumulating primary failure times in a storage module of the network storage device, and judging whether the accumulated failure times reaches the first preset times, if so, stopping executing the pre-configured action and directly storing the file in the storage unit, otherwise, performing a step (C); and (C) re-executing the pre-configured action to search whether a sub-storage space smaller than the previously searched storage space is present in the storage unit, if so, storing the file in the sub-storage space, otherwise, repeating the step (B). Therefore, the pre-configured action can be flexibly used.

Description

Store files is in method and the network storage devices of a network storage devices
Technical field
The present invention relates to a kind of method and network storage devices of store files, particularly a kind of store files in method and the network storage devices of a network storage devices.
Background technology
In network world, UNIX operating system and Windows operating system are each other when transmitting file, can make each other and can intercourse resource by the software Samba of cover framework on NetBIOS (Network Basic Input/Output System) communication protocol.
For instance, the computer of use Windows operating system uses the network storage devices of UNIX operating system (Linux) by network connection, and both all are equiped with Samba, when the computer desire is stored into network storage devices with file by Samba, Samba can carry out pre-configured (pre-allocation) action earlier, deposit file in the hard disk of network storage devices, to search for enough big storage areas as far as possible, make file can be stored in hard disk scatteredly, and with the be stored in hard disk of specific amount of capacity with file integral body or dispersion, thus, when reading file, have usefulness preferably.
Yet, CPU (the Central Processing Unit of this pre-configured action meeting consumption network storage device, CPU) resource, if the hard disk of network storage devices itself has not had enough big storage area, and still carry out the words of pre-configured action, cause the unnecessary burden of CPU of network storage devices beyond doubt, therefore, how using pre-configured action effectively will be the improved problem of a worth research.
Summary of the invention
Therefore, purpose of the present invention is namely in the method for the store files that provides a kind of elasticity to use pre-configured action in a network storage devices.
So store files of the present invention is applied to have the network storage devices of a storage element in the method for a network storage devices, this method comprises:
(A) in network storage devices when storing a file, carry out a pre-configured action earlier, with search in storage element whether the storage area of one specific size is arranged, if then store files if not, is then carried out step (B) in this storage area;
(B) frequency of failure of accumulative total in a memory module of network storage devices, and whether the frequency of failure of judging accumulative total reaches one first preset times, if then stop to carry out pre-configured action and direct store files in storage element, if not, then carry out step (C); And
Whether (C) re-execute pre-configured action has the little inferior storage area, storage area of search more last time in the storage element with search, if then store files is in inferior storage area, if not, repeating step (B) then.
Another object of the present invention is to provide a kind of network storage devices of using above-mentioned method.
So, network storage devices of the present invention, be suitable for by at least one electronic installation of network connection, this network storage devices comprises an access interface, one storage element, one control module, one memory module and a processing module, access interface can receive the file from electronic installation, the file that the storage unit stores access interface receives, control module can be carried out a pre-configured action when access interface receives a file, storage area with search one specific size in storage element, and when control module is carried out the pre-configured baulk of store files, memory module can add up the frequency of failure once, processing module can judge whether the frequency of failure that memory module adds up reaches one first pre-determined number, if, then make control module stop to carry out the also direct store files of pre-configured action in storage element, if not, then make control module re-execute pre-configured action, to search for a little inferior storage area, storage area of more last time searching for.
Effect of the present invention is, store files can be applied to network storage devices in the method for a network storage devices, the pre-configured action of network storage devices before store files can flexibly be used, the usefulness of the CPU of keyholed back plate network storage devices makes network storage devices successfully to work by this.
Description of drawings
Fig. 1 is a schematic diagram, illustrates that store files of the present invention is applied between a network storage devices and the electronic installation in the method for a network storage devices;
Fig. 2 is a framework calcspar, and the internal hardware framework of this network storage devices is described;
Fig. 3 is a flow chart, illustrates that store files of the present invention is in the method for a network storage devices;
Fig. 4 is a flow chart, illustrates that the store files of another flow process is in the method for a network storage devices; And
Fig. 5 is a schematic diagram, illustrates that store files of the present invention is applied between a network storage devices and a plurality of electronic installation in the method for a network storage devices.
The primary clustering symbol description:
2 network storage devices, 23 CPU
21 access interfaces, 231 control modules
22 hard disks, 233 processing modules
221 storage modules, 3 electronic installations
222 memory modules, 901~916 steps
Embodiment
About aforementioned and other technology contents, characteristics and effect of the present invention, in the detailed description of following cooperation two preferred embodiments with reference to the accompanying drawings, can clearly present.
Before the present invention is described in detail, be noted that in the following description content similarly assembly is to represent with identical numbering.
Consult Fig. 1, Fig. 1 is that store files of the present invention is in first preferred embodiment of the method for a network storage devices, this method is applied to a network storage devices 2, network storage devices 2 is with electronic installation 3 mat network connections and all be equiped with Samba, network storage devices 2 can transmit file by Samba mutually with electronic installation 3, and in the present embodiment, this method is to realize with a software program, this software program can be integrated in the Samba software, also can with the separate work of Samba.In the present embodiment, network storage devices 2 is NAS (the Network AttachedStorage of UNIX operating system (Linux), the network attached storage device), also can be other webservers, and electronic installation 3 can connect the electronic installation of online for the computer of Windows operating system or other.
Consult Fig. 2, network storage devices 2 comprises an access interface 21, one storage element (is to be example with hard disk 22 in the present embodiment, but not as limit) and a CPU 23, access interface 21, hard disk 22 and CPU 23 threes couple mutually, wherein, access interface 21 is in order to receive the power on file of sub-device 3 of automatic network, hard disk 22 comprises storage module 221 and a memory module 222 that can store the file that access interface 21 receives, CPU 23 comprises a control module 231 and a processing module 233, and the effect of above-mentioned functional block will be described further below.
Cooperate and consult Fig. 2 and Fig. 3, when electronic installation 3 desires with a file (for example: when 9GB) being sent to network storage devices 2, at first, the access interface 21 of network storage devices 2 receives file, afterwards, shown in step 901, because operating system can record the present utilization rate of CPU 23, so the processing module 233 of CPU 23 can read the present utilization rate of the CPU 23 that operating system records, and whether the utilization rate of judging CPU 23 (for example: 80%) reaches a preset value, if, then processing module 233 makes control module 231 that the file that access interface 21 receives is carried out the storage module 221 that pre-configured action namely directly is stored in hard disk 22 without Samba, as step 902; If not, then processing module 233 judges then whether the failure total degree of totally carrying out pre-configured action in the memory module 222 reaches one second preset times, as step 903, and please hold the back explanation about the definition of failure total degree.If the failure total degree reaches second preset value, then processing module 233 makes control module 231 that the file that access interface 21 receives is carried out the storage module 221 that pre-configured action namely directly is stored in hard disk 22 without Samba, as step 904; If the failure total degree does not reach second preset value, then carry out step 905.
In step 905, processing module 233 make control module 231 carry out Samba and carry out whether have in the storage module 221 of pre-configured action with search hard disk 22 one make file needn't be stored in dispersedly hard disk 22 storage module 221 greater than the storage area of this document size (for example: 10GB), then, if control module 231 is carried out pre-configured the action successfully, then execution in step 906, and processing module 233 makes control module 231 file is stored in the storage area that searches; If control module 231 is carried out pre-configured baulk, then execution in step 907, and processing module 233 makes the memory module 222 accumulative totals frequency of failure once.Then, after step 907, carry out step 908, shown in step 908, processing module 233 can judge earlier whether the frequency of failure of memory module 222 accumulative totals reaches one first preset times, if, then processing module 233 makes control module 231 stop to carry out pre-configured action and the file that access interface 21 receives directly is stored in the storage module 221 of hard disk 22, as step 909; If not, then processing module 233 make control module 231 re-execute whether having in the storage module 221 of pre-configured action with search hard disk 22 one more last time the little inferior storage area, storage area of search (for example: 8GB), as step 910.
In step 910, if control module 231 is carried out pre-configured the action successfully, shown in step 911, processing module 233 makes control module 231 file is stored in the inferior storage area that searches, at this moment, because time storage area is less than file size, so file will be disperseed to store, and file rest parts method that mat is same is begun to seek a storage area that is fit in the storage module 221 of hard disk 22 by step 901; If control module 231 is carried out pre-configured baulk, will re-execute step 907, judge that up to step 908 frequency of failure of accumulative total reaches first preset times, or the pre-configured action that re-executes step 907 has searched littler inferior storage area.Afterwards, no matter be that execution in step 909 or step 911 all can enter step 912, processing module 233 makes memory module 222 that the frequency of failure of accumulative total is added the failure total degree, and the failure total degree refers to that namely network storage devices 2 is in the summation that stores the performed pre-configured baulk number of times of each file, at last, execution in step 913, processing module 233 make memory module 222 that the frequency of failure is made zero, and namely finish the file store operation.Wherein above-mentioned first preset times, second preset times and preset value can be finished by the internal processes setting.
Additional disclosure be, in step 902, when carrying out pre-configured action without Samba, then control module 231 is that file directly is stored in the fragmentary or storage area that disperses of the storage module 221 of hard disk 22, but processing module 233 still can continue to judge the utilization rate of CPU 23 simultaneously, in case utilization rate is lower than preset value, processing module 233 military order control modules 231 are suspended store files earlier, and carry out step 903, judge whether to carry out pre-configured action earlier, because if can come store files by pre-configured action, when reading or utilize file, have preferable usefulness afterwards.In addition, because step 901 and both judgment mechanisms of step 903 there is no precedence relationship, and step 902 is identical with step 904, thus also can first execution in step 903 execution in step 901 again, the visual practical situations adjustment of its execution sequencing.
What deserves to be explained is, when the CPU 23 of network storage devices 2 is handled a lot of things (for example: carry out to transmit receive the encryption and decryption functions of file or a plurality of electronic installations are arranged simultaneously at accessing file) and utilization rate when too high simultaneously, can be by the setting of step 901, aspect store files, adopt and directly file is stored in the storage module 221 of hard disk 22, and need not carry out pre-configured action, to make CPU 23 operate as normal that reduces the heavy burdens, and can be excessively unexpected of machine (crash) because of load.
Moreover, when the failure total degree of memory module 222 accumulative totals is too much, it is few or remaining space is scrappy little space to represent space remaining in the storage module 221 of hard disk 22, at this moment, if continuing to carry out before storing each file pre-configured action will make a futile effort, waste the resource of CPU 23 on the contrary, therefore, setting by step 903, can be before carrying out pre-configured action, the state of the storage module 221 of elder generation's mat failure total degree interpretation hard disk 22, if the failure total degree is too high, then need not carry out pre-configured action, change file directly is stored in the storage module 221 of hard disk 22, to alleviate the burden of CPU 23.
In addition, after the failure total degree reaches second preset times, store files of the present invention also can be carried out a step 914 after step 904 in the method for a network storage devices, shown in step 914, processing module 233 judges whether the storage module 221 of hard disk 22 disengages the storage area of a specific size, if the total degree of then will failing makes zero.In this step, processing module 233 understands in the storage module 221 that judge hard disk 22 whether increase by a specific storage area, similarly be that the deleted or storage module 221 of hard disk 22 of file in the storage module 221 of hard disk 22 is through the disk reorganization and Free up Memory, if, processing module 233 makes the failure total degree of memory module 222 make zero, as step 915, thus, when file need deposit the storage module 221 of hard disk 22 in, then can begin to carry out the step of present embodiment shown in Figure 3 again; If not, then repeating step 914, and processing module 233 continues to judge in the storage module 221 of hard disk 22 whether increase by a specific storage area.Wherein, specific storage area is to pass through internal processes, ratio according to the storage module 221 last capacity of Free up Memory and hard disk 22 is set, for instance, when processing module 233 judge Free up Memories surpass hard disk 22 storage module 221 last capacity 20%, the total degree of then will failing makes zero.
Consult Fig. 4, Fig. 4 is an alternate embodiment of present embodiment, that is the execution sequence of set-up procedure 903, step 904, step 914 and step 915 can reach equally as above-mentioned effect, is described in detail as follows.Step 903 is adjusted to after the step 912, if processing unit 233 is judged accumulative total and is carried out the failure total degree of pre-configured action and reach second preset times, then make control module 231 when the follow-up file of receiving of execution stores, then stop to carry out pre-configured action and directly the follow-up file of receiving is stored in the storage module 221 of hard disk 22, as step 916, and carry out step 913; If do not reach second preset times, then carry out step 913.In addition, after execution in step 916, can carry out step 914 and step 915, as discussed previouslyly make zero with the total degree of will failing, and can start pre-configured action, so the adjustment through step can reach above-mentioned effect equally.
Consult Fig. 5, Fig. 5 is that store files of the present invention is in second preferred embodiment of the method for a network storage devices, this method is applied to a network storage devices 2, network storage devices 2 is with a plurality of electronic installation 3 mat network connections and all be equiped with Samba, network storage devices 2 can transmit file by Samba mutually with a plurality of electronic installations 3, the present embodiment store files is to realize with a software program in the method for a network storage devices, this software program can be integrated in the Samba software, also can with the separate work of Samba.In the present embodiment, network storage devices 2 can be configured to a LAN framework with a plurality of electronic installations 3, makes resource and the storage volume of electronic installation 3 shared network storage devices 2.
When each electronic installation 3 is desired store files to network storage devices 2, similarly can carry out the step that judges whether to carry out pre-configured action as first preferred embodiment of Fig. 3, and the difference of second preferred embodiment and first preferred embodiment is that network storage devices 2 is provided with mutual exclusion mechanism, that is processing module 233 can avoid a plurality of electronic installations 3 to write the failure total degree simultaneously and the situation of the total degree mistake of failing in memory module 222, and remaining process step is identical with first preferred embodiment.
In sum, store files of the present invention can be applied to network storage devices 2 in the method for a network storage devices, the pre-configured action of network storage devices 2 before store files can efficiently be reached to be used neatly, the usefulness of the CPU 23 of keyholed back plate network storage devices 2 by this, make network storage devices 2 successfully to work, so can reach purpose of the present invention really.
The above person of thought, it only is preferred embodiment of the present invention, can not limit scope of the invention process with this, i.e. the every scope of claims and simple equivalent variations and modification that the invention description content is done according to the present invention all still belongs in the scope that patent of the present invention contains.

Claims (12)

1. a store files is applied to have the network storage devices of a storage element in the method for a network storage devices, and this method comprises:
(A) in this network storage devices when storing a file, carry out a pre-configured action earlier, with search in this storage element whether the storage area of one specific size is arranged, if, then store this document in this storage area, if not, then carry out step (B);
(B) frequency of failure of accumulative total in a memory module of this network storage devices, and whether the frequency of failure of judging accumulative total reaches one first preset times, if then stop to carry out this pre-configured action and directly store this document in this storage element, if not, then carry out step (C); And
(C) re-execute this pre-configured action searching for whether the little inferior storage area, storage area of search is more last time arranged in this storage element, if, then store this document in this time storage area, if not, repeating step (B) then.
2. store files according to claim 1 is in the method for a network storage devices, also be included in the step (B), add a failure total degree with storing the frequency of failure that this document added up, this each file of failure total degree accumulative total is carried out the frequency of failure of this pre-configured action.
3. store files according to claim 2 is in the method for a network storage devices, also be included in this step (A) and judge before whether the failure total degree of accumulative total reaches one second preset times, if, then make this network storage devices directly store this document in this storage element, if not, then carry out step (A).
4. store files according to claim 3 is in the method for a network storage devices, also comprise when this failure total degree and reach this second preset times and directly store this document behind this storage element, judge whether this storage element disengages the storage area of a specific size, if the total degree of then should failing makes zero.
5. store files according to claim 1 is in the method for a network storage devices, comprise that also one judges before in this step (A) whether the utilization rate of a CPU of this network storage devices reaches a preset value, if, then make this network storage devices directly store this document in this storage element, if not, then carry out step (A).
6. store files according to claim 2 is in the method for a network storage devices, comprise that also one judges whether failure total degree totally reaches one second preset times after adding a failure total degree and storing this document will storing the frequency of failure that this document adds up, if the file that then makes this network storage devices receive afterwards directly is stored in this storage element.
7. a network storage devices is suitable for by at least one electronic installation of network connection, and this network storage devices comprises:
One access interface can receive the file from this electronic installation;
One storage element stores the file that this access interface receives;
One control module can be carried out a pre-configured action when this access interface receives a file, with the storage area of search one specific size in this storage element;
One memory module, when this control module was carried out the pre-configured baulk that stores this document, this memory module can add up the frequency of failure once; And
One processing module, can judge whether the frequency of failure that this memory module adds up reaches one first pre-determined number, if, then make this control module stop to carry out this pre-configured action and also directly store this document in this storage element, if not, then make this control module re-execute this pre-configured action, to search for a little inferior storage area, storage area of more last time searching for.
8. network storage devices according to claim 7, wherein, when this control module is finished the operation that carry out to store this document, this processing module makes this memory module that the frequency of failure of accumulative total is added the failure total degree, carries out the frequency of failure of this pre-configured action with each file of accumulative total.
9. network storage devices according to claim 8, wherein, before storing this document, this processing module can judge whether this failure total degree reaches one second pre-determined number, if then make this control module make this document directly be stored in this storage element.
10. network storage devices according to claim 9, wherein, after this failure total degree reaches this second pre-determined number and this control module and makes this document directly be stored in this storage element, this processing module can judge whether this storage element increases the storage area of a specific size, if the total degree of then will failing makes zero and makes this control module re-execute this pre-configured action.
11. network storage devices according to claim 7, wherein, this processing module and this control module are realized by a CPU, before storing this document, this processing module can judge whether the utilization rate of this CPU reaches a preset value, if then make this control module stop to carry out this pre-configured action and making this document directly be stored in this storage element.
12. network storage devices according to claim 8, wherein, after storing this document, this processing module can judge whether this failure total degree reaches one second pre-determined number, if the file that then makes this control module receive afterwards directly is stored in this storage element.
CN 200910210789 2009-11-10 2009-11-10 Method for storing file in network storage device and network storage device Active CN102055738B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910210789 CN102055738B (en) 2009-11-10 2009-11-10 Method for storing file in network storage device and network storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910210789 CN102055738B (en) 2009-11-10 2009-11-10 Method for storing file in network storage device and network storage device

Publications (2)

Publication Number Publication Date
CN102055738A CN102055738A (en) 2011-05-11
CN102055738B true CN102055738B (en) 2013-07-03

Family

ID=43959667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910210789 Active CN102055738B (en) 2009-11-10 2009-11-10 Method for storing file in network storage device and network storage device

Country Status (1)

Country Link
CN (1) CN102055738B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1300982A (en) * 2000-12-13 2001-06-27 深圳市海尔信息科技有限公司 Method for randomly changing positions of root directory area and file allocation table in storage
CN1719537A (en) * 2004-07-05 2006-01-11 万国电脑股份有限公司 Storage control method with storage volume information analysis function
CN101201795A (en) * 2006-12-13 2008-06-18 英业达股份有限公司 Method and system for dynamically distributing and processing computer data storage space

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1300982A (en) * 2000-12-13 2001-06-27 深圳市海尔信息科技有限公司 Method for randomly changing positions of root directory area and file allocation table in storage
CN1719537A (en) * 2004-07-05 2006-01-11 万国电脑股份有限公司 Storage control method with storage volume information analysis function
CN101201795A (en) * 2006-12-13 2008-06-18 英业达股份有限公司 Method and system for dynamically distributing and processing computer data storage space

Also Published As

Publication number Publication date
CN102055738A (en) 2011-05-11

Similar Documents

Publication Publication Date Title
CN103036956B (en) A kind of distributed configuration mass data filing system and implementation method
CN102169484B (en) Comprehensive, relative and dynamic data search in virtual environment
CN111046011B (en) Log collection method, system, device, electronic equipment and readable storage medium
US20110153748A1 (en) Remote forensics system based on network
RU2624576C2 (en) Electronic discovery in storages
CN103731489B (en) A kind of date storage method, system and equipment
CN103180842A (en) Cloud computing system and data synchronization method therefor
CN105025053A (en) Distributed file upload method based on cloud storage technology and system
WO2014101445A1 (en) Data query method and system
CN102375837A (en) Data acquiring system and method
CN106471501A (en) The method of data query, the storage method data system of data object
CN105426427A (en) MPP database cluster replica realization method based on RAID 0 storage
CN109189749A (en) File synchronisation method and terminal device
CN107832159A (en) Manage the method and computer-readable recording medium of distributed lock
CN102917006A (en) Method and device for achieving uniform control management of computing resource and object authority
CN102713925A (en) Sensitive information leakage prevention system, sensitive information leakage prevention method and sensitive information leakage prevention program
CN113051102B (en) File backup method, device, system, storage medium and computer equipment
CN102984256A (en) Processing method and system for metadata based on authorization manner
WO2014133630A1 (en) Apparatus and method for handling partially inconsistent states among members of a cluster in an erratic storage network
CN106980618B (en) File storage method and system based on MongoDB distributed cluster architecture
CN102932476B (en) Network storage synchro system
CN106815318B (en) Clustering method and system for time sequence database
CN102055738B (en) Method for storing file in network storage device and network storage device
CN103500108A (en) System memory access method, node processor and multi-processor system
JP2014127179A (en) Method, program, and network storage for asynchronous copying in optimized file transfer order

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant