CN103136293B - The format design of picture resource bag and read method - Google Patents

The format design of picture resource bag and read method Download PDF

Info

Publication number
CN103136293B
CN103136293B CN201110399517.9A CN201110399517A CN103136293B CN 103136293 B CN103136293 B CN 103136293B CN 201110399517 A CN201110399517 A CN 201110399517A CN 103136293 B CN103136293 B CN 103136293B
Authority
CN
China
Prior art keywords
picture
information
picture file
resource bag
concordance list
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
CN201110399517.9A
Other languages
Chinese (zh)
Other versions
CN103136293A (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.)
Fujian Star Net eVideo Information Systems Co Ltd
Original Assignee
Fujian Star Net eVideo Information Systems Co Ltd
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 Fujian Star Net eVideo Information Systems Co Ltd filed Critical Fujian Star Net eVideo Information Systems Co Ltd
Priority to CN201110399517.9A priority Critical patent/CN103136293B/en
Publication of CN103136293A publication Critical patent/CN103136293A/en
Application granted granted Critical
Publication of CN103136293B publication Critical patent/CN103136293B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention provides a kind of format design and read method of picture resource bag, the format design method of described picture resource bag is: by the information of each picture file by picture file name information 0, picture file size information, picture file data information order carry out being packaged into described picture resource bag; The read method of described picture resource bag is: set up a concordance list; Obtain the information of each picture file in picture resource bag and the reference position of each picture file data information in picture resource bag of correspondence again, and be saved in concordance list; Secondly, when reading the information of certain picture file in picture resource bag, concordance list according to the picture file name information searching in the information of this picture file, and according to the reference position of this picture file data information in concordance list, search the reference position that this picture file data information is corresponding in picture resource bag.It is fast that the present invention reads picture file resource speed, greatly reduces the use amount of device memory.

Description

