CN109408471A - A kind of compressed package decompressing method, device and storage medium based on matching tree - Google Patents

A kind of compressed package decompressing method, device and storage medium based on matching tree Download PDF

Info

Publication number
CN109408471A
CN109408471A CN201811186773.8A CN201811186773A CN109408471A CN 109408471 A CN109408471 A CN 109408471A CN 201811186773 A CN201811186773 A CN 201811186773A CN 109408471 A CN109408471 A CN 109408471A
Authority
CN
China
Prior art keywords
file
matching
decompression
filename
tree
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.)
Granted
Application number
CN201811186773.8A
Other languages
Chinese (zh)
Other versions
CN109408471B (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.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information 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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201811186773.8A priority Critical patent/CN109408471B/en
Publication of CN109408471A publication Critical patent/CN109408471A/en
Application granted granted Critical
Publication of CN109408471B publication Critical patent/CN109408471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The present invention provides a kind of compressed package decompressing method, device and storage mediums based on matching tree, this method comprises: matching tree construction step, is based on decompression configuration file building matching tree;Depressurization steps read the filename of the file in compressed package, are set using the matching and are matched with the filename, if successful match, decompressed to the file, if matching is unsuccessful, to the file without decompression.The file of needs is decompressed to realize, should not file without decompression, substantially increase decompression speed, reduce the access times to disk, the IO performance for improving disk, reduces the energy consumption of terminal device, reduces the occupancy to memory space, the speed of service for improving terminal device, improves user experience.

Description

A kind of compressed package decompressing method, device and storage medium based on matching tree
Technical field
The present invention relates to technical field of data processing, especially a kind of compressed package decompressing method based on matching tree, device And storage medium.
Background technique
Mobile interchange epoch, mobile phone have become the most personal and common tool equipment of people, the data carried It is more and more abundant;Wherein, Android phone is affected as occupation rate of market highest and the global year maximum mobile phone of shipment amount The market of entire mobile interchange.As the large area of Android phone uses, safety of the Google company for Android It is made increasingly tighter, security mechanism upgrades year by year, so that the evidence obtaining for Android is also faced with more and more challenges. Starting early in Android 5.0, the difficulty of root mobile phone starts to increase year by year, until newest Android 8.0 at present, safety Mechanism is even more further to be promoted.Domestic cell phone manufacturer is also to rise year by year for the attention degree of mobile phone data security, leads to nothing After method directly carries out root to mobile phone easily, then its data is extracted, and the backup of data must be carried out;Include adb The backup tool that backup backup and each manufacturer provide.
The file backed up is a compressed file, contains the data of all applications, wherein containing largely acquiring Journey without using redundant file, take a substantial amount of time during backup compressed file is decompressed, must also after decompression The file of specific needs must be filtered in a large amount of file, finding out needs file to be used, greatly reduces timeliness Property;The file that solution presses out redundancy also takes up a large amount of memory space;The mobile phone for encountering big data quantity decompresses the pressure of big data quantity Contracting packet, the cruising ability for mobile unit is a greatly test, and not can guarantee the duration of equipment operation, i.e., Energy consumption is higher;For the equipment that all memory capacity are not abundant, there are also the equipment of mobile demand, all there are similar problems, from And the speed of service for resulting in terminal device is slower, affects user experience.Therefore, the mode of traditional backup compressed package decompression Movable data acquisition be can no longer meet for the high requirement of timeliness.
In conclusion drawback of the prior art is that:
1. decompressing all application backup files, includes bulk redundancy file, waste limited memory space.
2. original decompression mechanism decompresses the All Files of entire compressed package, there are decompressions to take a long time, slow-paced to ask Topic.
3. comprising a large amount of files not of uniform size in backup file, decompression procedure frequently carries out write operation to disk, deposits In I/O bottleneck.
4. mobile unit battery loss increases, prolonged to decompress process and write-in file, increase equipment kwh loss, The continuation of the journey for influencing mobile device, reduces the ability of its continuous service.
Summary of the invention
The present invention is directed to above-mentioned defect in the prior art, proposes following technical solution.
A kind of compressed package decompressing method based on matching tree, this method comprises:
Matching tree construction step, based on decompression configuration file building matching tree;
Depressurization steps read the filename of the file in compressed package, use matching tree and filename progress Match, if successful match, the file is decompressed, if matching is unsuccessful, to the file without decompression.
Further, the decompression configuration file includes multiple groupings, and each grouping includes a plurality of matching entry, described Matching entry is used to match the file for needing to decompress.
Further, each matching entry is made of multiple occurrences, uses "/" as segmentation symbol between occurrence, Each occurrence matches a filename or directory name, and multiple occurrences of the matching entry are for continuous coupling file Fullpath, wherein when the filename of file and path determine unique, the filename and path phase of the occurrence and file Together, for variable document name, occurrence is the regular expression " ^ " beginning and be terminated with " $ ".
Further, the operation based on decompression configuration file building matching tree are as follows: decompression configuration file is obtained, with decompression The root node of configuration file is the root of matching tree, is successively read the grouping of decompression configuration file and corresponds to each under grouping With entry, with first class catalogue then in same layer tree node, it is father and son's node that father and son's catalogue is corresponding, constructs matching with this Tree.
Further, obtain decompression configuration file mode be customized decompression configuration file, from be locally stored acquisition It decompresses configuration file or downloads decompression configuration file from cloud server or obtain decompression configuration file from other similar users.
Further, the operation of depressurization steps are as follows: whether judgement has currently read compression inclusion tail, if it is, Decompression procedure is exited, if it is not, then reading the filename of file, and filename is split according to every level-one bibliographic structure, Then with match tree and matched, matching treetop layer correspondence root, the first layer respective file name first order, if the mesh Record matches one of node of current level, then continues the child node for matching corresponding node, be otherwise judged to matching it is unsuccessful, Then matching process terminates, and continues the reading of compressed package, if the matching tree node is ended up with ^ beginning with $, use pattern Matches file/folder, if matching is unsuccessful, matching process terminates, and continues the reading of compressed package, if It is fitted on the last one child node, file/folder is then needed to save, then decompressed current file, or this document is pressed from both sides Under All Files decompressed, and by this document folder under All Files be written in file system, then proceed by pressure The reading of contracting packet.
The invention also provides a kind of compressed package decompression device based on matching tree, which includes:
Matching tree construction unit, for based on decompression configuration file building matching tree;
Decompression units, for reading the filename of the file in compressed package, using the matching tree with the filename into Row matching, if successful match, decompresses the file, if matching is unsuccessful, to the file without solution Pressure.
Further, the decompression configuration file includes multiple groupings, and each grouping includes a plurality of matching entry, described Matching entry is used to match the file for needing to decompress.
Further, each matching entry is made of multiple occurrences, uses "/" as segmentation symbol between occurrence, Each occurrence matches a filename or directory name, and multiple occurrences of the matching entry are for continuous coupling file Fullpath, wherein when the filename of file and path determine unique, the filename and path phase of the occurrence and file Together, for variable document name, occurrence is the regular expression " ^ " beginning and be terminated with " $ ".
Further, the operation based on decompression configuration file building matching tree are as follows: decompression configuration file is obtained, with decompression The root node of configuration file is the root of matching tree, is successively read the grouping of decompression configuration file and corresponds to each under grouping With entry, with first class catalogue then in same layer tree node, it is father and son's node that father and son's catalogue is corresponding, constructs matching with this Tree.
Further, obtain decompression configuration file mode be customized decompression configuration file, from be locally stored acquisition It decompresses configuration file or downloads decompression configuration file from cloud server or obtain decompression configuration file from other similar users.
Further, the operation that decompression units execute are as follows: whether judgement has currently read compression inclusion tail, if It is then to exit decompression procedure, if it is not, then reading the filename of file, and filename is carried out according to every level-one bibliographic structure Segmentation, then with match tree and is matched, the matching treetop layer correspondence root, the first layer respective file name first order, such as One of node of the current level of the fruit directory matches then continues the child node for matching corresponding node, is otherwise judged to matching Unsuccessful, then matching process terminates, and continues the reading of compressed package, if the matching tree node is ended up with ^ beginning with $, Use pattern matches file/folder, if matching is unsuccessful, matching process terminates, and continues the reading of compressed package It takes, if being matched to the last one child node, needs if file/folder to save, then decompress current file, or will The lower All Files of this document folder are decompressed, and the All Files under this document is pressed from both sides are written in file system, then after The continuous reading for carrying out compressed package.
The invention also provides a kind of computer readable storage medium, computer program generation is stored on the storage medium Code, above-mentioned any method is executed when the computer program code is computer-executed.
Technical effect of the invention are as follows: the present invention passes through decompression configuration file building matching tree first, then reads compression The filename of file in packet is set using the matching and is matched with the filename, if successful match, to the text Part is decompressed, if matching is unsuccessful, to the file without decompression.The file of needs is solved to realize Pressure, should not file without decompression, substantially increase decompression speed, reduce the access times to disk, improve disk IO performance, reduce the energy consumption of terminal device, reduce the occupancy to memory space, improve terminal device operation speed Degree, improves user experience.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon.
Fig. 1 is a kind of flow chart of compressed package decompressing method based on matching tree of embodiment according to the present invention.
Fig. 2 is the schematic diagram of the matching tree of embodiment according to the present invention.
Fig. 3 is the structure chart of the general frame of the backup file decompression of the Android phone of embodiment according to the present invention.
Fig. 4 is a kind of structure chart of compressed package decompression device based on matching tree of embodiment according to the present invention.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 shows a kind of compressed package decompressing method based on matching tree of the invention, this method comprises:
Matching tree construction step S101, based on decompression configuration file building matching tree;
Depressurization steps S102, read compressed package in file filename, using the matching tree and the filename into Row matching, if successful match, decompresses the file, if matching is unsuccessful, to the file without solution Pressure.
Method of the invention is particularly suitable in mobile terminal device, the mobile terminal device can be smart phone, Tablet computer, laptop, desktop computer or PDA etc., certain mobile terminal device is also possible to others can be portable Electronic equipment having data processing function.
In one embodiment, the decompression configuration file includes multiple groupings, and each grouping includes a plurality of matching entry, The matching entry is used to match the file for needing to decompress.For example grouping can be QQ, wechat, mail, address list etc.;Match item Mesh is used to match the file for needing to decompress.Organizational form in this way, so that it may only decompress specific file, for example only decompress When the relevant file of QQ, just only need for the relevant file of QQ to be written to file system, and the file of other applications then without It needs to decompress, it is not necessary that file system is written.
In one embodiment, each matching entry is made of multiple occurrences, uses "/" as decollator between occurrence Number, each occurrence matches a filename or directory name, and multiple occurrences of the matching entry are for continuous coupling text The fullpath of part, wherein when the filename of file and path determine unique, the filename and path of the occurrence and file Identical, for variable document name, occurrence is the regular expression " ^ " beginning and be terminated with " $ ".
One specific example are as follows: if necessary to decompression com.tencent.mobileqq/shared_prefs/ This file of mobileQQ.xml, because file path is fixed and filename is unique, at this point, matching entry is just etc. In com.tencent.mobileqq/shared_prefs/mobileQQ.xml;If the file that will be decompressed be similar to/ (wherein 12345678 be QQ to the file of the on-fixed title of com.tencent.mobileqq/databases/12345678.db Number, the part be it is variable, for different mobile phones, the QQ number of different user is different), then variable part can just make It is matched with regular expression " ^ [0-9]+.db $ " implementation pattern, at this point, matching entry is com.tencent.mobileqq/ databases/^[0-9]+.db$。
The building of matching tree is the emphasis in the present invention, this is the committed step for realizing rapid decompression, is to realize the present invention One of important inventive point, the operation based on decompression configuration file building matching tree are as follows: decompression configuration file is obtained, to solve press-fitting The root node for setting file is the root of matching tree, the grouping and each matching under corresponding grouping for being successively read decompression configuration file Entry, with first class catalogue then in same layer tree node, it is father and son's node that father and son's catalogue is corresponding, constructs matching tree with this. Fig. 2 shows a kind of easy matching tree, the association attributes of corresponding node are further comprised in actual match tree, if present node is text Part folder or file, whether present node description is database etc..
In one embodiment, the mode for obtaining decompression configuration file is customized decompression configuration file, from being locally stored It obtains decompression configuration file or downloads decompression configuration file from cloud server or obtain decompression configuration from other similar users File.Wherein, similar users can judge according to the behavior for the terminal that user uses, can be according to the file to compressed package It is analyzed with the similar user of determination.
In one embodiment, the operation of depressurization steps are as follows: whether judgement has currently read compression inclusion tail, if It is then to exit decompression procedure, if it is not, then reading the filename of file, and filename is carried out according to every level-one bibliographic structure Segmentation, then with match tree and is matched, the matching treetop layer correspondence root, the first layer respective file name first order, such as One of node of the current level of the fruit directory matches then continues the child node for matching corresponding node, is otherwise judged to matching Unsuccessful, then matching process terminates, and continues the reading of compressed package, if the matching tree node is ended up with ^ beginning with $, Use pattern matches file/folder, if matching is unsuccessful, matching process terminates, and continues the reading of compressed package It takes, if being matched to the last one child node, needs if file/folder to save, then decompress current file, or will The lower All Files of this document folder are decompressed, and the All Files under this document is pressed from both sides are written in file system, then after The continuous reading for carrying out compressed package.
Method of the invention can be used for carrying out rapid decompression for the backup file backup.tar of Android phone, below To back up file backup.tar as compressed package files, decompression QQ data instance illustrates to filter decompression procedure, backup services component Data backup service is provided for backup file components.Two backup services components belong to the service of Android operation system, packet Backup tool containing adb backup and the customization of each manufacturer, the present invention is not related to the modification to the two components, therefore no longer retouches Concrete function realization is stated, the general frame of the backup file decompression of Android phone is as shown in Figure 3.
Exemplary detailed process is as follows:
1) backup file components are communicated by adb and backup services device assembly, and backup obtains the compressed package of all data backup.tar;
2) it decompresses serviced component (program module that can be constructed in method shown in Fig. 1) and reads decompression configuration file (solution Pressure configuration file is stored in configuration file component), and resolve to matching tree;
3) decompression serviced component reads backup.tar compressed file, reads listed files, obtains a filename, file Path is com.taobao.taobao/databases/data, the entitled com.taobao.taobao of first grade file, is mismatched Com.tencent.mobileqq is not the file of QQ, then without decompression, skips, continue to read next filename;
4) continue to read and obtain filename com.tencent.mobileqq/shared_prefs/mobileQQ.xml, one Grade directory matches com.tencent.mobileqq, second-level directory shared_prefs matching, the matching of three levels of files name MobileQQ.xml, filename matching, then decompress file content, and be written in disk;
5) continue to read and obtain filename com.tencent.mobileqq/app_cache, first class catalogue matching Com.tencent.mobileqq, second-level directory app_cache are mismatched, and are not required to the file saved, are not solved to it Pressure, continues to read next file;
6) file is persistently read until compressed package files list reading finishes, and end decompression process, filtering decompression service is tied Beam.
With further reference to Fig. 4, as the realization to method shown in above-mentioned Fig. 1, this application provides one kind based on matching tree Compressed package decompression device one embodiment, the Installation practice is corresponding with embodiment of the method shown in FIG. 1, the device tool Body may include in various electronic equipments.
Fig. 4 shows a kind of compressed package decompression device based on matching tree of the invention of the invention, which includes:
Matching tree construction unit 401, for based on decompression configuration file building matching tree;
Decompression units 402 use matching tree and the filename for reading the filename of the file in compressed package Matched, if successful match, the file decompressed, if matching is unsuccessful, to the file without Decompression.
Apparatus of the invention particularly useful for being integrated in mobile terminal device, the mobile terminal device can be intelligence Mobile phone, tablet computer, laptop, desktop computer or PDA etc., certain mobile terminal device is also possible to others can be just The electronic equipment having data processing function taken.
In one embodiment, the decompression configuration file includes multiple groupings, and each grouping includes a plurality of matching entry, The matching entry is used to match the file for needing to decompress.For example grouping can be QQ, wechat, mail, address list etc.;Match item Mesh is used to match the file for needing to decompress.Organizational form in this way, so that it may only decompress specific file, for example only decompress When the relevant file of QQ, just only need for the relevant file of QQ to be written to file system, and the file of other applications then without It needs to decompress, it is not necessary that file system is written.
In one embodiment, each matching entry is made of multiple occurrences, uses "/" as decollator between occurrence Number, each occurrence matches a filename or directory name, and multiple occurrences of the matching entry are for continuous coupling text The fullpath of part, wherein when the filename of file and path determine unique, the filename and path of the occurrence and file Identical, for variable document name, occurrence is the regular expression " ^ " beginning and be terminated with " $ ".
One specific example are as follows: if necessary to decompression com.tencent.mobileqq/shared_prefs/ This file of mobileQQ.xml, because file path is fixed and filename is unique, at this point, matching entry is just etc. In com.tencent.mobileqq/shared_prefs/mobileQQ.xml;If the file that will be decompressed be similar to/ (wherein 12345678 be QQ to the file of the on-fixed title of com.tencent.mobileqq/databases/12345678.db Number, the part be it is variable, for different mobile phones, the QQ number of different user is different), then variable part can just make It is matched with regular expression " ^ [0-9]+.db $ " implementation pattern, at this point, matching entry is com.tencent.mobileqq/ databases/^[0-9]+.db$。
The building of matching tree is the emphasis in the present invention, this is the committed step for realizing rapid decompression, is to realize the present invention One of important inventive point, the operation based on decompression configuration file building matching tree are as follows: decompression configuration file is obtained, to solve press-fitting The root node for setting file is the root of matching tree, the grouping and each matching under corresponding grouping for being successively read decompression configuration file Entry, with first class catalogue then in same layer tree node, it is father and son's node that father and son's catalogue is corresponding, constructs matching tree with this. Fig. 2 shows a kind of easy matching tree, the association attributes of corresponding node are further comprised in actual match tree, if present node is text Part folder or file, whether present node description is database etc..
In one embodiment, the mode for obtaining decompression configuration file is customized decompression configuration file, from being locally stored It obtains decompression configuration file or downloads decompression configuration file from cloud server or obtain decompression configuration from other similar users File.Wherein, similar users can judge according to the behavior for the terminal that user uses, can be according to the file to compressed package It is analyzed with the similar user of determination.
In one embodiment, the operation that decompression units execute are as follows: whether judgement has currently read compression inclusion tail, such as Fruit be then exit decompression procedure, if it is not, then read file filename, and by filename according to every level-one bibliographic structure into Row segmentation, then with match tree and is matched, the matching treetop layer corresponds to root, the first layer respective file name first order, If one of node of the current level of the directory matches, continues the child node for matching corresponding node, be otherwise determined as With unsuccessful, then matching process terminates, and continues the reading of compressed package, if the matching tree node is tied with ^ beginning with $ Tail, use pattern matches file/folder, if matching is unsuccessful, matching process terminates, and continues compressed package It reads, if being matched to the last one child node, needs if file/folder to save, then decompress current file, or All Files under this document folder are decompressed, and the All Files under this document folder are written in file system, then Continue the reading of compressed package.
The device of the invention can integrate in the electronic device for for Android phone backup file backup.tar into Row rapid decompression, below to back up file backup.tar as compressed package files, decompression QQ data instance illustrates that filtering solution presses through Journey, backup services component provide data backup service for backup file components.Two backup services components belong to Android behaviour The service for making system, the backup tool comprising adb backup and the customization of each manufacturer, the present invention are not related to the two components Modification, therefore concrete function realization is no longer described, the general frame of the backup file decompression of Android phone is as shown in Figure 3.
Exemplary detailed process is as follows:
1) backup file components are communicated by adb and backup services device assembly, and backup obtains the compressed package of all data backup.tar;
2) decompression serviced component (can be decompression device shown in Fig. 4) reads decompression configuration file (decompression configuration file It is stored in configuration file component), and resolve to matching tree;
3) decompression serviced component reads backup.tar compressed file, reads listed files, obtains a filename, file Path is com.taobao.taobao/databases/data, the entitled com.taobao.taobao of first grade file, is mismatched Com.tencent.mobileqq is not the file of QQ, then without decompression, skips, continue to read next filename;
4) continue to read and obtain filename com.tencent.mobileqq/shared_prefs/mobileQQ.xml, one Grade directory matches com.tencent.mobileqq, second-level directory shared_prefs matching, the matching of three levels of files name MobileQQ.xml, filename matching, then decompress file content, and be written in disk;
5) continue to read and obtain filename com.tencent.mobileqq/app_cache, first class catalogue matching Com.tencent.mobileqq, second-level directory app_cache are mismatched, and are not required to the file saved, are not solved to it Pressure, continues to read next file;
6) file is persistently read until compressed package files list reading finishes, and end decompression process, filtering decompression service is tied Beam.
Technical effect of the invention are as follows: the present invention passes through decompression configuration file building matching tree first, then reads compression The filename of file in packet is set using the matching and is matched with the filename, if successful match, to the text Part is decompressed, if matching is unsuccessful, to the file without decompression.The file of needs is solved to realize Pressure, should not file without decompression, substantially increase decompression speed, reduce the access times to disk, improve disk IO performance, reduce the energy consumption of terminal device, reduce the occupancy to memory space, improve terminal device operation speed Degree, improves user experience.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this The function of each unit can be realized in the same or multiple software and or hardware when application.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can It realizes by means of software and necessary general hardware platform.Based on this understanding, the technical solution essence of the application On in other words the part that contributes to existing technology can be embodied in the form of software products, the computer software product It can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that a computer equipment (can be personal computer, server or the network equipment etc.) executes the certain of each embodiment of the application or embodiment Method described in part.
It should be noted last that: above embodiments only illustrate and not to limitation technical solution of the present invention, although reference Above-described embodiment describes the invention in detail, those skilled in the art should understand that: it still can be to this hair It is bright to be modified or replaced equivalently, it without departing from the spirit or scope of the invention, or any substitutions, should all It is included within the scope of the claims of the present invention.

