1. Technical Field
Embodiments of the present disclosure relate to data index creating systems and methods, and particularly to a computing device and a method for generating sequence indexes for data files of the computing device.
2. Description of Related Art
Managing and searching through massive amounts of data files has become difficult for users. Current file systems need to be frequently searched, updated, and existing data files need to be deleted in a database of a computer system. Obviously, data indexes for the data files will greatly affect the speed of the computer system. The file systems may use the data indexes to organize the data files, and have been helpful in management of the data files. However, a key challenge is how to create data indexes for the files data in the file systems. Therefore, there is room for improvement in the art.
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 mean “at least one.”
In the present disclosure, the word “module,” as used herein, 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 may be 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 a non-transitory computer-readable medium include CDs, DVDs, flash memory, and hard disk drives.
The computing device 1 further includes, but is not limited to, an input device 11, a storage device 12 and at least one processor 13. In one embodiment, the storage device 12 may be an internal storage system, such as a random access memory (RAM) for temporary storage of information, and/or a read only memory (ROM) for permanent storage of information. The storage device 12 may also be an external storage system, such as an external hard disk, a storage card, network access storage (NAS), or a data storage medium. The at least one processor 13 is a central processing unit (CPU) or microprocessor that performs various functions of the computing device 1.
The storage device 12 includes a database that stores a data index list and a plurality of data files.
In one embodiment, the sequence index generating system 10 includes a data receiving module 101, a number calculating module 102, an index creating module 103, and an index saving module 104. The modules 101-104 may comprise computerized instructions in the form of one or more programs that are stored in a non-transitory computer-readable media (e.g., the storage device 12) and executed by the at least one processor 13. A description of each module is given in the following paragraphs.
In step S21, the data receiving module 101 receives index information of a data file from the input device 11. The data file needs to be added into a database of the storage device 12. In the embodiment, the index information of the data file includes a data index of the data file and the content of the data file. Referring to
In step S22, the data receiving module 101 checks the last index of the data index list stored in the database of the storage device 12. Referring to
In step S23, the number calculating module 102 determines storage capacity of the database of the storage device 12, and generates an m-digits number according to the storage capacity of the database. In one embodiment, the m-digits number may include, but is not limited to, a quaternary number, a binary number, an octal number, a decimal number, and a hexadecimal number. For example, if the storage capacity of the database is 1632960 bytes, the number calculating module 102 generates an octal number. If the storage capacity of the database is 58786560 bytes, the number calculating module 102 generates a hexadecimal number.
In step S24, the number calculating module 102 calculates the m-digits number of the last index to obtain a sequence number. In the embodiment, the sequence number is a digital number that is calculated according to the last index and is increased in sequence, such as a decimal number “10”, a decimal number “20”, a decimal number “30”, . . . , and a decimal number “50” as shown in
In step S25, the index creating module 103 generates a sequence index of the data file according to the sequence number of the last index and the index information of the data file.
In one embodiment, the index creating module 103 generates the sequence index of the data file by calculating a HASH value of the sequence number and the index information using a HASH function. The hash function is an algorithm that maps data of variable length to data of a fixed length. The values returned by a hash function are called hash values, or hash codes, or hash sums, or checksums, or simply hashes. In one example with respect to
In step S26, the index saving module 104 inserts the sequence index of the data file into the last position in the data index list, and saves the data index list into the database of the storage device 12.
Although certain disclosed 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 |
---|---|---|---|
2012103464460 | Sep 2012 | CN | national |