CN105446975B - A kind of file packing method and device - Google Patents

A kind of file packing method and device Download PDF

Info

Publication number
CN105446975B
CN105446975B CN201410283913.9A CN201410283913A CN105446975B CN 105446975 B CN105446975 B CN 105446975B CN 201410283913 A CN201410283913 A CN 201410283913A CN 105446975 B CN105446975 B CN 105446975B
Authority
CN
China
Prior art keywords
file
target directory
data
subdirectory
under
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
CN201410283913.9A
Other languages
Chinese (zh)
Other versions
CN105446975A (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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou I9Game Information Technology 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 Guangzhou I9Game Information Technology Co Ltd filed Critical Guangzhou I9Game Information Technology Co Ltd
Priority to CN201410283913.9A priority Critical patent/CN105446975B/en
Priority to PCT/CN2014/088278 priority patent/WO2015196621A1/en
Publication of CN105446975A publication Critical patent/CN105446975A/en
Application granted granted Critical
Publication of CN105446975B publication Critical patent/CN105446975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides a kind of file packing method and device.Method therein includes traversing target directory according to compression parameters are packaged;When judging that file under the subdirectory of the file or the target directory under the target directory is ordinary file in ergodic process, the data of the data of the file under the target directory and the file under the subdirectory of the target directory are obtained;The data of file under the target directory that will acquire and the data of the file under the subdirectory of target directory write-in packaging file are simultaneously compressed.Utilize the method for the present invention, inessential file can be given up, packing compression is carried out using ordinary file as necessary file write-in packaging file, to improve the compression ratio of file, packaging file is written in the attribute that necessary file may further be given up again, to further increase the compression ratio of file.

Description

A kind of file packing method and device
Technical field
The present invention relates to mobile internet technical fields, more specifically, are related to a kind of file packing method and device.
Background technique
It is more next for the various installation kits of mobile phone terminal with the fast development of extensive use and its application of mobile phone terminal It is more.Installation kit (Install pack), i.e. software installation packet, are the set that can voluntarily decompress file, including software The All Files of installation.This installation kit (executable file) is run, the All Files of this software can be discharged into mobile phone end On end, the work such as modification registration table, the setting of modification system, creation shortcut are completed.
For the application of mobile phone terminal, the volume of installation kit is smaller, then the effect in channel promotion is better: installation Wrap it is small, user downloading, installation consumption time cost it is small, the error rate being likely to occur in downloading process is small, and natural effect can be more It is good.
It can include a H5 code (html/css/ in installation kit for the application installation package based on Hybrid framework Js file) compressed package, wherein containing using necessary H5 element needed for running, in the industry generally using the packing compression side of zip Formula is handled, processing mode are as follows: compresses one by one to single file, then All Files are packaged.In addition, if wanting to obtain Higher compressing file rate is obtained, also will use tar packing manner in the industry, it is biggish using the generally capacity of such packing manner Game needs because if to use tar (http://www.gnu.org/software/tar/tar.html) packing manner Preset tar is packaged corresponding library in installation kit, this library is also to have certain volume, application lesser for some installation kits, Be packaged compress mode using tar loses more than gain instead.
Therefore, it is necessary to a kind of completely new packaging methods and device that can improve compression ratio.
Summary of the invention
In view of the above problems, the object of the present invention is to provide a kind of file packing method and devices, to solve existing beat The not high problem of packet compress mode compression ratio.
Technical solution provided by the invention is as follows:
The present invention provides a kind of file packing method, comprising: traverses target directory according to compression parameters are packaged;
The file under the subdirectory of the file or the target directory under the target directory is judged in ergodic process When for ordinary file, the number of the data of the file under the target directory and the file under the subdirectory of the target directory is obtained According to;The data of file under the target directory that will acquire and the write-in of the data of the file under the subdirectory of the target directory Packaging file is simultaneously compressed.
Wherein, under the data of file and the subdirectory of the target directory under the target directory that will acquire When packaging file is written in the data of file, give up the attribute information of file.
This method further include: judge to obtain the target when being the subdirectory of the target directory in ergodic process The data of the subdirectory of catalogue, the data write-in packaging file of the subdirectory for the target directory that will acquire simultaneously are compressed; Wherein, the data of the subdirectory include the path content data of the subdirectory and the path length of the subdirectory, do not include son File under catalogue.
Wherein, the data of the file under the target directory include the road of the content of file, the content-length of file, file The path length of diameter content and file;The data of file under the subdirectory include the content of file, file content-length, The path content data of file and the path length of file.
Wherein, it is the attribute of calling system function acquisition file in the ergodic process, the attribute of the file is filled It after data structure, is conformed to a predetermined condition, is judged under the target directory according to the value of the marker of the data structure File under the subdirectory of file or the target directory is ordinary file.
Wherein, it is the attribute of calling system function acquisition file in the ergodic process, goes out to traverse according to determined property and read The content taken is the subdirectory of the file or the target directory under the target directory.
The present invention also provides a kind of file packing apparatus, comprising: target directory Traversal Unit, for according to packing compression ginseng Target directory is gone through several times;File type judging unit, for judging file or institute under the target directory in ergodic process State whether the file under the subdirectory of target directory is ordinary file;File data acquiring unit, in the file type When unit judges are out ordinary files, obtain under the data of the file under the target directory and the subdirectory of the target directory File data;Be packaged compression unit, for by the data of the file under the target directory and with the target directory The data write-in packaging file of file under subdirectory is simultaneously compressed.
Wherein, the data of the file being packaged under the target directory that compression unit will acquire and the target directory Subdirectory under file data be written packaging file when, give up the attribute information of file.
The device further include: subdirectory data capture unit, in the target directory Traversal Unit ergodic process Judge to obtain the data of the subdirectory of the target directory, wherein the subdirectory when being the subdirectory of the target directory Data include the path content data of the subdirectory and the path length of the subdirectory, do not include the file under subdirectory;Institute Packing compression unit is stated, the data write-in packaging file of the subdirectory for the target directory that will acquire simultaneously is compressed.
Wherein, the file type judging unit is the category that calling system function obtains file in the ergodic process Property, after the attribute of the file is filled data structure, conformed to a predetermined condition according to the value of the marker of the data structure, Judge that the file under the subdirectory of the file or the target directory under the target directory is ordinary file.
It can be found that using the above-mentioned file packing method and device provided according to the present invention, by ergodic process The type for first judging the file under the subdirectory of the file or the target directory under the target directory is judged to be common text Using ordinary file as necessary file after part, non-generic file is then inessential file, gives up inessential file, only by necessary text Part write-in packaging file is packaged and is compressed, and compressing file rate can be improved, solve the problems, such as of the existing technology.
Further, after judging ordinary file as necessary file, the data for giving up the attribute of necessary file are (i.e. non- File content data), i.e., packaging file is not written into these attributes, to further increase compressing file rate.
To the accomplishment of the foregoing and related purposes, one or more aspects of the present invention include be particularly described below and The feature particularly pointed out in claim.Certain illustrative aspects of the invention is described in detail in the following description and the annexed drawings. However, these aspects indicate only usable some of the various ways in the principles of the present invention.In addition, of the invention It is intended to include all such aspects and their equivalent.
Detailed description of the invention
By reference to the following description in conjunction with the accompanying drawings and the contents of the claims, and with to it is of the invention more comprehensively Understand, other objects and results of the present invention will be more clearly understood and understood.In the accompanying drawings:
Fig. 1 is the flow diagram according to the packaging method of the embodiment of the present invention;
Fig. 2 is the detailed process schematic diagram according to the packaging method of the embodiment of the present invention;
Fig. 3 is the logical construction schematic diagram according to the packing apparatus of the embodiment of the present invention;
Fig. 4 is the logical construction schematic diagram according to the packing apparatus of a specific embodiment of the embodiment of the present invention.
Identical label indicates similar or corresponding feature or function in all the appended drawings.
Specific embodiment
In the following description, for purposes of illustration, it in order to provide the comprehensive understanding to one or more embodiments, explains Many details are stated.It may be evident, however, that these embodiments can also be realized without these specific details. In other examples, one or more embodiments for ease of description, well known structure and equipment are shown in block form an.
The present invention provides a kind of packaging method and device, can solve existing packing compress mode compression ratio is not high and ask Topic.
In order to facilitate the present invention is understood, first make explanations to several concepts of the invention:
It is packaged compression parameters: including directory name (being packaged to which catalogue), compression level (0-9, the bigger pressure of number Shrinkage is higher, and in order to improve compression ratio, 9) compression level that the present invention defaults is.
Target directory: the catalogue that carry out being packaged compression selected for user.
Packaging file: the file generated by gzip distributing operation system interface, gzip carry out packaged data It compresses and writes this document.The present invention formulates the format of packaging file, and the compression interface for calling gzip to provide is written toward this document Packaged data.The present invention is to be handled by the way of being packaged compression in traversal file.
Ordinary file: being a kind of file type defined in file system, is exactly most common file, such as text in system File, binary file etc..
Other files: device file, threaded file and FIFO, socket file are primarily referred to as.
Device file: it refers mainly to provide the file of simple interface for peripheral equipment, such as printer interface file or Linux Various files under file system under disk partition, Linux file system/dev catalogue, device file also may have access to some calculating Specific resources in machine system, such as hard disk.
Threaded file: the desktop shortcuts in such as Windows, OS system X.
FIFO, socket file: these files can be used to realize interprocess communication or network communication, but these are literary Part is generally not used for saving content.
The attribute of file: including information such as file access permission, owner information, group information, last modification times.
Hereinafter, specific embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Due to existing packing compression method such as zip, tar, all can by the part except ordinary file and ordinary file its His file of type and the attribute of these files are written packaging file together, and (such as the technology of the present invention under certain usage scenarios Application scenarios described in background), the file of some types and the attribute of file are non-essential.These usual attributes can lead to Cross calling system function lstat acquisition.Packaging method provided in an embodiment of the present invention must by giving up that non-essential file leaves File is wanted, and when carrying out necessary file write-in packaging file to be packaged compression, the attribute write-in of necessary file is not packaged text The compression ratio of file can be improved with this for part, realizes and is preferably packaged effect.
It should be noted that necessary file just refers to above-mentioned ordinary file.
Fig. 1 shows the process of the packaging method according to an embodiment of the present invention that can improve compression ratio.
As shown in Figure 1, it is provided in an embodiment of the present invention improve compression ratio packaging method comprising steps of
S101, target directory is traversed according to packing compression parameters;
S102, judged under the subdirectory of the file or the target directory under the target directory in ergodic process When file is ordinary file, the file under the data of the file under the target directory and the subdirectory of the target directory is obtained Data;
File under S103, the data of file and the subdirectory of the target directory under the target directory that will acquire Data write-in packaging file and compressed.
Wherein, under the data of file and the subdirectory of the target directory under the target directory that will acquire When packaging file is written in the data of file, give up the attribute information of file.
Wherein, it is the attribute of calling system function acquisition file in the ergodic process, the attribute of the file is filled It after data structure, is conformed to a predetermined condition, is judged under the target directory according to the value of the marker of the data structure File under the subdirectory of file or the target directory is ordinary file.
This method further include: judge to obtain the target when being the subdirectory of the target directory in ergodic process The data of the subdirectory of catalogue, the data write-in packaging file of the subdirectory for the target directory that will acquire simultaneously are compressed; Wherein, the data of the subdirectory include the path content data of the subdirectory and the path length of the subdirectory, do not include son File under catalogue.
It can be found that using the above-mentioned file packing method and device provided according to the present invention, by ergodic process The type for first judging the file under the subdirectory of the file or the target directory under the target directory is judged to be common text Using ordinary file as necessary file after part, non-generic file is then inessential file, gives up inessential file, only by necessary text Part write-in packaging file is packaged and is compressed, and compressing file rate can be improved, solve the problems, such as of the existing technology.Further , after judging ordinary file as necessary file, give up the data (i.e. non-file content data) of the attribute of necessary file, Packaging file is not written into these attributes, to further increase compressing file rate.
In order to which the packaging method provided in an embodiment of the present invention for improving compression ratio is described in more detail, Fig. 2 shows bases The detailed process of the packaging method of the raising compression ratio of the embodiment of the present invention.
As shown in Fig. 2, the packaging method provided in an embodiment of the present invention for improving compression ratio, comprising the following steps:
Step S201: target directory is traversed according to compression parameters are packaged.
Wherein, compression parameters are set by user, and the purpose for setting compression parameters is that user selectes a catalogue conduct Target directory, and using target directory as the home directory of traversal.
Step S202: traversal target directory.
The embodiment of the present invention traverses target directory using depth-first search mode, and depth-first search mode Recursive algorithm is used, for example, there are two subdirectories of A, C under target directory, the sequence ratio C catalogue of A catalogue is forward, then using deep The traversal order for spending the mode of first search is, after first having traversed the file under A catalogue, then using A catalogue as root, traversal Subdirectory under A catalogue is further continued for the file under subdirectory under depth-first traversal A catalogue, until having traversed institute under A catalogue Then some elements begin stepping through the element under C catalogue, the member under C catalogue is equally traversed by the way of depth-first search Element.
The purpose of traversal target directory is to read the subdirectory and file in target directory, for subsequent packing compression work It prepares.
Step S203: obtaining the attribute of file by calling system function lstat, by determined property traversal reading Hold and enters step S204 if it is subdirectory for subdirectory or file;If it is file, S205 is entered step.
It should be noted that directly may determine that according to the attribute of file is to belong to subdirectory to still fall within file, and file Attribute can be obtained by calling system function, such as calling system function lstat.
It should be noted that content under target directory only there are two types of, one is subdirectory, another kind is under target directory File, and under subdirectory may also include file, so it include file under target directory includes specific item that above-mentioned file is again File under record.
Step S204: reading the path content data of subdirectory, calculates the path length of the subdirectory, by the calculated specific item The path content data write-in packaging file of the path length of record and the subdirectory that reads out, then using the subdirectory as target directory, Circulation step S202- step S203.
Since 15 bit maximums can indicate that integer 32768, that is, maximum can save integer 32768, and Linux is grasped Making maximum path length under system is 4096 bytes, is equivalent to integer 4096, therefore, the path length of the embodiment of the present invention 15 bit are occupied, guarantee the path length under (SuSE) Linux OS enough.
In order to correspond catalogue and file in decompression, need to mark catalogue and file when being packaged compression Note indicates that path is that bit is set to if path is subdirectory by subdirectory or file with a bit to the embodiment of the present invention 1, if path is file, bit is set to 0.
Therefore, path length of the embodiment of the present invention occupies two bytes of disk space, and totally 16 bit, first bit are used to Path label is subdirectory or file, and subsequent 15 bit are used for store path length.
The path content data of to acquisite approachs will obtain path length, such as: the path content data of acquisition is abcd, this path It is made of, i.e., is made of 4 bytes " a, b, c, d " 4 ascii characters, then the path length in this path is 4, i.e. " path It is integer " 4 " that length, which accounts for the content saved in 15 spaces bit, if this path is a catalogue, so the 1st bit It is set to 1;If this path is a file, first bit is set to 0.
Space shared by path content data is variation, and the length that specifically changes is occupied the path length of 15bit by front Value determines such as: a path is made of 100 characters, then this path will occupy 100 bytes, path length is accounted for The content saved in 15 spaces bit is integer " 100 ", another path is made of 20 characters, then this path will account for According to 20 bytes, it is integer " 20 " that path length, which accounts for the content saved in 15 spaces bit,.
Path length followed by be path content data length, path content data length is the length of the content under path, also It is the practical length for occupying disk space of content under path.
Step S205: judge whether file is ordinary file, if it is ordinary file, enters step S206;If no For ordinary file, then give up this document.
The deterministic process of the step: calling system function obtains the attribute of file, and the attribute of the file is filled data It after structure, is conformed to a predetermined condition according to the value of the marker of the data structure, judges the file under the target directory Or the file under the subdirectory of the target directory is ordinary file.It is specific:
Calling system function lstat is passed to current file path, and the attribute information of return is inserted stat structure by function, The present invention is by judging whether the position of S_IFREG in stat.st_mode is 1 (i.e. (stat.st_mode&S_IFREG) > 0), such as Fruit is, then it represents that current file is ordinary file.It should be noted that being for 1 here with value for example, being also possible to set Other values correspondence judges it is ordinary file.
The step is ordinary file according to the file that the determined property of file traverses, if the text that traversal obtains Part is not ordinary file, is classified as other files, in order to improve compression ratio under Hybrid framework usage scenario, the present invention Embodiment gives up non-essential file, that is, other files, and giving up other files means at not for other files Reason only retains ordinary file and is compressed, reaches more ultimate attainment compression ratio with this.
Step S206: after interpretation is out ordinary file, the path content data of file and the content of file, calculation document are read Path length and file content-length, by the path length of calculated file, the content-length of file, reading file Path content data, file content packaging file is written, and for the attribute information of file, such as file access permission, the owner The information such as information, group information, last modification time are then not written into packaging file, can reduce the content that need to be compressed in this way, into one Step improves compression ratio.
Wherein, the path length calculation method of file and the path length calculating of above-mentioned subdirectory are identical, therefore are not repeated.
And 4 byte representations of the content-length of file, i.e. occupancy 4 bytes of disk, maximum can indicate integer 4294967295, i.e. it is integer " 4294967295 ", meaning that the content-length of file, which accounts for the content deposited in the spaces of 4 bytes, Single file content maximum can support 4G.
For example, encountering a file content length in ergodic process is 100 bytes, then this 4 byte storages is interior Appearance is exactly integer " 100 ", and integer " 100 " is actually just stored with 1 byte enough, but agreement must assure that front and back one here It causes, so this length still is saved using 4 bytes, if a file content just has 4G size, this 4 bytes Also 4G, i.e. " 4294967295 " this integer are stored enough.
The content-length of file is variation, and the length specifically changed is taken by the file content length of front 4 byte Value determined, such as:
If a/b/test.txt file contains only " XYZ " 3 characters, the content-length of this file is 3, then It is integer " 3 " that the content-length of file, which accounts for the content deposited in the spaces of 4 bytes,;Subsequent 3 immediately following file content length The content of byte is " XYZ ", i.e. the content of this file occupies 3 bytes.
If containing only " ABCDEFG " 7 characters in a/b/test.txt file, the content-length of this file is 7, then it is integer " 7 " that the content-length of file, which accounts for the content deposited in the spaces of 4 bytes,;Behind file content length The contents of 7 bytes be " ABCDEFG ", i.e. the content of this file occupies 7 bytes.
It can be seen from above content in above-mentioned steps S204 and step S206, there is no the attributes for obtaining file, do not have Have and packaging file is written into the attribute of file, in certain usage scenarios, under Hybrid framework, installation kit does not need these The attribute of file, the attribute by giving up file can reach more ultimate attainment compression ratio.
Step S207: when having traversed all catalogue and file, being packaged compression process terminates, and obtains compressed file.
Due to compressing the mode carried out simultaneously using traversal and packing, after traversal, it is packaged compression stream Journey can also terminate, and obtain the file compressed.
The packaging method provided in an embodiment of the present invention for improving compression ratio is described in detail in above-mentioned process, non-by giving up Ordinary file write-in packaging file is packaged and is compressed, to improve compressing file rate, further, beaten by necessary file Also give up the attribute of ordinary file when packet, attribute is not written into packaging file and is packaged and is compressed, and can be further improved file Compression ratio.
Corresponding with above system, the present invention also provides a kind of packing apparatus for improving compression ratio.Fig. 3 is shown according to this The logical construction of the packing apparatus of the raising compression ratio of inventive embodiments.
As shown in figure 3, the packing apparatus provided in an embodiment of the present invention for improving compression ratio, including target directory Traversal Unit 310, file type judging unit 320, file data acquiring unit 330, packing compression unit 340, subdirectory data acquisition list Member 350.
Target directory Traversal Unit 310, for traversing target directory according to packing compression parameters;
File type judging unit 320, for judging file or the mesh under the target directory in ergodic process Whether the file under the subdirectory of heading record is ordinary file;
File data acquiring unit 330, for obtaining when the file type unit 320 is judged to be ordinary file The data of file under the subdirectory of the data of file under the target directory and the target directory;
It is packaged compression unit 340, for by the specific item of the data of the file under the target directory and the target directory The data write-in packaging file of file under record is simultaneously compressed.
Wherein, the data of the file under the target directory include the road of the content of file, the content-length of file, file The path length of diameter content and file;The data of file under the subdirectory include the content of file, file content-length, The path content data of file and the path length of file.
Wherein, the data and the target of the file being packaged under the target directory that compression unit 340 will acquire When packaging file is written in the data of file under the subdirectory of catalogue, give up the attribute information of file.
Subdirectory data capture unit 350 is for judging in 310 ergodic process of target directory Traversal Unit When the subdirectory of the target directory, the data of the subdirectory of the target directory are obtained, wherein the data packet of the subdirectory The path content data of the subdirectory and the path length of the subdirectory are included, does not include the file under subdirectory;
The packing compression unit 340, the data write-in packaging file of the subdirectory for the target directory that will acquire is simultaneously It is compressed.
The file type judging unit 320 is the attribute that calling system function obtains file in the ergodic process, After the attribute of the file is filled data structure, is conformed to a predetermined condition, sentenced according to the value of the marker of the data structure File under the disconnected target directory out or the file under the subdirectory of the target directory are ordinary file.
Fig. 4 shows patrolling for the packing apparatus of the raising compression ratio of a specific embodiment according to an embodiment of the present invention Collect structure.
As shown in figure 4, subdirectory data capture unit 350 wraps in a specific embodiment of the embodiment of the present invention Include: subdirectory path obtains module 351, for obtaining the path of subdirectory;Subdirectory path length obtains module 352, is used for Obtain the path length of subdirectory;And
File data acquiring unit 330 includes: that file content obtains module 331, for obtaining the file under target directory Content and the file under subdirectory content;File path content obtains module 332, for obtaining the file under target directory Path content data and subdirectory under file path content data;File path length obtains module 333, for obtaining target directory Under file path length and the file under subdirectory path length;File content length obtains module 334, for obtaining The content-length of file under target directory and the content-length of the file under subdirectory.
It is the attribute that calling system function obtains file in 310 ergodic process of target directory Traversal Unit, according to category Property judge traversal read content be the target directory under file or the target directory subdirectory.
The interactive relation of above-mentioned each unit module specifically may refer to the description of previous methods, and details are not described herein again.
Described in an illustrative manner above with reference to attached drawing the raising compression ratio proposed according to the present invention packaging method and Device.It will be understood by those skilled in the art, however, that the system for prompting of the terminal device position proposed for aforementioned present invention And method, various improvement can also be made to realization details therein on the basis of not departing from the content of present invention.Therefore, this hair Bright protection scope should be determined by the content of appended claims.

Claims (8)

1. a kind of file packing method, comprising:
Target directory is traversed according to compression parameters are packaged;
Determined property in ergodic process according to file goes out the specific item of file or the target directory under the target directory When file under record is ordinary file, obtain under the data of the file under the target directory and the subdirectory of the target directory File data;
The data of file under the target directory that will acquire and the data of the file under the subdirectory of the target directory are write Enter packaging file and is compressed;Wherein, the data of the file under the target directory that will acquire and the target mesh When packaging file is written in the data of file under the subdirectory of record, give up the attribute information of file.
2. file packing method as described in claim 1, further includes: judge to be the target directory in ergodic process When subdirectory, the data of the subdirectory of the target directory are obtained, the data of the subdirectory for the target directory that will acquire are write Enter packaging file and is compressed;Wherein, the data of the subdirectory include the subdirectory path content data and the specific item The path length of record does not include the file under subdirectory.
3. file packing method as described in claim 1, wherein
The data of file under the target directory include the content of file, the content-length of file, file path content data with The path length of file;
The data of file under the subdirectory include the content of file, the content-length of file, file path content data and text The path length of part.
4. file packing method as described in claim 1, wherein
It is the attribute that calling system function obtains file in the ergodic process, the attribute of the file is filled into data structure Afterwards, it is conformed to a predetermined condition according to the value of the marker of the data structure, judges the file or institute under the target directory Stating the file under the subdirectory of target directory is ordinary file.
5. file packing method as claimed in claim 1 or 2, wherein
It is the attribute that calling system function obtains file in the ergodic process, is according to the content that determined property goes out to traverse reading The subdirectory of file or the target directory under the target directory.
6. a kind of file packing apparatus, comprising:
Target directory Traversal Unit, for traversing target directory according to packing compression parameters;
File type judging unit, under the target directory according to the determined property of file in ergodic process file or Whether the file under the subdirectory of the target directory is ordinary file;
File data acquiring unit, for obtaining the target mesh when it is ordinary file that the file type unit judges, which go out, The data of the data of file under record and the file under the subdirectory of the target directory;
Be packaged compression unit, for by the data of the file under the target directory and under the subdirectory of the target directory The data write-in packaging file of file is simultaneously compressed;
Wherein, the son of the data of the file being packaged under the target directory that compression unit will acquire and the target directory When packaging file is written in the data of file under catalogue, give up the attribute information of file.
7. file packing apparatus as claimed in claim 6, further includes:
Subdirectory data capture unit, for judging it is the target mesh in the target directory Traversal Unit ergodic process When the subdirectory of record, the data of the subdirectory of the target directory are obtained, wherein the data of the subdirectory include the specific item The path length of the path content data of record and the subdirectory does not include the file under subdirectory;
The packing compression unit, the data write-in packaging file of the subdirectory for the target directory that will acquire simultaneously are pressed Contracting.
8. file packing apparatus as described in claim 6, wherein
The file type judging unit is the attribute that calling system function obtains file in the ergodic process, by the text After the attribute filling data structure of part, is conformed to a predetermined condition, judged described according to the value of the marker of the data structure File under target directory or the file under the subdirectory of the target directory are ordinary file.
CN201410283913.9A 2014-06-23 2014-06-23 A kind of file packing method and device Active CN105446975B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410283913.9A CN105446975B (en) 2014-06-23 2014-06-23 A kind of file packing method and device
PCT/CN2014/088278 WO2015196621A1 (en) 2014-06-23 2014-10-10 File packing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410283913.9A CN105446975B (en) 2014-06-23 2014-06-23 A kind of file packing method and device

Publications (2)

Publication Number Publication Date
CN105446975A CN105446975A (en) 2016-03-30
CN105446975B true CN105446975B (en) 2019-03-15

Family

ID=54936586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410283913.9A Active CN105446975B (en) 2014-06-23 2014-06-23 A kind of file packing method and device

Country Status (2)

Country Link
CN (1) CN105446975B (en)
WO (1) WO2015196621A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161633B (en) * 2016-07-20 2020-05-05 柏科数据技术(深圳)股份有限公司 Transmission method and system for packed files based on cloud computing environment
CN107402788B (en) * 2017-07-25 2020-09-25 网易(杭州)网络有限公司 Resource packaging management method and device
CN107609072B (en) * 2017-09-01 2020-11-20 联想(北京)有限公司 Data processing method and device
CN107734022B (en) * 2017-09-30 2021-08-10 努比亚技术有限公司 Static resource file downloading method, mobile terminal and computer readable storage medium
CN109828955A (en) * 2019-01-10 2019-05-31 浙江数链科技有限公司 Document processing method, device, computer equipment and storage medium
CN110989978A (en) * 2019-11-06 2020-04-10 北京达佳互联信息技术有限公司 Page packaging method and device, electronic equipment and storage medium
CN111538706B (en) * 2020-04-21 2023-11-14 惠州Tcl移动通信有限公司 Data compression method, device, storage medium and mobile terminal
CN116069729B (en) * 2023-04-06 2023-06-27 深圳市微克科技有限公司 Intelligent document packaging method, system and medium
CN118378277A (en) * 2024-04-25 2024-07-23 佛山众陶联供应链服务有限公司 File read-write permission modification method and system based on NFS

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file
CN102761540A (en) * 2012-05-30 2012-10-31 北京奇虎科技有限公司 Data compression method, device and system and server
CN102881036A (en) * 2012-07-30 2013-01-16 北京中科盘古科技发展有限公司 Method for compressing animation scene files

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1151436C (en) * 2000-07-31 2004-05-26 岱升科技股份有限公司 Method of loading operation system and application program into memory
CN1169118C (en) * 2001-07-04 2004-09-29 英业达集团(南京)电子技术有限公司 Speech playing method for electronic device
KR100613076B1 (en) * 2004-12-14 2006-08-16 주식회사 팬택앤큐리텔 Method For Image File Management In The Mobile Communication Terminal
US20120158677A1 (en) * 2010-12-20 2012-06-21 Apple Inc. Systems and methods for streaming compressed files via a non-volatile memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073633A (en) * 2009-11-23 2011-05-25 腾讯科技(深圳)有限公司 Method and device for storing and accessing resource file
CN102761540A (en) * 2012-05-30 2012-10-31 北京奇虎科技有限公司 Data compression method, device and system and server
CN102881036A (en) * 2012-07-30 2013-01-16 北京中科盘古科技发展有限公司 Method for compressing animation scene files

Also Published As

Publication number Publication date
WO2015196621A1 (en) 2015-12-30
CN105446975A (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN105446975B (en) A kind of file packing method and device
CN104461504B (en) A kind of management method of end application
CN105339924B (en) The system and method for realizing compression service
CN111176976A (en) Test data generation method and device, storage medium and electronic device
CN110941424B (en) Compiling parameter optimization method and device and electronic equipment
CN103259936B (en) Operating system upgrade method for mobile terminal and operating system upgrade device of operating system upgrade method
CN104199951B (en) Web page processing method and device
CN111095421B (en) Context-aware delta algorithm for gene files
CN104461505B (en) A kind of terminal
CN106970816B (en) Software upgrading processing method and device and audio playing equipment
CN112114849B (en) Resource updating method and device
CN104427341B (en) A kind of image processing method, device and terminal
CN105975311A (en) Application startup method and device
CN107797823A (en) Business Rule Management method, apparatus, storage medium and computer equipment
CN109947450A (en) System file upgrade method, device, mobile terminal and readable storage medium storing program for executing
CN105760183A (en) File processing method, device, and communication system
CN106886568A (en) One kind point table method, device and electronic equipment
CN106406923B (en) Method and device for processing dynamic library file
CN110413711A (en) A kind of variance data acquisition methods and its storage medium
KR102141749B1 (en) APP program execution method and device
CN103812946B (en) Method and system for online cloud updating of AR application program
CN109656614A (en) The processing method of file, apparatus and system
CN105872731A (en) Data processing method and device
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
CN108958755A (en) A kind of generation method, device and the electronic equipment of application program installation kit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200526

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: Two, room 902, West 64, 66 Middle Road, Tianhe District, Guangdong, Guangzhou, China 510665

Patentee before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.