CN110019055A - Without configuration file compression method, compression set, compressing terminal and storage medium - Google Patents

Without configuration file compression method, compression set, compressing terminal and storage medium Download PDF

Info

Publication number
CN110019055A
CN110019055A CN201810585564.4A CN201810585564A CN110019055A CN 110019055 A CN110019055 A CN 110019055A CN 201810585564 A CN201810585564 A CN 201810585564A CN 110019055 A CN110019055 A CN 110019055A
Authority
CN
China
Prior art keywords
resource
compression
sub
compressed package
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.)
Pending
Application number
CN201810585564.4A
Other languages
Chinese (zh)
Inventor
张克明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810585564.4A priority Critical patent/CN110019055A/en
Publication of CN110019055A publication Critical patent/CN110019055A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files

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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of no configuration file compression method, compression set, compressing terminal and computer readable storage mediums, this includes: to receive and parse through first resource without configuration file compression method, to extract the dependence of the first resource in first resource, and is relied on based on first resource and generate first resource tree;Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in Secondary resource, and is relied on based on Secondary resource and generates Secondary resource tree;Compression packing is carried out to first resource tree and Secondary resource tree respectively, to obtain the first sub- compressed package and the second sub- compressed package, and the first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.The present invention, which solves, to be needed to carry out parameter testing to disparity items data in item file compression process, lead to the cumbersome redundancy of compressing file process, influence development efficiency the technical issues of, simplify compressing file process, improve compressing file efficiency, accelerate project development progress, improves project development efficiency.

Description