Claims (13)

1. a kind of compressed package decompressing method based on matching tree, which is characterized in that this method comprises:
Matching tree construction step, based on decompression configuration file building matching tree;
Depressurization steps read the filename of the file in compressed package, are set using the matching and are matched with the filename, such as Fruit successful match then decompresses the file, if matching is unsuccessful, to the file without decompression.
2. the method according to claim 1, wherein the decompression configuration file includes multiple groupings, Mei Gefen Group includes a plurality of matching entry, and the matching entry is used to match the file for needing to decompress.
3. according to the method described in claim 2, it is characterized by: each matching entry is made of multiple occurrences, occurrence Between use "/" as segmentation symbol, each occurrence matches a filename or directory name, multiple of the matching entry With item be used for continuous coupling file fullpath, wherein when the filename of file and path determine unique, the occurrence with The filename of file and path are identical, and for variable document name, occurrence is the regular expressions " ^ " beginning and be terminated with " $ " Formula.
4. according to the method described in claim 3, it is characterized in that, the operation based on decompression configuration file building matching tree are as follows: Decompression configuration file is obtained, to decompress the root that the root node of configuration file is matching tree, is successively read point of decompression configuration file Each matching entry under group and corresponding grouping, with first class catalogue then in same layer tree node, father and son's catalogue is corresponding then It is father and son's node, matching tree is constructed with this.
5. according to the method described in claim 4, it is characterized in that, obtaining the mode of decompression configuration file as the press-fitting of customized solution Set file, from be locally stored obtain decompression configuration file or from cloud server download decompression configuration file or from other it is similar User obtains decompression configuration file.
6. according to the method described in claim 5, it is characterized in that, the operation of depressurization steps are as follows: whether judgement has currently read To compression inclusion tail, if it is, decompression procedure is exited, if it is not, then reading the filename of file, and by filename according to every First class catalogue structure is split, then with match tree and matched, the corresponding root of matching treetop layer, first layer correspondence The filename first order continues the child node for matching corresponding node if one of node of the current level of the directory matches, Otherwise be judged to matching unsuccessful, then matching process terminates, continue the reading of compressed package, if the matching tree node with ^ beginning is ended up with $, use pattern matches file/folder, if matching is unsuccessful, matching process terminates, continue into The reading of row compressed package needs if file/folder to save if being matched to the last one child node, then ought be above Part decompression, or the All Files under this document folder are decompressed, and the All Files under this document folder are written to file In system, the reading of compressed package is then proceeded by.
7. a kind of compressed package decompression device based on matching tree, which is characterized in that the device includes:
Matching tree construction unit, for based on decompression configuration file building matching tree;
Decompression units use matching tree and filename progress for reading the filename of the file in compressed package Match, if successful match, the file is decompressed, if matching is unsuccessful, to the file without decompression.
8. device according to claim 7, which is characterized in that the decompression configuration file includes multiple groupings, Mei Gefen Group includes a plurality of matching entry, and the matching entry is used to match the file for needing to decompress.
9. device according to claim 8, it is characterised in that: each matching entry is made of multiple occurrences, occurrence Between use "/" as segmentation symbol, each occurrence matches a filename or directory name, multiple of the matching entry With item be used for continuous coupling file fullpath, wherein when the filename of file and path determine unique, the occurrence with The filename of file and path are identical, and for variable document name, occurrence is the regular expressions " ^ " beginning and be terminated with " $ " Formula.
10. device according to claim 9, which is characterized in that the operation based on decompression configuration file building matching tree are as follows: Decompression configuration file is obtained, to decompress the root that the root node of configuration file is matching tree, is successively read point of decompression configuration file Each matching entry under group and corresponding grouping, with first class catalogue then in same layer tree node, father and son's catalogue is corresponding then It is father and son's node, matching tree is constructed with this.
11. device according to claim 10, which is characterized in that the mode for obtaining decompression configuration file is customized decompression Configuration file obtains decompression configuration file or downloads decompression configuration file from cloud server or from other phases from being locally stored Decompression configuration file is obtained like user.
12. device according to claim 11, which is characterized in that the operation that decompression units execute are as follows: judgement it is current whether Compression inclusion tail is read, if it is, exit decompression procedure, if it is not, then read the filename of file, and by filename Be split according to every level-one bibliographic structure, then with match tree and matched, matching treetop layer correspondence root, first The layer respective file name first order continues to match corresponding node if one of node of the current level of the directory matches Child node, is otherwise judged to matching unsuccessful, then matching process terminates, and continues the reading of compressed package, if the matching Tree node is ended up with ^ beginning with $, use pattern matches file/folder, if matching is unsuccessful, matching process knot Beam, continues the reading of compressed package, if being matched to the last one child node, needs if file/folder to save, then Current file is decompressed, or the All Files under this document folder are decompressed, and the All Files under this document folder are write Enter into file system, then proceeds by the reading of compressed package.
13. a kind of computer readable storage medium, which is characterized in that it is stored with computer program code on the storage medium, When the computer program code is computer-executed, perform claim requires any method of 1-6.
CN201811186773.8A 2018-10-12 2018-10-12 Compressed packet decompression method and device based on matching tree and storage medium Active CN109408471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811186773.8A CN109408471B (en) 2018-10-12 2018-10-12 Compressed packet decompression method and device based on matching tree and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811186773.8A CN109408471B (en) 2018-10-12 2018-10-12 Compressed packet decompression method and device based on matching tree and storage medium

