Summary of the invention
Purpose of the present invention is for providing a kind of have extensive compatibility and encryption function, copyright protection function, intelligent typesetting technique and compressed mobile terminal apparatus electronic file storage and the method for managing.
The technical scheme that realizes above-mentioned purpose is as follows:
The method of mobile terminal apparatus electronic file storage and management comprises the following steps:
(1) material file is prepared, and file includes one or more of text, audio file, video file, image file;
(2) material format conversion is stored on the computing machine with document storage function;
(3) according to the size Distribution Calculation machine memory block of material file, and it is formatd by predetermined format, fill corresponding memory block according to the order of text, image, audio frequency, video, and fill in the essential information of this data content in the initial data position of every section block;
(4) fill up a document in the corresponding format position of the file essential information of data content;
(5) fill in pre-assigned directory feature data bit in directory area, and the information of this data bit;
(6) fill in pre-assigned bookmark feature data bit in the bookmark zone, and the information of this data bit;
(7) fill in copyright information in the copyright data position;
(8) data in the memory block of whole file are carried out alignment of data, and compile data message and prepare for compression;
(9) memory block at file Chinese version place is cut apart, compressed by the size of 16K, the block after the compression is carried out 2 compressions by the size of 265K again, to realize maximum ratio of compression and compression efficiency;
(10) XOR cryptographic operation based on 2 system machine codes is carried out in the particular data position of block after the compression;
(11) produce the promptly unified unique discriminating digit of GUID, these data are kept in the server of the present invention simultaneously and e-book in, press predetermined AES-128 algorithm in the block after compression with data check information, be about to this GUID is inserted into each data block as the CRC check sign indicating number reference position;
(12) add at random the data bit of obscuring by predetermined AES-128 algorithm in the block after compression;
(13) generate a standard format files, and copy on the destination mobile terminal equipment;
(14) this standard format files of decoding on target terminal is read the file essential information, comprises the GUID enciphered message, copyright information, index bit;
(15) with the GUID enciphered message, to decipher and be GUID, whether GUID is correct in checking;
(16) if GUID is correct, the data after decompressing are carried out the XOR decryption oprerations, then data block is decompressed,, data block is converted into basic text, picture, audio frequency, video information;
(17) display text on destination mobile terminal equipment plays sound and video;
(18) on destination mobile terminal equipment, user interface is set, but edit-modify upgrades editing area, and in DRM is the controlled range of digital copyright management, propagate this document.
The format conversion of text is the wide character text that text is converted to UTF-16LE, be kept in the calculator memory, and according to the visual screen size of mobile terminal device the text is formatd, promptly calculate the initial and offset data bits of row, page or leaf, paragraph, and result of calculation is preserved; Carrying out optimum efficiency according to good as calculated result at the visual screen size of different mobile terminal equipment then on mobile terminal device shows.
The format conversion of audio file is that the MP3 format audio file is converted to the OGG form, is kept in the calculator memory, and with its essential information, code check, length recorded and stored in the lump; On mobile terminal device, play then according to good as calculated result.
The format conversion of video file is that the essential information of mpeg format video file is extracted and preserved, and these information comprise filename, length, audio coding mode, video coded system, code check, size; On mobile terminal device, play then according to good as calculated result.
The format conversion of image file is that the format conversion with image file is a jpeg format, but and dwindle according to the apparent size of the mobile terminal device jpeg file after to conversion, and adjusting image quality, and be stored in the internal memory after extracting the image essential information, these information comprise filename, length, size, coded system, color depth; Carrying out optimum efficiency according to good as calculated result at the visual screen size of different mobile terminal equipment then on mobile terminal device shows.
Technique scheme shows: the present invention realizes that with a series of software and hardware technologies digital content comprises literal, digital movie, digital music, picture etc. to digital format of content conversion, compression, encryption, protection, integrated.The topmost purpose of the present invention is compression and encipherment protection digital content, makes the within the scope of authority use of the buyer of digital content in appointment.
Be that example further specifies implication of the present invention now with the process of selling electronic book of mobile phone.An author has write a book, and gives publishing house and publish into e-book, and e-book is sold by online bookstore, has sold a reader, and the role who relates to here has author, publishing house, website and reader.In the process of exchange, need system of the present invention e-book is identified (as only sign such as title, ISBN), firm sale price etc.The reader pays and afterwards downloads this e-book from the website, can on the mobile terminal device of oneself, read, its book encryption, compression, interpolation supplementary, content be generated the formatted file of naming with the present invention after setting type again in the present invention after the mandate that obtains the author.The present invention promptly is the carrier of digital content in the overall process that moves the service of reading, is also bearing the role that the balance electronic book is worth simultaneously in service, and is embodying invisible right, protection publishing house, the author's, consumer's interests.
The distinctive encryption of the present invention, compression, composing algorithm are described below:
The present invention is directed to the technology of text, duplicate number to text is controlled, characteristic at mobile terminal device recomputates composing, make text more the sensitive paper book is equally easy on mobile terminal device and received by the consumer, also be beneficial to the ISP and sell, press the mobile terminal device type and sell by " basis ".The consumer can buy unique copy of text or online reading text etc.
The present invention is directed to the technology of image, audio frequency, video multimedia, realized that with distinctive encryption, compression, format conversion a plurality of media files coexist in a file, preserve with data bit discrete way the most effective, that save most.Effectively save the storage space of mobile terminal device and realized the direct access of multimedia on mobile terminal device.
Owing to there is multiple multimedia file format, this has increased difficulty for the coding of mobile terminal device.Arranged voice data in the present invention and adopted the OGG encoding and decoding, video adopts the MPEG encoding and decoding, and text adopts the UNICODE coding.The present invention will carry out the corresponding format conversion to these materials before the multimedia material is made as e-book.Encrypt with compression and finish simultaneously.Wherein compression is to use the ZLIB algorithm, uses this algorithm can be compatible with mobile terminal device and PC.And encrypt is the cryptographic algorithm of a kind of AxCrypt of being called as, and this is a kind of file encryption algorithm based on the AES-128 standard.AES is the password of an iteration, symmetric key grouping, and the present invention uses 128 keys, and with 128 (16 byte) block encryption and data decryptions.Use key to different with public key cryptography, symmetric key cipher is used identical secret key encryption and data decryption.The figure place of the enciphered data of returning by block cipher is identical with the input data.Iterative cryptographic uses a loop structure, repeats to replace and replace the input data to reach the purpose of encryption in this circulation.Simultaneously under situation to multiple coded file coexistence, for guaranteeing to store to greatest extent data, to there be the zone in space also to preserve data in each data block inside, and in position that index bit of the present invention identifies these data so that reduction, Here it is so-called discrete way but not common to its mode.
Format conversion
With the text formatting file conversion of personal computer is the wide character binary format of storing with the XML form, image file is converted to the Joint Photographic Experts Group image of consolidation form, music file is converted to the standard A AC or the OGG formatted file of mobile terminal device standard, video file format is converted to the standard mpeg format of mobile terminal device standard.
The section compression
Data are used the primary multiple compression of compression algorithm of mobile terminal device with the form of binary machine code by the memory block that takies fixed measure, effectively use each data bit, and between ratio of compression and compression efficiency, get the reading experience that optimal proportion promotes the user, according to investigation data reality: the user is 1 second at the longest sustainable decompression stand-by period, and the present invention's acquiescence is 1 second being compression time as with reference to determining compression efficiency.
The data ordering form
(these forms comprise respectively: the text of various codings with the formatted file of compatibility, audio frequency is MP3, WAV, MIDI, video is AVI, ASF, WAV, RM, picture is BMP, GIF, JPEG, JPEG2000, PNG), arrange digital content, label substance, content of copyright, format information content in format sequence occupy-place mode.
Label
With the initial data position of various formatted files, or the special data position after the format is made into label, making things convenient for the user index digital content, and provides redundant data bits, and follow-up expansion and change are provided.Defined the visible index of a kind of user in the present invention, i.e. label.Each label has identified the position and the explanation at the various formatted files place in the e-book of the present invention respectively, for example a label that is named as " figure three " has just identified the position of an illustration among the present invention, and the user can be by selecting this label quick indexing to this figure.And these labels are that the user can edit, and the user can increase or revise label and use with convenient.
Catalogue
The human oriented design of digital content is provided,, offers user index in the mode of catalogue with the arbitrary data bit-identify of author's appointment.So-called sign arbitrary data position be the present invention the Production Editor constantly, can be with as catalogue, paragraph, illustration, the reference position of multi-medium data is designated catalogue.
Copyright information
Copyright information is filled in the data bit of reservation, and no longer provides the modification interface after once filling for the user.Shown in Fig. 5 storage format structural representation of the present invention, in formative data bit, also remain with the copyright data position, these data bit can be filled in the information relevant with copyright such as comprising author, publisher, copyright statement.
Data bit is encrypted and effect
Digital content is carried out encrypting based on the XOR of data bit, and write data effect position, and obscure data bit, promote the security of digital content.Wherein the aes algorithm of Jia Miing is based on displacement and replacement.Displacement is rearranging of data, and replacement is to replace another with a cell data.Several different technology of having used AES realize displacement and replace.In order to illustrate these technology, a concrete AES encryption example is discussed with the data shown in following.Be 128 place values that will encrypt and the array of indexes of their correspondences below:
00?11?22?33?44?55?66?77?88?99?aa?bb?cc?dd?ee?ff
0?1?2?3?4?5?6?7?8?9?10?11?12?13?14?15
The value of 192 keys is:
00?01?02?03?04?05?06?07?08?09?0a?0b?0c?0d?0e?0f?10?11?12?13?14?15?16?17
0?1?2?3?4?5?6?7?8?9?10?11?12?13?14?15?16?17?18?19?20?21?22?23
When the constructed fuction (constructor) of AES when being called, two tables that are used for encryption method are initialised.First table is to replace box to be called the S-box.It is one 16 * 16 a matrix.The preceding five-element of S-box and the first five row are as shown in Figure 1.Encryption routine is obtained this key array and is generated a w[by name with it behind the scenes] the key schedule table, shown in Figure 2.
W[] initial Nk (6) row is used as seed, with primary key value (0x00 is to 0x17).The residue row produces from seed key.The seed key length that variable Nk representative is a unit with 32 words.When analyzing the AES realization after a while, will be clear that w[] how to produce.Key is to use many keys here and not just one.These new keys are called as round key (round keys) being come in they and the difference of primordial seed key.
It is in 4 * 4 byte matrixes of input array to a State by name (attitude) of copy 16 bytes that the AES encryption routine begins.(referring to Fig. 3).The AES cryptographic algorithm is named as Cipher, and it operates State[].
In standard, the treatment step of the preparation that cryptographic algorithm realizes is called as AddRoundKey (round key adds).AddRoundKey carries out XOR (XOR) operation of a byte of a byte with the preceding four lines in the key schedule table to the State matrix, and with round key table w[c, r] XOR input State[r, c].
Give an example, if the byte that first row of State matrix is preserved be 00,44,88, cc}, the first row key schedule table be 00,04,08,0c}, so new State[0,2] value is to use w[2,0] (0x08 or 0x80) XOR State[0,2] (0x88) result:
1?0?0?0?1?0?0?0
0?0?0?0?1?0?0?0?XOR
1?0?0?0?0?0?0?0
The major cycle of aes algorithm is carried out four different operations to the State matrix, is called as SubBytes (byte replacement), ShiftRows (line displacement conversion), MixColumns (row mixing transformation) and AddRoundKey in standard.Except each circulation A ddRoundKey is called and uses the following four lines of key schedule table, AddRoundKey is identical with AddRoundKey in the preliminary treatment step.The SubBytes routine is one and replaces operation that it replaces to a new byte by the Sbox decision with each byte in the State matrix.Such as, if State[0,1] if value be the supplanter that 0x40 wants to find it, get State[0,1] value (0x40) and allow x equal left-hand digit (4) and allow y equal the right numeral (0).Enter in the Sbox table as index with x and y then and seek the replacement value, as shown in Figure 1.
ShiftRows is a replacement operator, it with the byte in the State matrix to anticlockwise.How Fig. 4 ShiftRows that demonstrated operates State[].The 0th row of State is by to 0 position of anticlockwise, and the 1st row of State is by to 1 position of anticlockwise, and the 2nd row of State is by to 2 positions of anticlockwise, and the 3rd row of State is by to 3 positions of anticlockwise.
MixColumns is one and replaces operation, and it is the part of tool skill (needing most the part of thinking hard in other words conj.or perhaps) when understanding aes algorithm.It carries out mathematical field with the value of State byte stream and adds the result who takes advantage of with the territory and replace each byte.Take advantage of details with explaining in detail that in the next section special territory adds with the territory.
Suppose State[0,1] value be 0x09, and other value on the row 1 is respectively 0x60,0xe1 and 0x04, State[0 so, 1] new value be calculated as follows:
State[0,1]=(State[0,1]*0x01)+(State[1,1]*0x02)+(State[2,1]*0x03)+(State[3,1]*0x01)
=(0x09*0x01)+(0x60*0x02)+(0xe1*0x03)+(0x04*0x01)
=0x57
Addition and multiplication are special mathematical field operations herein, rather than the addition and the multiplication of usual integer.
SubBytes, ShiftRows, MixColumns and four of AddRoundKey operate in one and carry out in Nr time the circulation and be called, and Nr is that the wheel number of given cipher key size subtracts 1.The wheel number that cryptographic algorithm is used or be 10,12, or be 14, this depends on seed key length is 128,192 or 256.In this example, because Nr equals 12, then these four operations are called 11 times.After this iteration was finished, before output parameter, cryptographic algorithm finished after calling SubBytes, ShiftRows and AddRoundKey at copy State matrix.
In general, the core of AES cryptographic algorithm has four operations.AddRoundKey uses the round key that generates from the seed key value to replace 4 groups of bytes.SubBytes replaces and replaces single byte with a substitution list.ShiftRows carries out the sequence displacement by 4 groups of bytes of rotating 4 byte row.MixColumns adds the combination of taking advantage of with the territory with the territory and replaces byte
Adopt AES to become the de facto standards of encrypting the form of ownership electronic information, replace DES.The AES ciphered data is unbreakable in some sense, because there is not known crypt analytical attack can decipher the AES ciphertext, unless all possible 256 keys of traversal search by force.
File copy of the present invention after will making to the destination mobile terminal equipment after, to be moved terminal device identification, use the mobile terminal device client software can open file of the present invention, arbitrary data in the browser document arbitrarily, and be presented at the viewing area of mobile terminal device with the ways of presentation of the best.Reduce the storage space that takies mobile terminal device greatly, reduced the calculated load of mobile terminal device greatly, also reduced simultaneously and opened with the required electric weight of class file, but client software provides user interface to revise the editing area that upgrades in the file of the present invention at the mobile terminal device inediting simultaneously, and can propagate this document in the controlled range of DRM.In the protected while of body matter that guarantees e-book, provide the user to revise such as catalogue contents such as bookmark with needs according to oneself being accustomed to.For example the user can increase convenient reading next time of a bookmark, but the data that these users edit are to separate to preserve with the e-book body matter, do not influence the independence and the integrality of body matter.The user also can share the mobile terminal device of e-book to other by mobile terminal device simultaneously, and new e-book copy will remain with participator's GUID, also make the user receive the restriction of DRM and author's copyright to greatest extent when sharing e-book.Use such technology to make and become possibility in file transfers between personal computer and mobile terminal device and the secure file transmission between mobile terminal device, the form that represents of various mobile terminal device hardware Chinese version data and multi-medium data has also been unified in the influence of the personal computer file layout that also weakened greatly to mobile terminal device greatly.
As shown from the above technical solution, the present invention can make the personal computer file of different-format be converted to the discernible file of mobile terminal device by mode of the present invention, and uses in mobile terminal device in mode provided by the invention.Realized the ardware feature of simplification, format, multimedization and the suitable more mobile terminal device of mobile terminal device file.But simplified more the personal computer file few to the migration of move and operation steps simple in structure, improved compatibility, dirigibility, security and extensibility, make between mobile terminal device and all under the copyright protection of digital content, realize compatible between personal computer with standardized file mode.
Popularizing along with intelligent mobile terminal equipment as from the foregoing, originally migrated in the mobile terminal device based on the file of PC and used, yet because the software and hardware characteristic difference between the various mobile terminal devices, had a strong impact on the compatibility of mobile terminal device to the PC file, and relevant copyright safety, these problems have all obtained solution in the present invention.The present invention also has following beneficial effect:
1, based on the file encryption algorithm that has used the AES-128 standard, key and block length all are 128, cycle index 10,12,14 times, and on Cipher Strength, AES is very safe.
2, based on the File Compress technology of having used the ZLIB algorithm, improved 30% than traditional Z IP compress technique under the equal environment, and it is compatible based on the Symbian platform, the JAVAME platform, the WindowsMobile platform, linux kernel platform, MTK platform, open up fast platform, the multiple mobile terminal devices of Brew platform.
3, mobile terminal device has used intelligent composing algorithm, realized the Auto-Sensing under the mobile terminal device hardware environment, automatic calculating, Automatic Optimal, total discrimination covers all and meets the Symbian standard, the MTK standard, the spreadtrum standard, the armamentarium of Brew standard and WindowsMobile standard and the above standard of CLDC1.0.
4, adopt multiple file layout to mix storage means, realized mobile terminal device in theory the PC file, and the full compatibility of multimedia file, the total discrimination of the file after transcoding blendes together reaches 100%.
5, the copyright protection technology of mobile terminal device file numeral is filled in the data bit of reservation with copyright information, and after once filling no longer for the user provides the modification interface, improved the level of copyright protection.
6, the human oriented design of digital content is provided,, has offered user index, improved the level of mobile terminal device file directory management with retrieval in the mode of catalogue with the arbitrary data bit-identify of author's appointment.
Embodiment
Present embodiment is that example describes to finish the file of the present invention of making a standard on personal computer;
1, prepares material file, comprise content of text, one section novel for example, the mpeg 3 format audio file of one section 1M byte, one section 1M byte mpeg format video file, the image file of several different-formats, different size, different quality with 100,000 words.
2, the wide character text that text is converted to UTF-16LE is kept in the calculator memory, and the text is formatd according to the visual screen size of mobile terminal device, promptly calculate the initial and offset data bits of row, page or leaf, paragraph, and result of calculation is preserved.
3, the file conversion of mpeg 3 format audio is kept in the calculator memory for the OGG form, and with its essential information, for example recorded and stored in the lump such as code check, length.
4, the essential information (these information comprise filename, length, audio coding mode, video coded system, code check, size) of mpeg format video file is extracted and is preserved.
5, the format conversion with image file is a jpeg format, but and dwindle according to the apparent size of the mobile terminal device jpeg file after to conversion, and the adjusting image quality, and be stored in the internal memory after extracting image essential information (these information comprise filename, length, size, coded system, color depth).
6, according to the size Distribution Calculation machine memory block of material file, and it is formatd by form of the present invention, fill corresponding memory block according to the order of text, image, audio frequency, video, and fill in the essential information of this data content in the initial data position of every section block.
7, the essential information that fills up a document in the corresponding format position of file.
8, fill in pre-assigned directory feature data bit in directory area, and the information of this data bit.
9, fill in pre-assigned bookmark feature data bit in the bookmark zone, and the information of this data bit.
10, fill in copyright information in the copyright data position.
11, the data in the memory block of whole file are carried out alignment of data, and compile data message and prepare for compression.
12, the memory block at file Chinese version place is cut apart, compressed by the size of 16K, the block after the compression is carried out 2 compressions by the size of 265K again, to realize maximum ratio of compression and compression efficiency.
13, XOR cryptographic operation based on 2 system machine codes is carried out in the particular data position of block after the compression.
14, produce GUID, be kept at these data in the server of the present invention simultaneously and e-book in.By predetermined (AES-128) algorithm data check information (being about to this GUID as the CRC check sign indicating number) is inserted into the ad-hoc location (being the reference position of data block) of each data block in the block after compression.
15, add at random the data bit of obscuring by predetermined (AES-128) algorithm in the block after compression, the difficulty that cracks with increasing.
16, can generate the file of the present invention of a standard format through after the above-mentioned steps, and copy on the destination mobile terminal equipment.
17, this standard format files of decoding on target terminal is read the file essential information, comprises the GUID enciphered message, copyright information, index bit;
18, with the GUID enciphered message, to decipher and be GUID, whether GUID is correct in checking;
If 19 GUID are correct, the data after decompressing are carried out the XOR decryption oprerations, then data block is decompressed,, data block is converted into basic text, picture, audio frequency, video information;
20, display text on destination mobile terminal equipment plays sound and video;
21, on destination mobile terminal equipment, user interface is set, but editor, modification, renewal editing area, and can in the DRM controlled range, propagate this document.