Without configuration file compression method, compression set, compressing terminal and storage medium
Technical field
The present invention relates to file packaging technique field more particularly to a kind of no configuration file compression methods, compression set, pressure Contracting terminal and computer readable storage medium.
Background technique
There is many data compression tools on the market at present, and these data compression tools are all around configuration and plug-in unit Building.But nowadays the data volume of data compression configuration is increasing, and the compression configuration between disparity items data Parameter may be completely different, this will lead to the increase of the data coupling efficiency between different configuration parameters, to influence different item The compression function of mesh number evidence.Meanwhile the configuration parameter between disparity items data requires developer substantially and goes to debug, and increases Artificial process, leads to the excessively cumbersome redundancy of the data compression process based on configuration, not only extends compression time, also reduce Project development efficiency delays project development progress, influences project development process.
Summary of the invention
The main purpose of the present invention is to provide a kind of no configuration file compression method, compression set, compressing terminal and meters Calculation machine readable storage medium storing program for executing, it is intended to solve to need to carry out parameter testing to disparity items data in item file compression process, lead Cause the cumbersome redundancy of compressing file process, influence development efficiency the technical issues of.
To achieve the above object, the embodiment of the present invention provides a kind of no configuration file compression method, the no configuration file Compression method includes:
First resource is received and parsed through, to extract the dependence of the first resource in the first resource, and is based on described first Resource Dependence generates first resource tree;
Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in the Secondary resource, and is based on described second Resource Dependence generates Secondary resource tree;
Compression packing is carried out to the first resource tree and the Secondary resource tree respectively, with obtain the first sub- compressed package and Second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.
Preferably, described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain One sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression The step of packet includes:
The first resource type of the first resource tree and the Secondary resource type of the Secondary resource tree are obtained respectively;
Preset first compressor is obtained according to the first resource type, and is obtained in advance according to the Secondary resource type If the second compressor, first compressor and second compressor are preset with the first reduced rule and the second compression respectively Rule;
It controls first compressor and second compressor is based on first reduced rule and second compression Rule carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first sub- compressed package and second Sub- compressed package;
Described first sub- compressed package and the second sub- compressed package are merged into compression, obtain targeted compression packet.
Preferably, described 33 control first compressor and second compressor be based on first reduced rule and Second reduced rule carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first son The step of compressed package and the second sub- compressed package includes:
It controls first compressor and is based on first reduced rule and first resource dependence to first money Source tree carries out compression packing, to obtain the first sub- compressed package;
It controls second compressor and is based on second reduced rule and Secondary resource dependence to second money Source tree carries out compression packing, to obtain the second sub- compressed package.
Preferably, described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain One sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression After the step of packet further include:
When detecting the resource alteration command based on the first resource and/or the Secondary resource, to default terminal It sends compressed package and updates prompt.
Preferably, the no configuration file compression method further include:
When detecting that resource compression is abnormal, the abnormal number of system feedback is obtained, and determine according to the abnormal number Abnormal cause;
When detecting the abnormal cause is that resource tree building is abnormal, the first warning letter of output resource tree building failure Breath, and user is prompted to import correct first resource and/or Secondary resource;
When detecting the abnormal cause is that compressor application is abnormal, the second warning message of output compressor failure, And prompt the first compressor and/or the second compressor of user's update latest edition.
Preferably, the first resource type and Secondary resource type are referred to as resource type, first compressor and the Two compressors are referred to as default compressor, the no configuration file compression method further include:
When detecting there is no when the default compressor with resource type phase mapping, pass through internet checking to the resource The corresponding targeted compression device of type, and the targeted compression device is downloaded from official website.
Preferably, the first resource and Secondary resource are referred to as resource file, the first resource tree and Secondary resource tree It is referred to as resource tree, the no configuration file compression method further include:
When resource tree can not be generated according to resource file by detecting, the corresponding file size of the resource file is obtained;
If the file size is greater than preset threshold, output file capacity is exceeded, can not execute no configuration file compression Prompt information.
The present invention also provides a kind of compression set, the compression set includes:
First extraction module, for receiving and parsing through first resource, with extract the first resource in the first resource according to Rely, and is relied on based on the first resource and generate first resource tree;
Second extraction module, for receiving and parsing through Secondary resource, with extract the Secondary resource in the Secondary resource according to Rely, and is relied on based on the Secondary resource and generate Secondary resource tree;
Compression module, for carrying out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain First sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into target pressure Contracting packet.
In addition, to achieve the above object, the present invention also provides a kind of compressing terminal, the compressing terminal include: memory, Processor, communication bus and be stored on the memory without configuration be packaged program, wherein it is described without configuration be packaged program When being executed by the processor, realize such as the step of above-mentioned no configuration file compression method.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Storage medium, which is stored with, is packaged program without configuration, wherein it is described when being packaged program without configuration and being executed by processor, it realizes as above-mentioned Without configuration file compression method the step of.
The present invention is by receiving and parsing through first resource, to extract the dependence of the first resource in first resource, and based on the One Resource Dependence generates first resource tree;Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in Secondary resource, and It is relied on based on Secondary resource and generates Secondary resource tree;Compression packing is carried out to first resource tree and Secondary resource tree respectively, to obtain The first sub- compressed package and the second sub- compressed package are obtained, and the first sub- compressed package and the second sub- compressed package are merged into targeted compression packet. The present invention, which solves, to be needed to carry out parameter testing to disparity items data in item file compression process, leads to compressing file process Cumbersome redundancy, influence development efficiency the technical issues of, by with the reduced rule in the compressor of resource type phase mapping, it is real Showed the compressing file scheme without configuration, simplified compressing file process, improved compressing file efficiency, accelerate project development into Degree, improves project development efficiency.
Detailed description of the invention
Fig. 1 is the flow diagram of the invention without configuration file compression method first embodiment;
Fig. 2 is the refinement flow diagram of step S30 in Fig. 1;
Fig. 3 is the functional block diagram of compression set of the present invention;
Fig. 4 is the device structure schematic diagram for the hardware running environment that present invention method is related to;
Fig. 5 is the present invention without one design diagram of configuration file compression method.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of no configuration file compression method, in no configuration file compression method first embodiment, ginseng According to Fig. 1, the no configuration file compression method includes:
Step S10, receives and parses through first resource, to extract the dependence of the first resource in the first resource, and is based on The first resource, which relies on, generates first resource tree;
Step S20, receives and parses through Secondary resource, to extract the dependence of the Secondary resource in the Secondary resource, and is based on The Secondary resource, which relies on, generates Secondary resource tree;
There is many data compression tools on the market at present, and these data compression tools are all around configuration and plug-in unit Building.But nowadays the data volume of data compression configuration is increasing, and the compression configuration between disparity items data Parameter may be completely different, this will lead to the increase of the data coupling efficiency between different configuration parameters, to influence different item The compression function of mesh number evidence.Meanwhile the configuration parameter between disparity items data requires developer substantially and goes to debug, and increases Artificial process, leads to the excessively cumbersome redundancy of the data compression process based on configuration, not only extends compression time, also reduce Project development efficiency delays project development progress, influences project development process.
No configuration file compression method provided by the present invention, which solves, to be needed in item file compression process to different item Mesh number according to carry out parameter testing, lead to the cumbersome redundancy of compressing file process, influence development efficiency the technical issues of, by with money Reduced rule in the compressor of Source Type phase mapping realizes the compressing file scheme of no configuration, simplifies compressing file stream Journey improves compressing file efficiency, accelerates project development progress, improves project development efficiency.
In the present embodiment, the first resource refers to portal resource, that is, carries out the resource data for being packaged compression, should Portal resource can be the resource files such as JS, CSS or HTML.The first resource that terminal gets importing first is parsed, To lock the Resource Dependence relationship in first resource.Such as in first resource, egress C can be obtained by node A and node B, led to Egress C can also be obtained by crossing node A, can also obtain egress C by node B, then saying node C portion dependent on node A and node B;Egress C can be obtained by node A and node B, but node A or node B independent can not obtain egress C, then saying that node C is complete Node A and node B is depended on entirely;Node B is obtained by node A, node C is obtained by node B, but node C cannot be saved Point B, node B cannot get node A, then node C transitive dependency is in node A.Terminal is climbed from the parameter chain in first resource Corresponding chain relationship is taken, Resource Dependence relationship is locked.
Since there may be mutual dependence adduction relationships between data method each in resource, so that being formed between data The entirety of machine, therefore this Resource Dependence relation chain cannot disconnect, it otherwise will be so that each resource be isolated and nothing in project data Method plays its true utilities.
Terminal will determine each specific resource data according to Resource Dependence relationship, and generate the first money according to this relationship Source tree.The first resource tree is the bundle tree of current first resource, is a kind of executable data, is the pumping to each resource data As encapsulation.Only encapsulate same type of resource data, such as CSS code or html code in first resource tree.
After extracting Resource Dependence relationship, using the public highest resource data of the intersection frequency of occurrences of each resource data as Father node, different nodes can be formed by being formed by Resource Dependence relationship by father node and other nodes (brotgher of node, child node) Link.In i.e. all Resource Dependence relationships, each resource data all originates from two public primary datas, this two are public initial Data are father node, and function and effect have derived countless child nodes, and have derived new child node between these child nodes. But all child nodes are derived indirectly from father node, therefore, each resource data are encapsulated as one by Resource Dependence relationship Individually abstract packet, as first resource tree.
The Secondary resource refers to other resources for being different from portal resource.Secondary resource and first resource inhomogeneity Type, but also belong to complete other participation resources in compressing file project, i.e., it is responsible according to being differently formed for exploitation code Other are packaged the child resource of process.Encapsulate java code in first resource, Secondary resource encapsulates html code, common service In a compressing file project.In the present invention, by the purpose that resource is divided into first resource and Secondary resource be in order to avoid Excessive parsing and code is run on same file, so that final compression is packaged process and misplaces, leads to appearance pair The phenomenon that repeatedly compression is packaged is carried out with portion resource.Secondary resource is the general designation in order to distinguish over first resource, reality In, Secondary resource can be multiple resource files, i.e. Secondary resource may include two or more resource files, respectively represent Different resource trees.Therefore, when receiving Secondary resource, Secondary resource tree can also be obtained by above method.
First resource and Secondary resource respectively represent different resource types, and first resource tree and Secondary resource tree represent The abstract design of first resource and Secondary resource.
Step S30 carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first son Compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.
It is desirable that first resource tree and Secondary resource tree, which respectively represent the different resource data packet of different resource datas, It is packaged process by different compressions, because the resource data in different resource data packets is different, it is assumed that not to it If carrying out classified compression, may be packaged the file for compressing out will be unable to normally be quoted;Or the same resource data meeting It is packaged by multiple compression.
First resource tree and Secondary resource tree are carried out to obtain the first sub- compressed package and the second son compression after separating compression Packet, the first sub- compressed package and the second sub- compressed package are engaged togather, and form a final targeted compression packet.
Include: referring to Fig. 2, the step S30
Step S31 obtains the first resource type of the first resource tree and the second money of the Secondary resource tree respectively Source Type;
Step S32 obtains preset first compressor according to the first resource type, and according to the Secondary resource class Type obtains preset second compressor, first compressor and second compressor be preset with respectively the first reduced rule and Second reduced rule;
In the present invention, first resource and Secondary resource represent the data resource of a variety of different resource types, only area Divide resource type, the compression packing manner for meeting the resource type could be used.Therefore, system first gets first resource tree The Secondary resource type of first resource type and Secondary resource tree.Include code in resource tree, can reflect corresponding resources-type Type.By getting resource type, terminal can determine corresponding compressor, and different resource types has corresponding compressor, example If CSS resource is corresponding with the compress mode of CSS, and JS resource is corresponding with the compress mode of JS.Each resource only passes through pair The compress mode answered carries out compression packing, can just obtain effective compressed package.Specifically, compressor is known how each resource Code be merged by browser load definitive document in because compressor is in advance will be needed for different types of packetization types Configuration parameter be completely independent into a tool.The compression method of same type of different resource tree totally follows same compression Process, it is unique unlike in resource tree dependence difference.
Therefore available first compressor and the second compressor, the first compressor and the second compressor are exactly that different resource is corresponding Compression packing manner, be preset with the first reduced rule and the second reduced rule respectively.Obtaining the first compressed package and the second pressure After contracting packet, terminal will merge it, to form an integrated data packet, i.e., final compression packaging file.
Different types of resource type needs to quote different compressors, to realize category management.So there is no need to Classifying packing is carried out to different types of resource data in same file, and can be achieved on resource type classifying packing Afterwards, then the comprehensive compression packaging file at an entirety.
Step S33 controls first compressor and second compressor and is based on first reduced rule and described Second reduced rule carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first son compression Packet and the second sub- compressed package;
It is preset with compressor in the present invention, first resource tree and Secondary resource tree can be carried out compression and beaten by the compressor Packet.Preset to compress in resource tree in compressor and applied reduced rule in the compressor when being packaged, due in resource tree The incidence relation of resource data is abstracted, therefore compressor can directly take out the incidence relation among resource tree, To carry out compression packing to respective resource tree respectively.
The introduction of resource tree is the incidence relation in order to abstract each back end in resource file, and finally executes pressure Contracting is compressor, has a fixing sleeve overall flow for compressing to a certain certain types of resource data in compressor. That is, compressor can directly call corresponding Resource Dependence relationship from resource tree, and do not have to from the resource file of source Analysis obtains the Resource Dependence relationship.It comprises the concrete steps that and the first compressor and the second compressor is controlled in corresponding function by system Under first reduced rule and the second reduced rule, compression is executed to first resource tree and Secondary resource tree and is packaged function, obtains the One sub- compressed package and the second sub- compressed package.
The step S33 includes:
Step S331 controls first compressor and is based on first reduced rule and first resource dependence to institute It states first resource tree and carries out compression packing, to obtain the first sub- compressed package;
Step S332 controls second compressor and is based on second reduced rule and Secondary resource dependence to institute It states Secondary resource tree and carries out compression packing, to obtain the second sub- compressed package.
System can control the first compressor to rely on by first resource and press with the first reduced rule first resource tree Contracting is packaged.For example, A node and B node are interrelated, while B node and C node are interrelated.So the first resource relies on It will be compressed under the first reduced rule, the first reduced rule refers to the compression configuration ginseng for first resource tree type Number.That is, this programme is the first reduced rule configuration parameter being arranged in advance in the first compressor without configuration.System After system only need to obtain corresponding first compressor after determining first resource type, advised using the first compression in compressor The packing of the compression to first resource tree then can be realized.
In addition, system can import resource tree, if resource tree is imported by other data packets, system from other data packets It needs first to extract the Resource Dependence in resource tree, then compression packing is carried out based on corresponding reduced rule and Resource Dependence.
Similarly, system can control the second compressor be based on the second reduced rule and Secondary resource rely on to Secondary resource tree into Row compression, obtains the second sub- compressed package.
Described first sub- compressed package and the second sub- compressed package are merged compression, obtain targeted compression packet by step S34.
After getting the first sub- compressed package and the second sub- compressed package, system will merge compression to the two, to obtain Final targeted compression packet.It is specific merge compression process mainly by the code of the first sub- compressed package and the second sub- compressed package into Row linking merges.
First sub- compressed package and the second sub- compressed package be it is independent, therefore, the first compressor and the second compressor also will be same When be engaged togather to the first compressed package and the second compressed package, specific convergence process is existing code compilation, utilizes difference The preparatory general linking interface of compressor realizes that code merges.
It is explained for convenience, is the present invention without one alternative embodiment of configuration file compression method referring to Fig. 5, Fig. 5 Design diagram.System receives single portal resource (types such as JS, CSS, HTML), and parses to the portal resource, The Resource Dependence of resource is extracted, resource tree is formed, resource tree is built up to the bundle tree for having Resource Dependence by arranging;Together When, system receives new portal resource from other entrances (such as import () function imports), equally extracts the resource of the resource It relies on, is organized into the fraternal bundle of bundle tree.Bundle tree and brother bundle are resource trees, and difference is it Resource type is different, and if bundle tree represents the resource data of JS type, and first brother bundle represents HTML class The resource data of type, second brother bundle represent the resource data of CSS type.Different types of resource data can pass through It is separately packaged, this needs preset corresponding type compressor, JS resource type in system to need using special JS compressor, together Reason, the resource of HTML and CSS type also have special corresponding compressor.Using different type compressors, by each resource into Row compression carries out being connected again merging after being packaged can be obtained final compressed package.
The present invention is by receiving and parsing through first resource, to extract the dependence of the first resource in first resource, and based on the One Resource Dependence generates first resource tree;Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in Secondary resource, and It is relied on based on Secondary resource and generates Secondary resource tree;Compression packing is carried out to first resource tree and Secondary resource tree respectively, to obtain The first sub- compressed package and the second sub- compressed package are obtained, and the first sub- compressed package and the second sub- compressed package are merged into targeted compression packet. The present invention, which solves, to be needed to carry out parameter testing to disparity items data in item file compression process, leads to compressing file process Cumbersome redundancy, influence development efficiency the technical issues of, by with the reduced rule in the compressor of resource type phase mapping, it is real Showed the compressing file scheme without configuration, simplified compressing file process, improved compressing file efficiency, accelerate project development into Degree, improves project development efficiency.
Further, on the basis of the present invention is without configuration file compression method first embodiment, propose that present invention nothing is matched File compression method second embodiment is set, the difference with previous embodiment is, after the step S30 further include:
Step S40, when detecting the resource alteration command based on the first resource and/or the Secondary resource, to Default terminal sends compressed package and updates prompt.
When in project first resource and/or Secondary resource update when, resource alteration command can be generated.At this point, right The resource data and resource structures answered may change, and original targeted compression packet will no longer be adapted to current item code. Therefore this case has a monitoring mechanism, for monitoring the variation of resource data in real time, when the money of first resource and/or Secondary resource When real-time change occurs for source data, corresponding targeted compression packet is also required to update.It is compressed at this point, system will be sent to default terminal Packet updates prompt, and the targeted compression packet to avoid mistake delays project development progress.
Further, on the basis of the present invention is without configuration file compression method second embodiment, propose that present invention nothing is matched File compression method 3rd embodiment is set, the difference with previous embodiment is, the no configuration file compression method further include:
Step S50 obtains the abnormal number of system feedback, and according to the exception when detecting that resource compression is abnormal It numbers and determines abnormal cause;
Step S60, when detecting the abnormal cause is that resource tree building is abnormal, the of output resource tree building failure One warning message, and user is prompted to import correct first resource and/or Secondary resource;
Step S70, when detecting the abnormal cause is that compressor application is abnormal, the second of output compressor failure is alert Information is accused, and prompts the first compressor and/or the second compressor of user's update latest edition.
In reality scene, in fact it could happen that the case where resource compression is abnormal, and compression is caused to fail.And at this moment system meeting An abnormal number is fed back as abnormality detection point.User or system can determine abnormal cause by abnormal encode, because different Often coding, which represents, there are abnormal all situations and cause.
Abnormal cause can be divided into two kinds, and resource tree building is abnormal and compressor application is abnormal.When detect resource tree construct When abnormal, need to issue the first warning message, to prompt the building failure of user resources tree, while the solution party for prompting user current Case prompts user to import correct first resource and/or Secondary resource again.Therefore it is usually source file that resource tree building is abnormal Being damaged can just occur, it is therefore desirable to import first resource, Secondary resource again.
When detecting that compressor application is abnormal, it was demonstrated that for present compressor when compressing corresponding resource, having occurred can not It is normally-compacted to happen, it needs to issue the second warning message at this time, to prompt the application failure of user's compressor, prompt simultaneously User updates compressor, re-starts resource compression with the first compressor and/or the second compressor using latest edition.
Further, on the basis of the present invention is without configuration file compression method 3rd embodiment, propose that present invention nothing is matched File compression method fourth embodiment is set, the difference with previous embodiment is, the first resource type and Secondary resource class Type is referred to as resource type, and first compressor and the second compressor are referred to as default compressor, the no configuration file compression side Method further include:
Step S80 is arrived when detecting there is no when the default compressor with resource type phase mapping by internet checking The corresponding targeted compression device of the resource type, and the targeted compression device is downloaded from official website.
Assuming that the resource type more unexpected winner of the resource file imported, leads in systems the default compression of not phase mapping Device, will cause system in this way can not compress resource file.At this point, system will carry out the resource type by internet Inquiry, to determine the corresponding targeted compression device of the resource type.The targeted compression device can be directed to the resource of the resource type File carries out compressing file.Different resource type corresponds to different targeted compression devices, and in system detection to can not reflect When being mapped to the targeted compression device of resource type, illustrate current goal compressor be it is unknown, need by extraneous internet determine Targeted compression device.After determining corresponding targeted compression device, since system does not have targeted compression device locally, it is therefore desirable to by it Competence exertion effectiveness is downloaded, can be downloaded from the official website of targeted compression device at this time.The official website is should The official of targeted compression device downloads channel.
Further, on the basis of the present invention is without configuration file compression method fourth embodiment, propose that present invention nothing is matched The 5th embodiment of file compression method is set, the difference with previous embodiment is, the first resource and Secondary resource are referred to as money Source file, the first resource tree and Secondary resource tree are referred to as resource tree, the no configuration file compression method further include:
Step S90 obtains the corresponding text of the resource file when resource tree can not be generated according to resource file by detecting Part capacity;
Step S100, if the file size is greater than preset threshold, output file capacity is exceeded, can not execute no configuration The prompt information of compressing file.
Assuming that system can not generate resource tree, such as first resource tree can not be generated according to first resource, then prove currently to deposit In the generational verctor for influencing first resource tree.And the generation of resource tree needs to call enough system resource, the text of first resource Part capacity influences whether the generation of resource tree, and file size is bigger, and corresponding Resource Dependence relationship is more complicated, and utilizes no configuration File compression method constructs first resource tree and needs fine compression method, if file size is bigger, then to first resource The building of tree is also more cumbersome.Certainly, generating Secondary resource tree is also similarly.Therefore it can not be raw according to resource file when detecting When at resource tree, the corresponding file size of the resource file is obtained.
The present embodiment is provided with a preset threshold, and the preset threshold is a threshold reference value of file size.If The file size is greater than preset threshold, then proves that current file capacity is exceeded, first resource and/or Secondary resource are built into The system resource called needed for resource tree has been more than currently permitted range, including fineness, resource allocation ability etc..? That is cannot obtain corresponding to the resource tree for not influencing system normal operation accurately using no configuration file compression method.This When, system is exceeded by output file capacity, can not execute the prompt information of no configuration file compression.
Referring to Fig. 3, the present invention provides a kind of compression set, the compression set includes:
First extraction module, for receiving and parsing through first resource, with extract the first resource in the first resource according to Rely, and is relied on based on the first resource and generate first resource tree;
Second extraction module, for receiving and parsing through Secondary resource, with extract the Secondary resource in the Secondary resource according to Rely, and is relied on based on the Secondary resource and generate Secondary resource tree;
Compression module, for carrying out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain First sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into target pressure Contracting packet.
Referring to Fig. 4, Fig. 4 is the device structure schematic diagram for the hardware running environment that present invention method is related to.
The terminal of that embodiment of the invention can be PC, be also possible to smart phone, tablet computer, E-book reader, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3) Player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard sound Frequency level 4) terminal devices such as player, portable computer.
As shown in figure 4, the compressing terminal may include: processor 1001, such as CPU, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between processor 1001 and memory 1005.Memory 1005 It can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage. Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
Optionally, which can also include user interface, network interface, camera, RF (Radio Frequency, radio frequency) circuit, sensor, voicefrequency circuit, WiFi module etc..User interface may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface can also include wireline interface, the nothing of standard Line interface.Network interface optionally may include standard wireline interface and wireless interface (such as WI-FI interface).
It will be understood by those skilled in the art that compressing terminal structure shown in Fig. 4 does not constitute the limit to compressing terminal It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in figure 4, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium Believe module and is packaged program without configuration.Operating system is to manage and control the program of compressing terminal hardware and software resource, branch Hold the operation that program and other softwares and/or program are packaged without configuration.Network communication module is for realizing in memory 1005 Communication between each component in portion, and communicated between hardware and softwares other in compressing terminal.
In compressing terminal shown in Fig. 4, processor 1001 be used for execute stored in memory 1005 without configuration be packaged Program performs the steps of
First resource is received and parsed through, to extract the dependence of the first resource in the first resource, and is based on described first Resource Dependence generates first resource tree;
Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in the Secondary resource, and is based on described second Resource Dependence generates Secondary resource tree;
Compression packing is carried out to the first resource tree and the Secondary resource tree respectively, with obtain the first sub- compressed package and Second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.
Further, described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain First sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into target pressure Contracting packet the step of include:
The first resource type of the first resource tree and the Secondary resource type of the Secondary resource tree are obtained respectively;
Preset first compressor is obtained according to the first resource type, and is obtained in advance according to the Secondary resource type If the second compressor, first compressor and second compressor are preset with the first reduced rule and the second compression respectively Rule;
It controls first compressor and second compressor is based on first reduced rule and second compression Rule carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first sub- compressed package and second Sub- compressed package;
Described first sub- compressed package and the second sub- compressed package are merged into compression, obtain targeted compression packet.
Further, described 33 first compressor and second compressor are controlled based on first reduced rule Compression packing is carried out to the first resource tree and the Secondary resource tree respectively with second reduced rule, to obtain first The step of sub- compressed package and the second sub- compressed package includes:
It controls first compressor and is based on first reduced rule and first resource dependence to first money Source tree carries out compression packing, to obtain the first sub- compressed package;
It controls second compressor and is based on second reduced rule and Secondary resource dependence to second money Source tree carries out compression packing, to obtain the second sub- compressed package.
Further, described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain First sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into target pressure After the step of contracting packet further include:
When detecting the resource alteration command based on the first resource and/or the Secondary resource, to default terminal It sends compressed package and updates prompt.
Further, the no configuration file compression method further include:
When detecting that resource compression is abnormal, the abnormal number of system feedback is obtained, and determine according to the abnormal number Abnormal cause;
When detecting the abnormal cause is that resource tree building is abnormal, the first warning letter of output resource tree building failure Breath, and user is prompted to import correct first resource and/or Secondary resource;
When detecting the abnormal cause is that compressor application is abnormal, the second warning message of output compressor failure, And prompt the first compressor and/or the second compressor of user's update latest edition.
Further, the first resource type and Secondary resource type are referred to as resource type, first compressor and Second compressor is referred to as default compressor, the no configuration file compression method further include:
When detecting there is no when the default compressor with resource type phase mapping, pass through internet checking to the resource The corresponding targeted compression device of type, and the targeted compression device is downloaded from official website.
Further, the first resource and Secondary resource are referred to as resource file, the first resource tree and Secondary resource Tree is referred to as resource tree, the no configuration file compression method further include:
When resource tree can not be generated according to resource file by detecting, the corresponding file size of the resource file is obtained;
If the file size is greater than preset threshold, output file capacity is exceeded, can not execute no configuration file compression Prompt information.
The specific embodiment of compressing terminal of the present invention and above-mentioned no each embodiment of configuration file compression method are essentially identical, Details are not described herein.
The present invention also provides a kind of computer readable storage medium, the computer-readable recording medium storage has one Perhaps more than one program the one or more programs can also be executed by one or more than one processor with For:
First resource is received and parsed through, to extract the dependence of the first resource in the first resource, and is based on described first Resource Dependence generates first resource tree;
Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in the Secondary resource, and is based on described second Resource Dependence generates Secondary resource tree;
Compression packing is carried out to the first resource tree and the Secondary resource tree respectively, with obtain the first sub- compressed package and Second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.
Computer readable storage medium specific embodiment of the present invention and above-mentioned no each embodiment of configuration file compression method Essentially identical, details are not described herein.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of no configuration file compression method, which is characterized in that the no configuration file compression method includes:
First resource is received and parsed through, to extract the dependence of the first resource in the first resource, and is based on the first resource It relies on and generates first resource tree;
Secondary resource is received and parsed through, to extract the dependence of the Secondary resource in the Secondary resource, and is based on the Secondary resource It relies on and generates Secondary resource tree;
Compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain the first sub- compressed package and second Sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet.
2. as described in claim 1 without configuration file compression method, which is characterized in that
It is described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, with obtain the first sub- compressed package and Second sub- compressed package, and the step of the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet packet It includes:
The first resource type of the first resource tree and the Secondary resource type of the Secondary resource tree are obtained respectively;
Preset first compressor is obtained according to the first resource type, and preset according to Secondary resource type acquisition Second compressor, first compressor and second compressor are preset with the first reduced rule and the second compression rule respectively Then;
It controls first compressor and second compressor is based on first reduced rule and second reduced rule Compression packing is carried out to the first resource tree and the Secondary resource tree respectively, to obtain the first sub- compressed package and the second son pressure Contracting packet;
Described first sub- compressed package and the second sub- compressed package are merged into compression, obtain targeted compression packet.
3. as claimed in claim 2 without configuration file compression method, which is characterized in that
The control first compressor and second compressor are based on first reduced rule and second compression Rule carries out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain the first sub- compressed package and second The step of sub- compressed package includes:
It controls first compressor and is based on first reduced rule and first resource dependence to the first resource tree Compression packing is carried out, to obtain the first sub- compressed package;
It controls second compressor and is based on second reduced rule and Secondary resource dependence to the Secondary resource tree Compression packing is carried out, to obtain the second sub- compressed package.
4. as claimed in claim 3 without configuration file compression method, which is characterized in that
It is described that compression packing is carried out to the first resource tree and the Secondary resource tree respectively, with obtain the first sub- compressed package and Second sub- compressed package, and after the step of the described first sub- compressed package and the second sub- compressed package are merged into targeted compression packet Further include:
When detecting the resource alteration command based on the first resource and/or the Secondary resource, sent to default terminal Compressed package updates prompt.
5. as claimed in claim 4 without configuration file compression method, which is characterized in that the no configuration file compression method is also Include:
When detecting that resource compression is abnormal, the exception number of system feedback is obtained, and exception is determined according to the abnormal number Reason;
When detecting the abnormal cause is that resource tree building is abnormal, the first warning message of output resource tree building failure, And user is prompted to import correct first resource and/or Secondary resource;
When detecting the abnormal cause is that compressor application is abnormal, the second warning message of output compressor failure, and mention Show that user updates the first compressor and/or the second compressor of latest edition.
6. as claimed in claim 5 without configuration file compression method, which is characterized in that the first resource type and the second money Source Type is referred to as resource type, and first compressor and the second compressor are referred to as default compressor, the no configuration file pressure Contracting method further include:
When detecting there is no when the default compressor with resource type phase mapping, pass through internet checking to the resource type Corresponding targeted compression device, and the targeted compression device is downloaded from official website.
7. as claimed in claim 6 without configuration file compression method, which is characterized in that the first resource and Secondary resource system Claim resource file, the first resource tree and Secondary resource tree are referred to as resource tree, the no configuration file compression method further include:
When resource tree can not be generated according to resource file by detecting, the corresponding file size of the resource file is obtained;
If the file size is greater than preset threshold, output file capacity is exceeded, can not execute mentioning for no configuration file compression Show information.
8. a kind of compression set, which is characterized in that the compression set includes:
First extraction module, for receiving and parsing through first resource, to extract the dependence of the first resource in the first resource, and It is relied on based on the first resource and generates first resource tree;
Second extraction module, for receiving and parsing through Secondary resource, to extract the dependence of the Secondary resource in the Secondary resource, and It is relied on based on the Secondary resource and generates Secondary resource tree;
Compression module, for carrying out compression packing to the first resource tree and the Secondary resource tree respectively, to obtain first Sub- compressed package and the second sub- compressed package, and the described first sub- compressed package and the second sub- compressed package are merged into targeted compression Packet.
9. a kind of compressing terminal, which is characterized in that the compressing terminal includes: memory, processor, communication bus and storage It is packaged program without configuration on the memory, the processor is described without configuration packing program for executing, to realize such as The step of described in any one of claims 1 to 7 without configuration file compression method.
10. a kind of computer readable storage medium, which is characterized in that be stored with no configuration on the computer readable storage medium It is packaged program, described be packaged when program is executed by processor without configuration realizes that the nothing as described in any one of claims 1 to 7 is matched The step of setting file compression method.
CN201810585564.4A 2018-06-06 2018-06-06 Without configuration file compression method, compression set, compressing terminal and storage medium Pending CN110019055A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810585564.4A CN110019055A (en) 2018-06-06 2018-06-06 Without configuration file compression method, compression set, compressing terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810585564.4A CN110019055A (en) 2018-06-06 2018-06-06 Without configuration file compression method, compression set, compressing terminal and storage medium

