CN102073633A - Method and device for storing and accessing resource file - Google Patents

Method and device for storing and accessing resource file Download PDF

Info

Publication number
CN102073633A
CN102073633A CN2009101940901A CN200910194090A CN102073633A CN 102073633 A CN102073633 A CN 102073633A CN 2009101940901 A CN2009101940901 A CN 2009101940901A CN 200910194090 A CN200910194090 A CN 200910194090A CN 102073633 A CN102073633 A CN 102073633A
Authority
CN
China
Prior art keywords
resource
file
resource file
data
packaging
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.)
Pending
Application number
CN2009101940901A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN2009101940901A priority Critical patent/CN102073633A/en
Publication of CN102073633A publication Critical patent/CN102073633A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention provides a method and a device for storing and accessing a resource file. The method comprises the following steps of: acquiring a resource file catalogue; generating a resource file mapping table according to the resource file catalogue; creating a header structure and an index area of a resource package file according to the resource file mapping table; traversing the resource file according to the resource file mapping table and packaging data of the resource file into the resource package file. By the method for storing and accessing the resource file, the resource file mapping table is generated according to the resource file catalogue, the header structure and the index area of the resource package file are created according to the resource file mapping table and the resource file is traversed according to the resource file mapping table, so that a plurality of logically inseparable resource files needed by instant massaging (IM) software can be packaged into a whole. When the resource file is accessed, the data of the resource file in the resource package file can be read according to the header structure and the index area, so the quick access to the resource file is realized.

Description