The format design of picture resource bag and read method
[technical field]
The present invention relates to field of embedded technology, particularly relate to a kind of format design and read method of picture resource bag.
[background technology]
Picture file obtains and reads, and is the important function of of KTV application program.KTV application program needs from the memory bank of different medium, get the resource of the picture resources such as singer's head portrait as KTV application program this locality.Current picture resource is often packaged into the form of bag, facilitates KTV program to obtain.
Two kinds are mainly contained: 1, decompress(ion) picture bag is placed in internal memory, Gains resources in internal memory of arriving when accessing certain picture resource in current resource bag read schemes.2, decompress(ion) picture bag is placed in external memory, Gains resources in external memory of arriving when accessing certain picture resource.Wherein resource bag is unziped in external memory, the read-write carrying out repeatedly to disk, efficiency comparison is poor, and occupies a large amount of external spaces; Resource bag is unziped in internal memory, a large amount of internal memories can be taken and carry out picture resource file, the internal memory of such waste equipment.
The method of data resource management is provided in prior art, if publication date is on May 28th, 2008, publication number is the Chinese patent " a kind of management method of multi-kind resource " of CN101187926A, its unique point is: first, read resource index table from the packet header district of resource bag, determine the memory location of the data directory of resource requirement; Secondly, read described data directory, determine the memory location of desired data resource; Finally, accessing operation is carried out to desired data resource.By classifying to data, numbering, index be loaded in resource bag, strengthen the management to data resource, improve access efficiency, and effectively reduce the possibility occurring in data modification or escalation process to omit.The form more complicated of this invention resource bag; Its data directory be carry out when resource data store classifying, number, index time the write bag that generates in, because data directory is stored in bag, such resource bag is larger, and the resource taken is comparatively large, and reading speed is just slow; And read the concordance list that need fetch data when using on the target machine, such data directory is static, and dumb.So the management method of the multi-kind resource of this invention is impracticable for the acquisition of the picture file resource in KTV and reading.
[summary of the invention]
The technical problem to be solved in the present invention, is the format design and the read method that provide a kind of picture resource bag, achieves and reads picture file resource speed soon, decrease the use amount of device memory.
The present invention is achieved in that a kind of format design and read method of picture resource bag,
The format design method of described picture resource bag comprises the steps:
Step 10, described picture resource handbag are containing the information of a plurality of picture file, and the information of described picture file comprises picture file name information, picture file size information and picture file data information;
Step 11, by the information of each picture file by picture file name information 0, picture file size information, picture file data information, the random order of these three information is carried out being combined and packaged into described picture resource bag; Described 0 be the end mark of picture file name information;
The read method of described picture resource bag comprises the steps:
Step 20, set up the concordance list of the information of the corresponding picture file of a pictures file name information in device memory;
The reference position of each picture file data information in picture resource bag of step 21, picture file name information, picture file size information and the correspondence obtained in the information of each picture file in described picture resource bag, and be saved in described concordance list;
Step 22, when reading the information of certain picture file in described picture resource bag, concordance list according to the picture file name information searching in the information of this picture file, when not finding the information of this picture file that will search, prompting is not found; When finding the information of this picture file, then according to the reference position of this picture file data information in concordance list, search the reference position that this picture file data information is corresponding in described picture resource bag; And the information of this picture file is directly read according to reference position corresponding in picture resource bag.
Further, described concordance list comprises the reference position field of picture file name information field, picture file size information field and picture file data information.
Further, described picture file size information takies 4 byte spaces in described picture resource bag.
Tool of the present invention has the following advantages: the present invention only needs to preserve concordance list in device memory, the reference position of picture file name information, picture file size information and picture file data information only preserved by this concordance list, the real data message of picture file is not kept in internal memory, data in its picture resource bag need not unzip in device memory or external memory just can directly read out certain file resource, greatly reduces the use amount of internal memory.The present invention is in the process of the reading of picture resource bag, just simple in internal memory generating indexes table, and in reading process, only read the picture file name information in picture resource bag in each file and picture file size information, and record the reference position of picture file data information in picture resource bag.And traditional unpacking process can read mass data and write a large amount of data, so compare with traditional unpacking process, the encapsulation format of resource bag of the present invention is simple, the speed of the making of resource bag is fast, and concordance list is not kept in bag, therefore resource bag of the present invention is smaller, reading speed is fast, because the picture file name traveled through in advance time concordance list is and runs on the target machine in bag generates in internal memory with when corresponding picture file size, its concordance list dynamically generates, so the present invention also can according to different applied environments, operationally Classification Management is carried out to index, there is stronger dirigibility.
[accompanying drawing explanation]
Fig. 1 is the method flow schematic diagram of the format design of picture resource bag of the present invention.
Fig. 2 is the read method schematic flow sheet of picture resource bag of the present invention.
[embodiment]
Please refer to shown in Fig. 1 and Fig. 2, the format design of picture resource bag of the present invention and read method, wherein:
The format design method of described picture resource bag comprises the steps:
Step 10, described picture resource handbag are containing the information of a plurality of picture file, and the information of described picture file comprises picture file name information, picture file size information and picture file data information etc.;
Step 11, by the information of each picture file by picture file name information 0, picture file size information, picture file data information, the random order of these three information is carried out being combined and packaged into described picture resource bag; As shown in table 1 is the form of preferably a kind of picture resource bag in the present embodiment, described 0 be the end mark of picture file name information; Described picture file size information takies 4 byte spaces in described picture resource bag;
Table 1
Picture 1 filename 0 Picture 1 file size Picture 1 file data Picture 2 filename 0 Picture 2 file size
Picture 2 file data ...... Picture n filename 0 Picture n file size Picture n file data
The read method of described picture resource bag comprises the steps:
Step 20, set up the concordance list of the information of the corresponding picture file of a pictures file name information in device memory; Described concordance list comprises the reference position field of picture file name information field, picture file size information field and picture file data information;
The reference position of each picture file data information in picture resource bag of step 21, picture file name information, picture file size information and the correspondence obtained in the information of each picture file in described picture resource bag, and be saved in described concordance list;
Step 22, when reading the information of certain picture file in described picture resource bag, concordance list according to the picture file name information searching in the information of this picture file, when not finding the information of this picture file that will search, prompting is not found; When finding the information of this picture file, then according to the reference position of this picture file data information in concordance list, search the reference position that this picture file data information is corresponding in described picture resource bag; And the information of this picture file is directly read according to reference position corresponding in picture resource bag.
In a word, the present invention only needs to preserve concordance list in device memory, the reference position of picture file name information, picture file size information and picture file data information only preserved by this concordance list, the real data message of picture file is not kept in internal memory, data in its picture resource bag need not unzip in device memory or external memory just can directly read out certain file resource, greatly reduces the use amount of internal memory.The present invention is in the process of the reading of picture resource bag, just simple in internal memory generating indexes table, and in reading process, only read the picture file name information in picture resource bag in each file and picture file size information, and record the reference position of picture file data information in picture resource bag.And traditional unpacking process can read mass data and write a large amount of data, so compare with traditional unpacking process, reading speed of the present invention is fast.
It is worth mentioning that: the encapsulation format of picture resource bag of the present invention is not limited to one kind, table 1, namely by picture file name information 0, picture file size information, picture file data information order encapsulate, other sequential combination of three information can also be adopted to encapsulate, such as, by the information of each picture file by picture file size information, picture file name information 0, the order of picture file data information carries out being packaged into described picture resource bag etc.; It should be noted that in picture resource bag, the encapsulation order of the information of each picture file is consistent.
The foregoing is only preferred embodiment of the present invention, all equalizations done according to the present patent application the scope of the claims change and modify, and all should belong to covering scope of the present invention.

Claims (3)

1. the format design of picture resource bag and a read method, is characterized in that:
The format design method of described picture resource bag comprises the steps:
Step 10, described picture resource handbag are containing the information of a plurality of picture file, and the information of described picture file comprises picture file name information, picture file size information and picture file data information;
Step 11, by the information of each picture file by picture file name information 0, picture file size information, picture file data information, the random order of these three information is carried out being combined and packaged into described picture resource bag; Described 0 be the end mark of picture file name information;
The read method of described picture resource bag comprises the steps:
Step 20, set up the concordance list of the information of the corresponding picture file of a pictures file name information in device memory; The picture file name that concordance list travels through when being and running on the target machine in picture resource bag in advance generates in internal memory with when corresponding picture file size, and this concordance list dynamically generates;
The reference position of each picture file data information in picture resource bag of step 21, picture file name information, picture file size information and the correspondence obtained in the information of each picture file in described picture resource bag, and be saved in described concordance list, the data message of picture file is not kept in internal memory;
Step 22, when reading the information of certain picture file in described picture resource bag, data in picture resource bag need not unzip in device memory or external memory can directly read out certain file resource, concordance list according to the picture file name information searching in the information of this picture file, when not finding the information of this picture file that will search, prompting is not found; When finding the information of this picture file, then according to the reference position of this picture file data information in concordance list, search the reference position that this picture file data information is corresponding in described picture resource bag; And the information of this picture file is directly read according to reference position corresponding in picture resource bag.
2. the format design of picture resource bag according to claim 1 and read method, is characterized in that: described concordance list comprises the reference position field of picture file name information field, picture file size information field and picture file data information.
3. the format design of picture resource bag according to claim 1 and read method, is characterized in that: described picture file size information takies 4 byte spaces in described picture resource bag.
CN201110399517.9A 2011-12-02 2011-12-02 The format design of picture resource bag and read method Active CN103136293B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110399517.9A CN103136293B (en) 2011-12-02 2011-12-02 The format design of picture resource bag and read method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110399517.9A CN103136293B (en) 2011-12-02 2011-12-02 The format design of picture resource bag and read method