Publications (1)

Publication Number Publication Date
CN110019055A true CN110019055A (en) 2019-07-16

Family

ID=67188313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810585564.4A Pending CN110019055A (en) 2018-06-06 2018-06-06 Without configuration file compression method, compression set, compressing terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110019055A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110989992A (en) * 2019-10-30 2020-04-10 无线生活(北京)信息技术有限公司 Resource processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070254715A1 (en) * 2004-09-06 2007-11-01 Matsushit Electric Industrdial Co., Ltd. Classifying-Synthesizing Transmission Method of Multi-User Feedback Information at Base Station
CN102436373A (en) * 2011-09-13 2012-05-02 上海普元信息技术股份有限公司 Method for realizing resource loading and resource hot-updating in distributed enterprise application system
CN103731393A (en) * 2012-10-10 2014-04-16 盐城睿泰数字科技有限公司 Method for compressing Web resource data
CN106528229A (en) * 2016-11-03 2017-03-22 北京像素软件科技股份有限公司 Game hot updating method and device
CN107908781A (en) * 2017-12-05 2018-04-13 深圳市乐宜科技有限公司 A kind of convenient method that need not update app versions issue different editions e-magazine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070254715A1 (en) * 2004-09-06 2007-11-01 Matsushit Electric Industrdial Co., Ltd. Classifying-Synthesizing Transmission Method of Multi-User Feedback Information at Base Station
CN102436373A (en) * 2011-09-13 2012-05-02 上海普元信息技术股份有限公司 Method for realizing resource loading and resource hot-updating in distributed enterprise application system
CN103731393A (en) * 2012-10-10 2014-04-16 盐城睿泰数字科技有限公司 Method for compressing Web resource data
CN106528229A (en) * 2016-11-03 2017-03-22 北京像素软件科技股份有限公司 Game hot updating method and device
CN107908781A (en) * 2017-12-05 2018-04-13 深圳市乐宜科技有限公司 A kind of convenient method that need not update app versions issue different editions e-magazine

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110989992A (en) * 2019-10-30 2020-04-10 无线生活(北京)信息技术有限公司 Resource processing method and device
CN110989992B (en) * 2019-10-30 2023-10-31 无线生活(北京)信息技术有限公司 Resource processing method and device