The memory access method and the device of resource file
[technical field]
The present invention relates to field of data storage, more particularly, relate to a kind of memory access method and device of resource file.
[background technology]
Along with the continuous development of internet communication, instant messaging (Instant Messaging is called for short " IM ") software has become user's amusement and recreation and the requisite software of work.In IM software, very frequent to the visit of various resource files, the imperfect meeting of resource file causes to the interface performance and has a strong impact on, and the access speed of resource file also can have influence on the performance of software.Current immediate communication tool adopts compound document that resource file is packed usually, promptly before issue IM software, resource file is write in the compound document, during the IM running software, from compound document the stored resource document analysis is come out again.
Yet the internal format of compound document is very complicated, and resource file writes in the process of compound document in packing as read-only file, can produce the lot of data fragment, thereby causes the access speed of resource file low.
[summary of the invention]
Based on this, be necessary to provide a kind of memory access method that realizes the resource file of fast access.
In addition, also be necessary to provide a kind of memory access device of realizing the resource file of fast access.
A kind of memory access method of resource file, described storage means comprises: obtain the resource file catalogue, generate the resource file mapping table according to described resource file catalogue; According to described resource file mapping table, set up the header structure and the index area of resource packaging file; According to described resource file mapping table traversal resource file, resource file data is packed in the described resource packaging file.
Preferably, resource file catalogue, the resource file data side-play amount in packaging file and the size of resource file data have been write down in the described resource file mapping table.
Preferably, described storage means also comprises: according to the side-play amount of resource file data in packaging file of packing, upgrade the content in the index area.
Preferably, described header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file; Described index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
Preferably, described access method may further comprise the steps: open the resource packaging file, resolve the header structure of described resource packaging file; According to described header structure, resolve the index area of described resource packaging file; According to the content in the described index area, read the resource file data in the described resource packaging file.
A kind of memory access device of resource file, described device comprises storer, described storer comprises: mapping block, be used to obtain the resource file catalogue, generate the resource file mapping table according to described resource file catalogue; The data configuration module is used for setting up resource packaging file header structure and index area according to described resource file mapping table; The packing data module is used for according to described resource file mapping table traversal resource file resource file data being packed in the described resource packaging file.
Preferably, the resource file mapping table of described mapping block generation has write down resource file catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
Preferably, described header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file; Described index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
Preferably, described storer also comprises: data update module is used for upgrading the index area content according to the side-play amount of the resource file data of packing at the resource packaging file.
Preferably, described device also comprises the addressed location of visiting described resource packaging file, and described addressed location comprises: parsing module, be used to open the resource packaging file, resolve the header structure of described resource packaging file, and, resolve the index area of described resource packaging file according to described header structure; Data read module is used for the content according to described index area, reads the resource file data in the described resource packaging file.
The memory access method and the device of above-mentioned resource file, generate the resource file mapping table according to the resource file catalogue, and set up the header structure and the index area of resource packaging file according to this resource file mapping table, according to resource file mapping table traversal resource file, then can be with a plurality of indivisible in logic resource file that needs in the IM software, promptly context has specific logic implication and is a plurality of available data files (as image, Voice ﹠ Video file) that are mutually related in the IM software program, can be packaged into an organic whole.During the access resources file, promptly can read resource file data in the resource packaging file, realized the fast access of resource file according to header structure and index area.
[description of drawings]
Fig. 1 is the process flow diagram of the storage means of resource file among the embodiment;
Fig. 2 is the synoptic diagram of the form of resource packaging file in the example;
Fig. 3 is the process flow diagram of the access method of resource file among the embodiment;
Fig. 4 is the structural representation of the memory access device of resource file among the embodiment;
Fig. 5 is the inner structure synoptic diagram of storer among another embodiment;
Fig. 6 is the inner structure synoptic diagram of addressed location among the embodiment.
[embodiment]
Fig. 1 shows the flow process of the storage means of resource file among the embodiment, and detailed process is as follows:
In step S100, obtain the resource file catalogue, generate the resource file mapping table according to described resource file catalogue.In one embodiment, the resource file mapping table has write down resource file catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
In step S102,, set up the header structure and the index area of resource packaging file according to the resource file mapping table.In one embodiment, the form of resource packaging file comprises header structure, three parts in index area and data field as shown in Figure 2, and the resource packaging file is a kind of read-only file.Header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file.The realization sign of resource packaging file is used to identify the form of packaging file, and the quantity that flows in the resource file has write down the quantity of the resource file of being packed in the resource bundle.The index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
In step S104,, resource file data is packed in the resource packaging file according to resource file mapping table traversal resource file.
In one embodiment, after resource file data packed, upgrade the content of index area.Particularly, be the side-play amount of resource file data in the resource packaging file according to packing, upgrade the index area content.
Said method has been set up the resource packaging file, this resource packaging file comprises header structure, index area and data field, the resource file data packing is stored in the data field of resource packaging file, then can be with a plurality of indivisible in logic resource file that needs in the IM software, promptly context has specific logic implication and is to be mutually related a plurality of available data files (as image in the IM software program, the Voice ﹠ Video file), be packaged into an organic whole, do not need resource file is carried out any change, thereby avoided the imperfect interface confusion of bringing of resource file, the greatly convenient management of software to read-only resource file.
Fig. 3 shows the flow process of the access method of resource file among the embodiment, and detailed process is as follows:
In step S200, open the resource packaging file, resolve the header structure of described resource packaging file.
In step S202,, resolve the index area of described resource packaging file according to described header structure.Owing to write down the index area side-play amount in the header structure, can obtain content in the index area according to header structure, the content in the index area comprises the side-play amount of resource file data, this side-play amount has promptly shown the memory location of resource file data in the data field, packing back.
In step S204,, read the resource file data in the described resource packaging file according to the content in the described index area.
Because the resource file in the IM software is packed in the resource packaging file, during visit, header structure and index area by the resolving resource packaging file, and read resource file data in the resource packaging file according to the content in the index area, thereby realized the fast access of resource file, the software that has promoted the user is experienced.
The memory access device of resource file comprises storer 100 and the packaging file of storer 100 is carried out the addressed location 200 of data access.Fig. 4 shows the storer 100 of a resource file, wherein:
Storer 100 comprises mapping block 120, data configuration module 140 and packing data module 160, and wherein: mapping block 120 is used to generate the resource file mapping table; Data configuration module 140 is used to set up the header structure and the index area of resource packaging file; Packing data module 160 is used for resource file data is packed into the resource packaging file.
In one embodiment, mapping block 120 obtains the resource file catalogue, generate the resource file mapping table according to the resource file catalogue, the resource file mapping table that is generated has write down resource file catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
In one embodiment, data configuration module 140 is set up the header structure and the index area of resource packaging file according to the resource file mapping table.The resource packaging file comprises header structure, three parts in index area and data field.Header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file.The realization sign of resource packaging file is used to identify the form of packaging file, and the quantity that flows in the resource file has write down the quantity of the resource file of being packed in the resource bundle.The index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
Packing data module 160 is packed into resource file data in the resource packaging file according to resource file mapping table traversal resource file in one embodiment.
Fig. 5 shows the storer 100 of resource file among another embodiment, and storer 100 also comprises data update module 180 except comprising above-mentioned mapping block 120, data configuration module 140 and packing data module 160 in one embodiment.Data update module 180 upgrades the content of index area after resource file is packed, particularly, be the side-play amount of resource file data in the resource packaging file according to packing, upgrades the index area content.
Fig. 6 shows an addressed location 200 among the embodiment, and addressed location 200 comprises parsing module 220 and data read module 240, and wherein: parsing module 220 is used for the header structure of resolving resource packaging file; Data read module 240 is used for reading the resource file data of resource packaging file.
In one embodiment, parsing module 220 is at first opened the resource packaging file, and the header structure of resolving resource packaging file is then according to the index area of header structure resolving resource packaging file.Owing to write down the index area side-play amount in the header structure, can can obtain content in the index area according to header structure, content in the index area comprises the side-play amount of resource file data, and this side-play amount has promptly shown the memory location of resource file data in the data field, packing back.
In one embodiment, data read module 240 reads the resource file data in the resource packaging file according to the content in the index area.
The memory access device of resource file is stored in the resource file data packing in the data field of resource packaging file, do not need to make any change, only need the resolution file bag to can read resource file data during visit, thereby promoted the storage and the access speed of resource file.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the memory access method of a resource file, described storage means comprises:
Obtain the resource file catalogue, generate the resource file mapping table according to described resource file catalogue;
According to described resource file mapping table, set up the header structure and the index area of resource packaging file;
According to described resource file mapping table traversal resource file, resource file data is packed in the described resource packaging file.
2. the memory access method of resource file according to claim 1 is characterized in that, has write down resource file catalogue, the resource file data side-play amount in packaging file and the size of resource file data in the described resource file mapping table.
3. the memory access method of resource file according to claim 1 is characterized in that, described storage means also comprises: according to the side-play amount of resource file data in packaging file of packing, upgrade the content in the index area.
4. the memory access method of resource file according to claim 1 is characterized in that, described header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file; Described index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
5. the memory access method of resource file according to claim 1 is characterized in that, described access method may further comprise the steps:
Open the resource packaging file, resolve the header structure of described resource packaging file;
According to described header structure, resolve the index area of described resource packaging file;
According to the content in the described index area, read the resource file data in the described resource packaging file.
6. the memory access device of a resource file is characterized in that, described device comprises storer, and described storer comprises:
Mapping block is used to obtain the resource file catalogue, generates the resource file mapping table according to described resource file catalogue;
The data configuration module is used for setting up resource packaging file header structure and index area according to described resource file mapping table;
The packing data module is used for according to described resource file mapping table traversal resource file resource file data being packed in the described resource packaging file.
7. the memory access device of resource file according to claim 6, it is characterized in that the resource file mapping table that described mapping block generates has write down resource file catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
8. the memory access device of resource file according to claim 6 is characterized in that, described header structure has write down quantity, the side-play amount of index area and the size of index area that flows in the realization sign, resource file of resource packaging file; Described index area has write down resource file data catalogue, the side-play amount of resource file data in the resource packaging file and the size of resource file data.
9. the memory access device of resource file according to claim 6 is characterized in that, described storer also comprises:
Data update module is used for upgrading the index area content according to the side-play amount of the resource file data of packing at the resource packaging file.
10. the memory access device of resource file according to claim 6 is characterized in that, described device also comprises the addressed location of visiting described resource packaging file, and described addressed location comprises:
Parsing module is used to open the resource packaging file, resolves the header structure of described resource packaging file, and according to described header structure, resolves the index area of described resource packaging file;
Data read module is used for the content according to described index area, reads the resource file data in the described resource packaging file.
CN2009101940901A 2009-11-23 2009-11-23 Method and device for storing and accessing resource file Pending CN102073633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101940901A CN102073633A (en) 2009-11-23 2009-11-23 Method and device for storing and accessing resource file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101940901A CN102073633A (en) 2009-11-23 2009-11-23 Method and device for storing and accessing resource file

Publications (1)

Publication Number Publication Date
CN102073633A true CN102073633A (en) 2011-05-25

Family

ID=44032178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101940901A Pending CN102073633A (en) 2009-11-23 2009-11-23 Method and device for storing and accessing resource file

Country Status (1)

Country Link
CN (1) CN102073633A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508880A (en) * 2011-10-18 2012-06-20 广东威创视讯科技股份有限公司 Method for joining files and method for splitting files
WO2012167742A1 (en) * 2011-07-27 2012-12-13 华为技术有限公司 Method and apparatus for accessing resource files
CN102831204A (en) * 2012-08-09 2012-12-19 珠海金山网络游戏科技有限公司 File packaging format with version control ability
CN103136293A (en) * 2011-12-02 2013-06-05 福建星网视易信息系统有限公司 Form design and read method of picture resource bundles
CN103440338A (en) * 2013-09-06 2013-12-11 珠海金山网络游戏科技有限公司 Method and system for estimating read-write performance of packed files
WO2015196621A1 (en) * 2014-06-23 2015-12-30 广州爱九游信息技术有限公司 File packing method and device
CN103440338B (en) * 2013-09-06 2016-11-30 珠海金山网络游戏科技有限公司 A kind of method and system assessing packaging file readwrite performance
CN107092601A (en) * 2016-02-17 2017-08-25 阿里巴巴集团控股有限公司 Resource file construction method, resource file application process and device
CN109656614A (en) * 2018-12-24 2019-04-19 中国银行股份有限公司 The processing method of file, apparatus and system
CN110263057A (en) * 2019-06-12 2019-09-20 上海英方软件股份有限公司 A kind of storage/the querying method and device of ROWID mapping table
CN112579530A (en) * 2020-12-14 2021-03-30 莱诺斯科技(北京)股份有限公司 Data resource organization method and device of automatic test system
CN112925559A (en) * 2021-04-09 2021-06-08 网易(杭州)网络有限公司 Resource packaging method, device, medium and electronic equipment
WO2022057663A1 (en) * 2020-09-18 2022-03-24 华为技术有限公司 File generation method and electronic device
CN117707563A (en) * 2023-06-21 2024-03-15 荣耀终端有限公司 Application resource processing method and related equipment

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902687A (en) * 2011-07-27 2013-01-30 华为软件技术有限公司 Accessing method and device of resource file
WO2012167742A1 (en) * 2011-07-27 2012-12-13 华为技术有限公司 Method and apparatus for accessing resource files
CN102902687B (en) * 2011-07-27 2015-09-09 华为软件技术有限公司 The access method of resource file and device
CN102508880B (en) * 2011-10-18 2014-07-02 广东威创视讯科技股份有限公司 Method for joining files and method for splitting files
CN102508880A (en) * 2011-10-18 2012-06-20 广东威创视讯科技股份有限公司 Method for joining files and method for splitting files
CN103136293A (en) * 2011-12-02 2013-06-05 福建星网视易信息系统有限公司 Form design and read method of picture resource bundles
CN103136293B (en) * 2011-12-02 2016-01-13 福建星网视易信息系统有限公司 The format design of picture resource bag and read method
CN102831204A (en) * 2012-08-09 2012-12-19 珠海金山网络游戏科技有限公司 File packaging format with version control ability
CN103440338A (en) * 2013-09-06 2013-12-11 珠海金山网络游戏科技有限公司 Method and system for estimating read-write performance of packed files
CN103440338B (en) * 2013-09-06 2016-11-30 珠海金山网络游戏科技有限公司 A kind of method and system assessing packaging file readwrite performance
CN105446975B (en) * 2014-06-23 2019-03-15 广州爱九游信息技术有限公司 A kind of file packing method and device
WO2015196621A1 (en) * 2014-06-23 2015-12-30 广州爱九游信息技术有限公司 File packing method and device
CN105446975A (en) * 2014-06-23 2016-03-30 广州爱九游信息技术有限公司 File packing method and device
CN107092601A (en) * 2016-02-17 2017-08-25 阿里巴巴集团控股有限公司 Resource file construction method, resource file application process and device
CN107092601B (en) * 2016-02-17 2021-03-23 创新先进技术有限公司 Resource file construction method, resource file application method and device
CN109656614A (en) * 2018-12-24 2019-04-19 中国银行股份有限公司 The processing method of file, apparatus and system
CN110263057A (en) * 2019-06-12 2019-09-20 上海英方软件股份有限公司 A kind of storage/the querying method and device of ROWID mapping table
CN110263057B (en) * 2019-06-12 2020-04-17 上海英方软件股份有限公司 Storage and query method and device for ROWID mapping table
WO2022057663A1 (en) * 2020-09-18 2022-03-24 华为技术有限公司 File generation method and electronic device
CN112579530A (en) * 2020-12-14 2021-03-30 莱诺斯科技(北京)股份有限公司 Data resource organization method and device of automatic test system
CN112579530B (en) * 2020-12-14 2024-05-14 莱诺斯科技(北京)股份有限公司 Data resource organization method and device of automatic test system
CN112925559A (en) * 2021-04-09 2021-06-08 网易(杭州)网络有限公司 Resource packaging method, device, medium and electronic equipment
CN112925559B (en) * 2021-04-09 2023-10-20 网易(杭州)网络有限公司 Resource packaging method, device, medium and electronic equipment
CN117707563A (en) * 2023-06-21 2024-03-15 荣耀终端有限公司 Application resource processing method and related equipment

Similar Documents

Publication Publication Date Title
CN102073633A (en) Method and device for storing and accessing resource file
CN113126990B (en) Page development method, device, equipment and storage medium
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
US20130346851A1 (en) Declarative show and hide animations in html5
JP2005182809A (en) Creating file system within file in storage technology-abstracted manner
CN104462029B (en) The method and system that rich text is shown in a kind of intelligent terminal
CN101840332B (en) Data processing method, device and system of JAVA intelligent card
CN107609302B (en) Method and system for generating product process structure
CN105204823A (en) Method and device for generating application installation package
CN103488732A (en) Generation method and device of static pages
CN110489812A (en) Multilayer level netlist processing method, device, computer equipment and storage medium
CN102193806B (en) Upgrade the method and apparatus of animation
CN113094355A (en) Model instantiation method, device, equipment and medium based on domestic communication protocol
CN104951482A (en) Method and device for operating Sparse-format mirror image document
CN110377371B (en) Style sheet system management method based on Web tag
CN111984892A (en) Page access method, device, equipment and storage medium
CN105447016B (en) A kind of fast search of component and the method for reuse
CN108984622B (en) Storage access method and system for quick access of configuration data by home gateway
CN102945156A (en) Data caching method and device based on Java object
CN116521181B (en) Script data processing method, device, equipment and medium based on game system
CN116436936B (en) Data storage system, method, storage medium and electronic equipment
CN113326288A (en) Data processing method and device and electronic equipment
CN105700825B (en) A kind of thumbnail storage method and apparatus based on android system
CN111104113A (en) Automatic Docker mirror image generation method
CN106775643B (en) Application file packaging system and method with channel data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110525