Publications (2)

Publication Number Publication Date
CN109408471A true CN109408471A (en) 2019-03-01
CN109408471B CN109408471B (en) 2021-05-04

Family

ID=65467051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811186773.8A Active CN109408471B (en) 2018-10-12 2018-10-12 Compressed packet decompression method and device based on matching tree and storage medium

Country Status (1)

Country Link
CN (1) CN109408471B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559463A (en) * 2020-12-18 2021-03-26 杭州数梦工场科技有限公司 Method and device for processing compressed file
CN113377711A (en) * 2021-06-29 2021-09-10 平安普惠企业管理有限公司 Data processing method, device, equipment and computer readable storage medium
CN113419998A (en) * 2021-08-25 2021-09-21 成都统信软件技术有限公司 Folder processing method, computing device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080141373A1 (en) * 2006-12-12 2008-06-12 Fortinet, Inc. Detection of undesired computer files in archives
CN104572966A (en) * 2014-12-30 2015-04-29 北京奇虎科技有限公司 Zip file unzipping method and device
CN106775802A (en) * 2016-11-14 2017-05-31 福建天泉教育科技有限公司 Method and its system that mass small documents quickly update

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080141373A1 (en) * 2006-12-12 2008-06-12 Fortinet, Inc. Detection of undesired computer files in archives
CN104572966A (en) * 2014-12-30 2015-04-29 北京奇虎科技有限公司 Zip file unzipping method and device
CN106775802A (en) * 2016-11-14 2017-05-31 福建天泉教育科技有限公司 Method and its system that mass small documents quickly update

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李晓 等: "基于.NET平台实现ZIP文件操作", 《电脑知识与技术》 *
谭浩强: "《微机系统与应用基础》", 31 August 1993 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559463A (en) * 2020-12-18 2021-03-26 杭州数梦工场科技有限公司 Method and device for processing compressed file
CN112559463B (en) * 2020-12-18 2023-08-25 杭州数梦工场科技有限公司 Compressed file processing method and device
CN113377711A (en) * 2021-06-29 2021-09-10 平安普惠企业管理有限公司 Data processing method, device, equipment and computer readable storage medium
CN113377711B (en) * 2021-06-29 2024-04-30 云洗电子商务有限公司 Data processing method, device, equipment and computer readable storage medium
CN113419998A (en) * 2021-08-25 2021-09-21 成都统信软件技术有限公司 Folder processing method, computing device and readable storage medium