Similar Documents

Publication Publication Date Title
CN106815370B (en) Method, device and system for updating resource file
CN103513998B (en) Upgrade package generation method and device, the method and terminal of the upgrading of living document difference
CN110032511A (en) A kind of interface test method and interface testing equipment
CN105303112B (en) The detection method and device of component call loophole
CN102799640B (en) Page charger and page loading method
CN103259936B (en) Operating system upgrade method for mobile terminal and operating system upgrade device of operating system upgrade method
CN109495870A (en) The method and apparatus of bluetooth test
CN104834530A (en) Method for developing POS application program and cloud server
CN111858113B (en) Application program repairing method and device, service system and storage medium
CN107171897A (en) A kind of interface test method and data-interface test system
CN108536451A (en) Application program buries a method for implanting and device
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN110287093A (en) Mobile terminal, data-interface test method and storage medium
CN106648761B (en) The method and device automatically updated in QT program
CN106844432A (en) Data processing method and device
EP2908498B1 (en) Integrated application generating system and method for internet of things terminal
CN110019055A (en) Without configuration file compression method, compression set, compressing terminal and storage medium
CN107315576A (en) A kind of method and system of dynamic expansion software flow
CN111831540A (en) Debugging information processing method, processing device and storage medium
CN111880791A (en) Scene instance development method and device
CN106951240A (en) A kind of batch packaging method of user's customed product
CN109525550B (en) Data message processing method, device and system
CN108881320B (en) Authentication processing method for user login, server and client
CN106201818A (en) A kind of application program runs statistical method and the device of time
CN113591448B (en) Report generation method, device and storage medium

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