Publications (2)

Publication Number Publication Date
CN103136293A CN103136293A (en) 2013-06-05
CN103136293B true CN103136293B (en) 2016-01-13

Family

ID=48496125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110399517.9A Active CN103136293B (en) 2011-12-02 2011-12-02 The format design of picture resource bag and read method

Country Status (1)

Country Link
CN (1) CN103136293B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132978A (en) * 2017-12-13 2018-06-08 苏州长风航空电子有限公司 Applied to the picture resource packet generation method in instrument desk embedded system
CN110765290A (en) * 2019-10-25 2020-02-07 湖南省公安厅 Picture storage method, reading method, device and access system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6023705A (en) * 1995-08-11 2000-02-08 Wachovia Corporation Multiple CD index and loading system and method
CN101187901A (en) * 2007-12-20 2008-05-28 康佳集团股份有限公司 High speed cache system and method for implementing file access
CN101221533A (en) * 2007-01-10 2008-07-16 中兴通讯股份有限公司 Resource storage method and device
CN101639848A (en) * 2009-06-01 2010-02-03 北京四维图新科技股份有限公司 Spatial data engine and method applying management spatial data thereof
CN101763436A (en) * 2010-02-08 2010-06-30 深圳市茁壮网络股份有限公司 File packing method and tool
CN101901263A (en) * 2010-07-22 2010-12-01 华为终端有限公司 Access method and device of file system
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6023705A (en) * 1995-08-11 2000-02-08 Wachovia Corporation Multiple CD index and loading system and method
CN101221533A (en) * 2007-01-10 2008-07-16 中兴通讯股份有限公司 Resource storage method and device
CN101187901A (en) * 2007-12-20 2008-05-28 康佳集团股份有限公司 High speed cache system and method for implementing file access
CN101639848A (en) * 2009-06-01 2010-02-03 北京四维图新科技股份有限公司 Spatial data engine and method applying management spatial data thereof
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file
CN101763436A (en) * 2010-02-08 2010-06-30 深圳市茁壮网络股份有限公司 File packing method and tool
CN101901263A (en) * 2010-07-22 2010-12-01 华为终端有限公司 Access method and device of file system

Also Published As

Publication number Publication date
CN103136293A (en) 2013-06-05

Similar Documents

Publication Publication Date Title
CN106874348B (en) File storage and index method and device and file reading method
CN102609452B (en) Data storage method and data storage device
CN101162441B (en) Access apparatus and method for data
CN103345469B (en) The storage of set of numbers, querying method and device thereof
CN107168695B (en) Excel data analysis method and system
CN109284252B (en) Lightweight file system management method in communication equipment
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
CN102073633A (en) Method and device for storing and accessing resource file
CN102682108A (en) Row and line mixed database storage method
CN102622434A (en) Data storage method, data searching method and device
CN107817946A (en) For mixing the method and device of storage device read-write data
CN104516920A (en) Data inquiry method and data inquiry system
CN103049224A (en) Method, device and system for importing data into physical tape
CN102270238B (en) Method and device for establishing continuation of Chinese knowledge points
CN106257415A (en) Realize the method and apparatus of dynamic picture preview, expression bag methods of exhibiting and device
CN104008134A (en) Efficient storage method and system based on Hbase
CN103136293B (en) The format design of picture resource bag and read method
CN106951182A (en) A kind of block device caching method and device
CN102542041A (en) Method and system for processing raster data
CN108009049A (en) The offline restoration methods of MYISAM storage engines deletion records, storage medium
CN100462973C (en) XML file preprocessing method, apparatus, file structure, reading method and device
CN106201851A (en) The detection method of heap memory operation and device
CN101777077B (en) Method for implementing file system of embedded device
CN101620634A (en) Data statistics device and data statistics method
CN102270179B (en) For the data Storage and Processing method based on sheet unit and the system thereof of CAD system

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