Also Published As

Publication number Publication date
CN109408471B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN102880663B (en) The optimization of the file of part deduplication
CN111552899B (en) Method and system for improving display performance of front-end report
CN109408471A (en) A kind of compressed package decompressing method, device and storage medium based on matching tree
CN108304329B (en) Test case design method and device, terminal and readable storage medium
CN103049574B (en) Realize key assignments file system and the method for file dynamic copies
CN103902589A (en) Method and device for managing downloaded files
CN107368343A (en) A kind of starting up of terminal method, terminal and storage medium based on Android system
CN109284262A (en) A kind of business-electronic document management server-side and system
CN107450856A (en) Writing method and reading method of stored data, corresponding devices and terminals
CN106570153A (en) Data extraction method and system for mass URLs
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN102377688A (en) File transmission method and equipment
CN106570152B (en) Mass extraction method and system for mobile phone numbers
CN103544254B (en) A kind of data managing method and device
CN111488483B (en) Method, device, terminal and non-transitory computer readable storage medium for updating a library
CN113297267A (en) Data caching and task processing method, device, equipment and storage medium
CN109617708B (en) Compression method, device and system for embedded point log
CN103838873B (en) The method and system that a kind of application matching owner's information is searched for automatically
CN111767280A (en) Data processing method, device and storage medium
CN116795803A (en) File data storage method, device, equipment and storage medium
CN102831144B (en) Based on the bookmark interaction processing method of mobile terminal, device and system
CN107918654B (en) File decompression method and device and electronic equipment
CN110908958B (en) File processing method, device, terminal and storage medium
CN107562452A (en) Terminal preset application update method, intelligent terminal and the device with store function
CN111161047A (en) Bank business data processing and inquiring method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant