Embodiments of the present disclosure relate to storage space management technology, and particularly to a system and method for expanding storage space of a network device.
Network devices, such as IP cameras and network video recorders (NVRs) can include storage devices for storing media data. The storage devices can be secure digital (SD) cards or network attached storage (NAS) devices, for example. However, a storage space of the storage device can be limited. If the storage space is not enough, additional storage devices need to be added, or the storage device needs to be replaced with another storage device having a larger storage space. It is inconvenient and inefficient to manage the storage spaces of multiple storage devices.
Implementations of the present disclosure will now be described, by way of example only, with reference to the following drawings. The modules in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present disclosure. Moreover, in the drawings, like reference numerals designate corresponding portions throughout the views.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references can mean “at least one,” or “one or more.”
In the present disclosure, “module,” refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a program language. In one embodiment, the program language can be Java, C, or assembly. One or more software instructions in the modules can be embedded in firmware, such as in an EPROM. The modules described herein can be implemented as either software and/or hardware modules and can be stored in any type of non-transitory computer-readable media or storage medium. Non-limiting examples of a non-transitory computer-readable medium include CDs, DVDs, flash memory, and hard disk drives.
The network device 10 further includes a local storage space 40. The local storage space 40 may be provided by a storage device 50 inside of or connected to the network device 10. The storage device 50 may be a dedicated memory, such as an erasable programmable read-only memory (EPROM), a hard disk drive (HDD), or flash memory. The local storage space 40 also may be provided by a network attached storage (NAS) device 60 being within the same local area network (LAN) as the network device 10.
Using the above-mentioned modules, when the network device 10 is required to store data (for example, target data 70), the storage space expanding system 100 detects an available storage space of the local storage space 40. If the available storage space is not enough for storing the target data 70, the storage space expanding system 100 transfers the earliest stored data in the local storage space 40 to one or more cloud storage spaces of the cloud network 30, thus freeing enough space of the local storage space 40 to store the target data 70. A description of each module of the storage space expanding system 100 is given in the following paragraphs.
In step S10, the setting module 110 sets a storage order of the cloud storage spaces of the cloud network 30 for expanding the local storage space 40 of the network device 10. The storage order determines a sequence for storing specified data of the network device 10 into one or more cloud storage spaces. In one embodiment, the setting module 110 stores access information of one or more available cloud storage spaces of the cloud network 30 in a configuration file of the network device 10. The access information includes, but is not limited to, an access path, an access account, and an access password of each of the available cloud storage spaces.
In one embodiment, the storage order is set according to an order of the access information in the configuration file. The specified data of the network device 10 is stored into one or more specified cloud storage spaces according to the order of the access information. If a current specified cloud storage space is not enough for storing the specified data, the specified data can be stored in another specified cloud storage space, for example the next specified cloud storage space.
In step S20, the receiving module 120 receives target data 70 from the network device 10. In one embodiment, the target data 70 is media data recorded by the network device 10 (e.g., a network camera).
In step S30, the detection module 130 detects an available storage space of the local storage space 40.
In step S40, the detection module 130 determines whether a size of the available storage space is less than a preset value. In one embodiment, the preset value is set dynamically according to a size of the target data 70, and a size of the preset value is greater than or equal to the size of the target data 70. For example, if the size of the target data 70 is 200 megabytes (MB), the preset value is set to be equal to or greater than 200 MB. In other embodiments, the preset value may be set to be a fixed value according to actual requirements. If the size of the available storage space is less than the preset value, step S60 is implemented. If the size of the available storage space is greater than or equal to the preset value, step S50 is implemented.
In step S50, the storing module 140 stores the target data 70 into the local storage space 40, and the procedure ends.
In step S60, the expanding module 150 copies the earliest stored data of the local storage space 40 into one or more specified cloud storage spaces according to the storage order. In the illustrated embodiment, the earliest stored data in the local storage space 40 is file “a1,” and the expanding module 150 copies the file “a1” into the corresponding specified cloud storage space/s according to the storage order.
In step S70, the expanding module 150 deletes the copied data (e.g. file “a1”) from the local storage space 40, thus freeing storage space from the local storage space 40, and the procedure returns to step S30. Step S60 is repeated, until the size of the available storage space is greater than or equal to the preset value, and the storing module 140 stores the target data 70 into the local storage space 40.
All of the processes described above may be embodied in, and fully automated via, functional code modules executed by one or more general purpose processors such as the processor 80. The code modules may be stored in any type of non-transitory readable medium or other storage device such as the storage device 50. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory readable medium may be a hard disk drive, a compact disc, a digital versatile disc, a tape drive, or other suitable storage medium.
The described embodiments are merely examples of implementations, and have been set forth for a clear understanding of the principles of the present disclosure. Variations and modifications may be made without departing substantially from the spirit and principles of the present disclosure. All such modifications and variations are intended to be included within the scope of this disclosure and the described inventive embodiments, and the present disclosure is protected by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
102108564 | Mar 2013 | TW | national |