1. Technical Field
The embodiments of the present disclosure relate to management technology, and particularly to a compressed package upload management system and method.
2. Description of Related Art
A data center is a facility which houses a large number of computers and stores huge amounts of data. By using cloud computing, the files are uploaded into a data center. However, at present, the data center may store a plurality of repetitive files, which wastes a lot of storage spaces. For example, the data center may repetitively store the same file five times. Furthermore, different files stored in the data center may share one or more same portions, which also waste a lot of storage spaces. Therefore, there is room for improvement in the art.
The disclosure is illustrated by way of examples and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The dividing module 1000 divides the compressed package into two or more data blocks. In one embodiment, the compressed package may include multiple data files which are packed and compressed into a single file for easier portability and storage via a file compressed packager (e.g., WINRAR tool). In other words, the compressed package is a compressed file in ZIP or RAR file format. Additionally, the compressed package may be encrypted using an encryption algorithm (e.g., international data encryption algorithm, or describes symmetric and asymmetric algorithm). As shown in
The calculation module 1002 calculates a hash value of each data block. In one embodiment, the calculation module 1002 invokes a hash function to calculate the hash value of each data block.
The saving module 1004 saves encrypted information of the compressed package, the hash value of the compressed package, the hash value of each data block, and a sequence number of each data block into a hash list stored in a database 3. The hash list corresponds to the compressed package.
The removing module 1006 obtains repetitive data blocks in the client 1 according to the hash value of each data block and deletes the repetitive data blocks from the client 1, and sets a storage space in the server 2 for storing each data block from the client 1. In one embodiment, if the data block stored in the client is the same as the data block stored in the server 2, the data block stored in the client 1 is determined as a repetitive data block. The removing module 1006 obtains the repetitive data blocks using a file distributor. The file distributer searches the database 3, and determines if the database 3 contains two or more hash values which are the same. Each hash value corresponds to one data block, when the database 3 includes two or more hash values which are the same, the client 1 includes one data block which is the same as the data block stored in the server 2. If the database 3 includes two or more hash values which are the same, the removing module 1006 obtains the repetitive data block and deletes the repetitive data block from the client 1. For example, if the database 3 includes two hash values which are the same, the removing module 1006 deletes the repetitive data block corresponding to the two hash values from the client 1. Additionally, each data block corresponds to a pointer that points to the storage space. In other words, a user uses the pointer to find the storage space. The storage space may store one or more data blocks in the server 2. Furthermore, even the repetitive data blocks are deleted from the client 1, however, each repetitive data block is also assigned to one pointer, and the pointer corresponding to the repetitive data block is the same as the pointer corresponding to the data block in the server 2, wherein the repetitive data block is the same as the data block in the server 2.
The notification module 1008 notifies a user about information of the repetitive data blocks. The information of the repetitive data blocks includes pointers of the repetitive data blocks.
The uploading module 1010 uploads each data block from the client 1 into the storage space corresponding to the data block. In one embodiment, when the server 2 receives the data blocks from the client 1, the server 2 also calculates the hash value of each data block, and verifies if the hash value of each data block exists in the hash list. If the hash value of each data block exists in the hash list, the server 2 saves each data block into the storage space corresponding to the data block. If one hash value of the data block does not exist in the hash list, the server 2 rejects the client 1 for uploading the data blocks and notifies the client 1 that the data block is rejected for uploading.
In step S100, the dividing module 1000 divides the compressed package into two or more data blocks. In one embodiment, the compressed package is encrypted or unencrypted. For example, as shown in
In step S102, the calculation module 1002 calculates a hash value of each data block. As mentioned above, the calculation module 1002 invokes a hash function to calculate the hash value of each data block.
In step S104, the saving module 1004 saves encrypted information of the compressed package, the hash value of the compressed package, the hash value of each data block and a sequence number of each data block into a hash list stored in a database 3. The hash list corresponds to the compressed package. The encrypted information of the compressed package indicates whether the compressed package is encrypted or not. In detail, when the compressed package is encrypted, the encrypted information of the compressed package may be a letter, such as “Y.” When the compressed package is unencrypted, the encrypted information of the compressed package may be another letter, such as “N.”
In step S106, the removing module 1006 obtains repetitive data blocks in the client 1 according to the hash value of each data block and deletes the repetitive data blocks from the client 1, and sets a storage space in the server 2 for storing each data block from the client 1. In one embodiment, the data block stored in the client 1 is determined as the repetitive data block upon the condition that the data block stored in the client is the same as the data block stored in the server 2. Due to each hash value corresponding to one data block, if the database 3 includes two or more hash values which are the same, the client 1 includes one data block which is the same as the data block stored in the server 2, the removing module 1006 obtains the repetitive data block and deletes the repetitive data block from the client 1. For example, if the database 3 includes two hash values which are the same, the removing module 1006 deletes the repetitive data block corresponding to the two hash values from the client 1. Additionally, each data block corresponds to a pointer that points to the storage space. The storage space may store one or more data blocks in the server 2. Furthermore, even the repetitive data blocks are deleted in the client 1, however, each repetitive data block is also assigned to one pointer, and the pointer corresponding to the repetitive data block is the same as the pointer corresponding to the data block in the server 2, wherein the repetitive data block is the same as the data block in the server 2.
In step S108, the notification module 1008 notifies a user about information of the repetitive data blocks. The information of the repetitive data blocks includes pointers of the repetitive data blocks.
In step S110, the uploading module 1010 uploads each data block from the client 1 into the storage space corresponding to the data block. In one embodiment, when the server 2 receives the data blocks from the client 1, the server 2 also calculates the hash value of each data block, and verifies if the calculated hash value of each data block exists in the hash list stored in the database 3. If the calculated hash value of each data block exists in the hash list, the server 2 saves each data block into the storage space corresponding to the data block. If one hash value of the data block does not exist in the hash list, the server 2 rejects the client 1 for uploading the data blocks and notifies the client 1 that the data block is rejected for uploading the data block.
In step S200, the download module 1012 obtains a hash value of an encrypted compressed package and a pointer of each data block of the encrypted compressed package from the database 3.
In step S202, the download module 1012 downloads each data block of the encrypted compressed package according to the pointer of each data block from the server 2.
In step S204, the download module 1012 calculates a hash value of each downloaded data block and determines if the hash value of each downloaded data block exists in the hash list stored in the database 3.
In step S206, the download module 1012 saves all downloaded data blocks into a temporary storage space of the client 1 when the hash value of each downloaded data block exists in the database 3. The temporary storage space of the client 1 may be, but is not limited to, a random access memory (RAM).
In step S208, the download module 1012 combines all downloaded data blocks to generate the encrypted compressed package in the temporary storage space according to the sequence number of each downloaded data block.
In step S210, the download module 1012 calculates the hash value of the generated compressed package and determines the calculated hash value of the generated compressed package exists in the hash list stored in the database 3. If the calculated hash value of the generated compressed package exists in the hash list, the download module 1012 displays success information (e.g., display “SUCCESS”) in a display device of the client 1. If the calculated hash value of the generated compressed package does not exists in the hash list, the download module 1012 displays fail information (e.g., display “FAIL”) in the display device of the client 1.
In step S300, the download module 1012 obtains a hash value of an unencrypted compressed package and a pointer of each data block of each file in the unencrypted compressed package from the database 3.
In step S302, the download module 1012 downloads each data block of the unencrypted compressed package according to the pointer of each data block from the server 2.
In step S304, the download module 1012 calculates a hash value of each downloaded data block and determines if the calculated hash value of each downloaded data block exists in the hash list stored in the database 3.
In step S306, the download module 1012 saves all downloaded data blocks into a temporary storage space of the client 1 when the calculated hash value of each downloaded data block exists in the database 3.
In step S308, the download module 1012 combines all downloaded data blocks to generate one or more files and compresses the one or more file to generate an unencrypted compressed package.
In step S310, the download module 1012 calculates the hash value of the generated compressed package and determine if the calculated hash value of the generated compressed package exists in the database 3. If the calculated hash value of the generated compressed package exists in the hash list, the download module 1012 displays success information (e.g., display “SUCCESS”) in a display device of the client 1. If the calculated hash value of the generated compressed package does not exists in the hash list, the download module 1012 displays fail information (e.g., display “FAIL”) in the display device of the client 1.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2012105336575 | Dec 2012 | CN | national |