CN106681788B - Method and device for reducing application installation packages and electronic equipment - Google Patents

Method and device for reducing application installation packages and electronic equipment Download PDF

Info

Publication number
CN106681788B
CN106681788B CN201710087221.0A CN201710087221A CN106681788B CN 106681788 B CN106681788 B CN 106681788B CN 201710087221 A CN201710087221 A CN 201710087221A CN 106681788 B CN106681788 B CN 106681788B
Authority
CN
China
Prior art keywords
file
binary coding
resource
installation package
resource file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710087221.0A
Other languages
Chinese (zh)
Other versions
CN106681788A (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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201710087221.0A priority Critical patent/CN106681788B/en
Publication of CN106681788A publication Critical patent/CN106681788A/en
Application granted granted Critical
Publication of CN106681788B publication Critical patent/CN106681788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for reducing an application installation package and electronic equipment, wherein the method comprises the following steps: acquiring a project file corresponding to an application; replacing the identification files corresponding to the resource files in the project file by using the preset labels; storing the first binary codes corresponding to the resource files according to a preset storage path; and replacing the first binary codes corresponding to the resource files with the binary codes of the storage paths in the compiled files corresponding to the project files to generate installation package files corresponding to the applications. Therefore, the identification files corresponding to the resource files in the application installation package are replaced by the labels, the first binary codes corresponding to the resource files are replaced by the binary codes of the preset storage path, and the installation package files corresponding to the application are generated, so that the size of the application installation package is reduced, the space occupied by the application installation package and the flow consumed in the downloading process are saved, the downloading speed and the application utilization rate of the application installation package are improved, and the user experience is improved.

Description

Reduce the method, apparatus and electronic equipment of application installation package
Technical field
The present invention relates to field of computer technology more particularly to a kind of method, apparatus and electronics for reducing application installation package Equipment.
Background technique
With the development of network and computer technology, miscellaneous application is widely used on all kinds of mobile terminals, It is increasingly becoming a part indispensable in people's daily life.
Carrier of the application installation package as application runs this installation kit including the All Files of installation application, can The All Files applied to be discharged on hard disk, the works such as modification registration table, the setting of modification system, creation shortcut are completed Make.If application installation package is too big, the flow that downloading process expends is high, downloading process slowly, low efficiency, cause user to be reluctant It in the mind carries, reduces the utilization rate of application.Therefore, the size for how reducing application installation package becomes in application and development to Guan Chong The work wanted.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.
For this purpose, the first purpose of this invention is to propose a kind of method for reducing application installation package, realizes and utilize mark The corresponding mark file of each resource file in label replacement application installation package, and replaced using the binary coding of preset store path Corresponding first binary coding of each resource file is changed, generates and applies corresponding installation package file, to reduce using installation The size of packet saves the flow expended in application installation package the space occupied and downloading process, improves application installation package The utilization rate of speed of download and application, improves user experience.
Second object of the present invention is to propose a kind of device for reducing application installation package.
Third object of the present invention is to propose a kind of electronic equipment.
Fourth object of the present invention is to propose a kind of storage medium.
5th purpose of the invention is to propose a kind of application program.
In order to achieve the above object, first aspect present invention embodiment proposes a kind of method for reducing application installation package, comprising: It obtains and applies corresponding item file;Utilize the corresponding mark of resource file each in item file described in preset each tag replacement File, wherein different labels corresponds to different resource files;According to preset store path, by each resource file pair The first binary coding answered is stored;In the corresponding compiling file of the item file, the store path is utilized Binary coding replaces corresponding first binary coding of each resource file, generates the corresponding installation kit text of the application Part.
In a kind of possible way of realization of first aspect, the binary coding using the store path is replaced Before corresponding first binary coding of each resource file, further includes:
Routing head is determined by reflecting;
The binary coding using the store path is replaced corresponding first binary system of each resource file and is compiled Code, comprising:
The resource file is replaced using the binary coding of the routing head and the binary coding of the store path Corresponding first binary coding.
In the alternatively possible way of realization of first aspect, the binary coding and institute using the routing head The binary coding for stating store path replaces corresponding first binary coding of the resource file, comprising:
According to the routing head and the store path, text file is generated;
Corresponding first binary coding of the resource file is replaced using the binary coding of the text file.
It is described according to preset store path in the alternatively possible way of realization of first aspect, by each money Before corresponding first binary coding of source file is stored, further includes:
The item file is compiled processing, obtains compiling file corresponding with the item file;
The first binary coding corresponding with each resource file is extracted from the compiling file.
In the alternatively possible way of realization of first aspect, it is described generate the corresponding installation package file of the application it Afterwards, further includes:
The resource file acquisition request that terminal is sent is received, includes the first label and store path in the acquisition request;
Obtain the second binary coding of resource file corresponding with the store path and first label;
Second binary coding is sent to the terminal.
The method provided in an embodiment of the present invention for reducing application installation package, obtains apply corresponding item file first, so Afterwards using the corresponding mark file of resource file each in preset each tag replacement item file, further according to preset storage road Diameter stores corresponding first binary coding of each resource file, finally in the corresponding compiling file of item file, benefit Corresponding first binary coding of each resource file is replaced with the binary coding of store path, generates and applies corresponding installation kit File.Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset The binary coding of store path replaces corresponding first binary coding of each resource file, generates the corresponding installation kit text of application Part saves the stream expended in application installation package the space occupied and downloading process to reduce the size of application installation package Amount, improves the speed of download of application installation package and the utilization rate of application, improves user experience.
In order to achieve the above object, second aspect of the present invention embodiment proposes a kind of device for reducing application installation package, comprising: First obtains module, applies corresponding item file for obtaining;First processing module, for utilizing preset each tag replacement The corresponding mark file of each resource file in the item file, wherein different labels corresponds to different resource files;Storage Module stores corresponding first binary coding of each resource file for according to preset store path;Second Processing module, for being replaced using the binary coding of the store path in the corresponding compiling file of the item file Corresponding first binary coding of each resource file generates the corresponding installation package file of the application.
In a kind of possible way of realization of second aspect, the device of the reduction application installation package, further includes:
Determining module, for determining routing head by reflecting;
The Second processing module, comprising:
Processing unit, the binary coding for binary coding and the store path using the routing head are replaced Corresponding first binary coding of the resource file.
In the alternatively possible way of realization of second aspect, the processing unit is specifically used for:
According to the routing head and the store path, text file is generated;
Corresponding first binary coding of the resource file is replaced using the binary coding of the text file.
In the alternatively possible way of realization of second aspect, the device of the reduction application installation package, further includes:
Third processing module obtains corresponding with the item file for the item file to be compiled processing Compiling file;
Extraction module, for extracting the first binary system volume corresponding with each resource file from the compiling file Code.
In the alternatively possible way of realization of second aspect, the device of the reduction application installation package, further includes:
Receiving module includes the first mark in the acquisition request for receiving the resource file acquisition request of terminal transmission Label and store path;
Second obtains module, for obtaining the second of resource file corresponding with the store path and first label Binary coding;
Sending module, for second binary coding to be sent to the terminal.
The device provided in an embodiment of the present invention for reducing application installation package, obtains apply corresponding item file first, so Afterwards using the corresponding mark file of resource file each in preset each tag replacement item file, further according to preset storage road Diameter stores corresponding first binary coding of each resource file, finally in the corresponding compiling file of item file, benefit Corresponding first binary coding of each resource file is replaced with the binary coding of store path, generates and applies corresponding installation kit File.Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset The binary coding of store path replaces corresponding first binary coding of each resource file, generates the corresponding installation kit text of application Part saves the stream expended in application installation package the space occupied and downloading process to reduce the size of application installation package Amount, improves the speed of download of application installation package and the utilization rate of application, improves user experience.
In order to achieve the above object, third aspect present invention embodiment proposes a kind of electronic equipment, comprising: processor, storage Device and communication component;
The memory is for storing executable program code;
The communication component applies corresponding item file for being communicated with other electronic equipments, to obtain;
The processor is run by reading the executable program code stored in the memory can be performed with described The corresponding program of program code, with for executing following steps: using respectively being provided in item file described in preset each tag replacement The corresponding mark file of source file, wherein different labels corresponds to different resource files;It, will according to preset store path Corresponding first binary coding of each resource file is stored;In the corresponding compiling file of the item file, benefit Corresponding first binary coding of each resource file is replaced with the binary coding of the store path, generates the application Corresponding installation package file.
Electronic equipment provided by the embodiments of the present application obtains apply corresponding item file first, then using preset The corresponding mark file of each resource file in each tag replacement item file, further according to preset store path, by each resource text Corresponding first binary coding of part is stored, and finally in the corresponding compiling file of item file, utilizes store path Binary coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file.It is real as a result, Show using the corresponding mark file of resource file each in tag replacement application installation package, and has utilized the two of preset store path Scale coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, to reduce The size of application installation package, saves the flow expended in application installation package the space occupied and downloading process, improves and answer With the speed of download of installation kit and the utilization rate of application, user experience is improved.
In order to achieve the above object, fourth aspect present invention embodiment proposes a kind of storage medium, wherein the storage medium is used In storage application program, the application program for executing reduction application described in first aspect present invention embodiment at runtime The method of installation kit.
Storage medium provided in an embodiment of the present invention obtains apply corresponding item file first, then using preset The corresponding mark file of each resource file in each tag replacement item file, further according to preset store path, by each resource text Corresponding first binary coding of part is stored, and finally in the corresponding compiling file of item file, utilizes store path Binary coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file.It is real as a result, Show using the corresponding mark file of resource file each in tag replacement application installation package, and has utilized the two of preset store path Scale coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, to reduce The size of application installation package, saves the flow expended in application installation package the space occupied and downloading process, improves and answer With the speed of download of installation kit and the utilization rate of application, user experience is improved.
In order to achieve the above object, fifth aspect present invention embodiment proposes a kind of application program, wherein the application program Method for executing reduction application installation package described in first aspect present invention embodiment at runtime.
Application program provided in an embodiment of the present invention obtains apply corresponding item file first, then using preset The corresponding mark file of each resource file in each tag replacement item file, further according to preset store path, by each resource text Corresponding first binary coding of part is stored, and finally in the corresponding compiling file of item file, utilizes store path Binary coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file.It is real as a result, Show using the corresponding mark file of resource file each in tag replacement application installation package, and has utilized the two of preset store path Scale coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, to reduce The size of application installation package, saves the flow expended in application installation package the space occupied and downloading process, improves and answer With the speed of download of installation kit and the utilization rate of application, user experience is improved.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is the flow chart of the method for the reduction application installation package of one embodiment of the invention;
Fig. 2 is the flow chart of the method for the reduction application installation package of another embodiment of the present invention;
Fig. 3 is the structure chart of the device of the reduction application installation package of one embodiment of the invention;
Fig. 4 is the structure chart of the device of the reduction application installation package of another embodiment of the present invention;
Fig. 5 is the structure chart of the electronic equipment of one embodiment of the invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, and for explaining only the invention, and is not considered as limiting the invention.On the contrary, this The embodiment of invention includes all changes fallen within the scope of the spiritual and intension of attached claims, modification and is equal Object.
When various embodiments of the present invention are too big mainly for application installation package, the flow that downloading process expends is high, downloading process Slowly, the problem of low efficiency causes user to be unwilling to download, reduces the utilization rate of application proposes a kind of using tag replacement The corresponding mark file of each resource file in application installation package, by corresponding first binary coding of each resource file from application It is removed in installation kit, and is stored in preset position, the method to reduce application installation package.
Below with reference to the accompanying drawings the method, apparatus and electronic equipment of the reduction application installation package of the embodiment of the present invention are described.
Fig. 1 is the flow chart of the method for the reduction application installation package of one embodiment of the invention.
As shown in Figure 1, the method for the reduction application installation package includes:
Step 101, it obtains and applies corresponding item file.
Specifically, the method provided in an embodiment of the present invention for reducing application installation package, can be provided by the embodiment of the present invention Reduction application installation package device execute.
Wherein, collecting for the file formed in application development process specifically, can be using corresponding item file Development and application are formed by file in development environment (Integrated Development Environment, abbreviation IDE).
Step 102, the corresponding mark file of resource file each in preset each tag replacement item file is utilized, wherein Different labels corresponds to different resource files.
Wherein, resource file may include button, menu, picture, layout isometric drawing (View) file.Each resource file pair The mark file answered, for uniquely determining some resource file, for example, mark file in may include resource file color, The attribute informations such as shape, size.
It should be noted that being used to replace the label of the corresponding mark file of each resource file, it can be and generate in advance, It is also possible in replacement process, generates at random, the type of label can be arbitrarily arranged, and only need to uniquely characterize resource file i.e. Can, for example in Java, different mark files can be replaced with different Tag, the present embodiment is not construed as limiting this.
Step 103, according to preset store path, corresponding first binary coding of each resource file is stored.
Wherein, store path can according to need and be configured.Specifically, can be set to certain in remote server One position is also possible to built-in security digital card (Secure Digital the Memory Card, abbreviation SD of network server Card) in a certain position, herein with no restriction.
Specifically, due to application corresponding item file be to be write using high-level language programs, be not computer or Therefore the machine language that other electronic equipments of person can identify in the present embodiment, after obtaining item file, first has to item Mesh file is compiled, and obtains the corresponding binary coding of item file, and during installation in order to application, installation equipment can root Application is installed according to binary coding.Therefore, in the embodiment of the present application, item file can be compiled, is obtained Compiling file corresponding with item file, then the first binary coding corresponding with each resource file is extracted from compiling file, To which corresponding first binary coding of each resource file is stored in preset store path.
When specific implementation, store path can be preset, then obtain each resource file the corresponding 1st into It after system coding, can be ordered by such as adb etc., by binary coding storage into preset store path.
It should be noted that the corresponding mark of resource file each in preset each tag replacement item file can utilized After file, then item file is compiled, correspondingly, replaced each label becomes binary coded form;Alternatively, can also Before using the corresponding mark file of resource file each in preset each tag replacement item file, item file to be compiled It translates, correspondingly, can use pre- when mark file corresponding using resource file each in preset each tag replacement item file If each label corresponding binary coding replacement item file in the corresponding mark file of each resource file binary coding.
Step 104, in the corresponding compiling file of item file, each resource is replaced using the binary coding of store path Corresponding first binary coding of file generates and applies corresponding installation package file.
Specifically, after corresponding first binary coding of each resource file is stored in preset store path Using the binary coding of the store path, replace in the corresponding compiling file of item file, each resource file corresponding first Binary coding generates and applies corresponding installation package file.
In specific implementation, since the first binary coding is for compiling file, belong to hidden file, thus its When being loaded, need, by calling the addAssetPath method in AssetManager, can just be loaded into and deposit by reflection Storage the first binary coding, due to addAssetPath be hide api we can not call directly, so can only be by anti- It penetrates.So in the embodiment of the present application, using the binary coding of store path replace each resource file the corresponding 1st into It can also include: to determine routing head by reflecting before system coding.
Correspondingly, replacing corresponding first binary coding of each resource file, tool using the binary coding of store path Body may include:
Utilize the binary coding of routing head and the binary coding replacement resource file the corresponding 1st of store path Scale coding.
It is understood that passing through the attribute of the accessible Java object of reflection mechanism, method, construction side in Java Method etc. can use reflection mechanism in the embodiment of the present application, obtain the routing head of above-mentioned store path.After obtaining routing head, Routing head can be increased on above-mentioned store path, to be compiled using the binary system of the binary coding of routing head and store path Code, corresponding first binary coding of replacement resource file.
When specific implementation, in order to reduce money shared by the binary coding of routing head and the binary coding of store path Source can also generate text file (cookie) according to routing head and store path, recycle the binary coding of text file Corresponding first binary coding of replacement resource file.
The method provided in an embodiment of the present invention for reducing application installation package, obtains apply corresponding item file first, so Afterwards using the corresponding mark file of resource file each in preset each tag replacement item file, further according to preset storage road Diameter stores corresponding first binary coding of each resource file, finally in the corresponding compiling file of item file, benefit Corresponding first binary coding of each resource file is replaced with the binary coding of store path, generates and applies corresponding installation kit File.Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset The binary coding of store path replaces corresponding first binary coding of each resource file, generates the corresponding installation kit text of application Part saves the stream expended in application installation package the space occupied and downloading process to reduce the size of application installation package Amount, improves the speed of download of application installation package and the utilization rate of application, improves user experience.
It is found that it can be by utilizing the corresponding mark of resource file each in tag replacement application installation package by above-mentioned analysis File, and corresponding first binary coding of each resource file is replaced using the binary coding of preset store path, it generates Using corresponding installation package file.In practical applications, after user downloads the corresponding installation kit of application, it is also necessary to which acquisition is replaced Resource file could complete the installation of application, below with reference to Fig. 2, to the method provided by the present application for reducing application installation package into Row further illustrates.
Fig. 2 is the flow chart of the method for the reduction application installation package of another embodiment of the present invention.
As shown in Fig. 2, the method for the reduction application installation package, comprising:
Step 201, it obtains and applies corresponding item file.
Step 202, the corresponding mark file of resource file each in preset each tag replacement item file is utilized, wherein Different labels corresponds to different resource files.
Step 203, according to preset store path, corresponding first binary coding of each resource file is stored.
Step 204, in the corresponding compiling file of item file, each resource is replaced using the binary coding of store path Corresponding first binary coding of file generates and applies corresponding installation package file.
Wherein, the specific implementation process and principle of above-mentioned steps 201- step 204, is referred to step in above-described embodiment The detailed description of 101- step 104, details are not described herein again.
Step 205, the resource file acquisition request that terminal is sent is received, includes the first label and storage road in acquisition request Diameter.
Wherein, the first label and store path for including in acquisition request can be binary coded form or other shapes Formula, herein with no restriction.
Step 206, the second binary coding of resource file corresponding with store path and the first label is obtained.
It is understood that according to above-mentioned steps generate using corresponding installation package file, be utilized respectively each label and The binary coding of store path be substituted the corresponding mark file of each resource file and each resource file the corresponding 1st into System coding, and this is being installed in application, certain resource files being replaced may be may require that using application installation package, then, In In the embodiment of the present application, when needing certain resource files being replaced, can apply to reducing using the terminal of installation Bag apparatus is installed and sends resource file acquisition request.
Wherein, include in acquisition request the required resource file of installation application the first label and it is required be stored in it is pre- If the store path of the resource file of storage location.
When specific implementation, after obtaining the first label and store path, it can obtain this by accessing the store path and deposit The corresponding each binary coding of each resource file under path is stored up, and by the first label, obtains the corresponding money of the first label Second binary coding of source file.
Step 207, the second binary coding is sent to terminal.
Specifically, after obtaining the second binary coding of resource file corresponding with store path and the first label, i.e., Second binary coding can be sent to terminal, so that terminal passes through the second binary coding of operation, to obtain corresponding money Source file completes application installation.
As an example it is assumed that the binary coding of the cookie generated using store path, it is corresponding to replace each resource file The first binary coding, generate apply corresponding installation package file, then using the application installation package install in application, according to The binary coding of cookie, by using the openXmlResourceParser of the XML parser Assent of Android, i.e., Each binary coding stored in store path can be parsed, corresponding resource file is obtained, then according to the first label, acquisition pair The child resource file answered, thus the installation applied using each resource file.
The method provided in an embodiment of the present invention for reducing application installation package, by using in tag replacement application installation package The corresponding mark file of each resource file, and to replace each resource file corresponding using the binary coding of preset store path First binary coding, after generating the corresponding installation package file of application, if receiving the resource file acquisition request of terminal transmission, The second binary coding corresponding with store path and the first label is then obtained, and the second binary coding is sent to terminal. Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset storage The binary coding in path replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, And after the resource file acquisition request for receiving terminal transmission, resource file is obtained, the size of application installation package is reduced, saved The flow expended in application installation package the space occupied and downloading process has been saved, the speed of download of application installation package is improved and has been answered Utilization rate improves user experience.
Fig. 3 is the structure chart of the device of the reduction application installation package of one embodiment of the invention.
As shown in figure 3, the device of the reduction application installation package, comprising:
First obtains module 301, applies corresponding item file for obtaining;
First processing module 302, for utilizing the corresponding mark of resource file each in preset each tag replacement item file Know file, wherein different labels corresponds to different resource files;
Memory module 303, for according to preset store path, by corresponding first binary coding of each resource file into Row storage;
Second processing module 304, for being compiled using the binary system of store path in the corresponding compiling file of item file Code replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file.
It should be noted that the above-mentioned explanation to the embodiment of the method shown in FIG. 1 for reducing application installation package, is also applied for The device provided in this embodiment for reducing application installation package, details are not described herein again.
The present embodiment provides the devices for reducing application installation package, obtain apply corresponding item file first, then utilize The corresponding mark file of each resource file will be each further according to preset store path in preset each tag replacement item file Corresponding first binary coding of resource file is stored, and finally in the corresponding compiling file of item file, utilizes storage The binary coding in path replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file. Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset storage The binary coding in path replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, To reduce the size of application installation package, the flow expended in application installation package the space occupied and downloading process is saved, The speed of download of application installation package and the utilization rate of application are improved, user experience is improved.
Fig. 4 is the structure chart of the device of the reduction application installation package of another embodiment of the present invention.
As shown in figure 4, on the basis of shown in Fig. 3, the device of the reduction application installation package, further includes:
Determining module 305, for determining routing head by reflecting.
Correspondingly, Second processing module 304, comprising:
Processing unit, the binary coding replacement resource file for binary coding and store path using routing head Corresponding first binary coding.
Further, above-mentioned processing unit, is specifically used for:
According to routing head and store path, text file is generated;
Utilize corresponding first binary coding of binary coding replacement resource file of text file.
In a kind of possible way of realization of the present embodiment, the device of the reduction application installation package, further includes:
Third processing module 306 obtains compiling text corresponding with item file for item file to be compiled processing Part;
Extraction module 307, for extracting the first binary coding corresponding with each resource file from compiling file.
Receiving module 308 includes first in the acquisition request for receiving the resource file acquisition request of terminal transmission Label and store path;
Second obtains module 309, for obtain the 2nd 2 of resource file corresponding with store path and the first label into System coding;
Sending module 310, for the second binary coding to be sent to terminal.
It should be noted that it is above-mentioned to Fig. 1 and it is shown in Fig. 2 reduce application installation package embodiment of the method explanation, Suitable for the device provided in this embodiment for reducing application installation package, details are not described herein again.
The device provided in an embodiment of the present invention for reducing application installation package, by using in tag replacement application installation package The corresponding mark file of each resource file, and to replace each resource file corresponding using the binary coding of preset store path First binary coding, after generating the corresponding installation package file of application, if receiving the resource file acquisition request of terminal transmission, The second binary coding corresponding with store path and the first label is then obtained, and the second binary coding is sent to terminal. Hereby it is achieved that using the corresponding mark file of resource file each in tag replacement application installation package, and utilize preset storage The binary coding in path replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, And after the resource file acquisition request for receiving terminal transmission, resource file is obtained, the size of application installation package is reduced, saved The flow expended in application installation package the space occupied and downloading process has been saved, the speed of download of application installation package is improved and has been answered Utilization rate improves user experience.
Fig. 5 is the structural schematic diagram of the electronic equipment of the application one embodiment.Wherein, there are many type of electronic equipment, For example can be computer, server etc., the present embodiment is not construed as limiting this.
As shown in figure 5, the electronic equipment 50, comprising: processor 501, memory 502 and communication component 503;
The memory 502 is for storing executable program code;
The communication component 503 applies corresponding item file for being communicated with other electronic equipments, to obtain;
The processor 501 run by reading the executable program code stored in the memory 502 with it is described The corresponding program of executable program code, for executing following steps:
Utilize the corresponding mark file of resource file each in item file described in preset each tag replacement, wherein different Label correspond to different resource files;
According to preset store path, corresponding first binary coding of each resource file is stored;
In the corresponding compiling file of the item file, replaced using the binary coding of the store path described each Corresponding first binary coding of resource file generates the corresponding installation package file of the application.
It should be noted that it is aforementioned to Fig. 1 and it is shown in Fig. 2 reduce application installation package embodiment of the method explanation It is also applied for the electronic equipment of the embodiment, realization principle is similar, and details are not described herein again.
The electronic equipment of the embodiment of the present application obtains apply corresponding item file first, then utilizes preset each mark The corresponding mark file of each resource file in label replacement item file, further according to preset store path, by each resource file pair The first binary coding answered is stored, finally in the corresponding compiling file of item file, using store path two into System coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file.Hereby it is achieved that Using the corresponding mark file of resource file each in tag replacement application installation package, and utilize the binary system of preset store path Coding replaces corresponding first binary coding of each resource file, generates and applies corresponding installation package file, answers to reduce With the size of installation kit, the flow expended in application installation package the space occupied and downloading process is saved, is improved using peace The speed of download of packet and the utilization rate of application are filled, user experience is improved.
The method of the reduction application installation package provided based on the above embodiment, the embodiment of the present application provide a kind of storage Jie again Matter, for example can be read-only memory, disk or CD etc..
Wherein, for the storage medium for storing application program, the application program is real for executing the present invention at runtime The method for applying reduction application installation package described in example.
Further, the embodiment of the present application also provides a kind of application program, wherein the application program is at runtime The method for executing reduction application installation package described in the embodiment of the present invention.
Specifically, the application program in the embodiment of the present application, can be realized using any language, as long as being able to achieve the application The method for the reduction application installation package that embodiment provides.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention Type.

Claims (11)

1. a kind of method for reducing application installation package, which comprises the following steps:
It obtains and applies corresponding item file, wherein the item file is the file formed in the application development process;
Utilize the corresponding mark file of resource file each in item file described in preset each tag replacement, wherein the resource File includes view file, and the mark file, for uniquely determining corresponding resource file, different labels corresponds to different Resource file;
According to preset store path, corresponding first binary coding of each resource file is stored;
In the corresponding compiling file of the item file, each resource is replaced using the binary coding of the store path Corresponding first binary coding of file generates the corresponding installation package file of the application.
2. the method as described in claim 1, which is characterized in that the binary coding using the store path replaces institute Before stating corresponding first binary coding of each resource file, further includes:
Routing head is determined by reflecting;
The binary coding using the store path replaces corresponding first binary coding of each resource file, packet It includes:
It is corresponding that the resource file is replaced using the binary coding of the routing head and the binary coding of the store path The first binary coding.
3. method according to claim 2, which is characterized in that the binary coding using the routing head and described deposit The binary coding for storing up path replaces corresponding first binary coding of the resource file, comprising:
According to the routing head and the store path, text file is generated;
Corresponding first binary coding of the resource file is replaced using the binary coding of the text file.
4. method a method according to any one of claims 1-3, which is characterized in that it is described according to preset store path, it will be described each Before corresponding first binary coding of resource file is stored, further includes:
The item file is compiled processing, obtains compiling file corresponding with the item file;
The first binary coding corresponding with each resource file is extracted from the compiling file.
5. method a method according to any one of claims 1-3, which is characterized in that described to generate the corresponding installation package file of the application Later, further includes:
The resource file acquisition request that terminal is sent is received, includes the first label and store path in the acquisition request;
Obtain the second binary coding of resource file corresponding with the store path and first label;
Second binary coding is sent to the terminal.
6. a kind of device for reducing application installation package characterized by comprising
First obtains module, applies corresponding item file for obtaining, wherein the item file is the application and development The file formed in journey;
First processing module, for utilizing the corresponding mark text of resource file each in item file described in preset each tag replacement Part, wherein the resource file includes view file, the mark file, different for uniquely determining corresponding resource file Label correspond to different resource files;
Memory module will the corresponding first binary coding progress of each resource file for according to preset store path Storage;
Second processing module, for utilizing the binary system of the store path in the corresponding compiling file of the item file Coding replaces corresponding first binary coding of each resource file, generates the corresponding installation package file of the application.
7. device as claimed in claim 6, which is characterized in that further include:
Determining module, for determining routing head by reflecting;
The Second processing module, comprising:
Processing unit, for utilizing described in the binary coding of the routing head and the binary coding replacement of the store path Corresponding first binary coding of resource file.
8. device as claimed in claim 7, which is characterized in that the processing unit is specifically used for:
According to the routing head and the store path, text file is generated;
Corresponding first binary coding of the resource file is replaced using the binary coding of the text file.
9. such as device as claimed in claim 6 to 8, which is characterized in that further include:
Third processing module obtains compiling corresponding with the item file for the item file to be compiled processing File;
Extraction module, for extracting the first binary coding corresponding with each resource file from the compiling file.
10. such as device as claimed in claim 6 to 8, which is characterized in that further include:
Receiving module, include for receiving the resource file acquisition request of terminal transmission, in the acquisition request the first label and Store path;
Second obtains module, for obtain the 2nd 2 of resource file corresponding with the store path and first label into System coding;
Sending module, for second binary coding to be sent to the terminal.
11. a kind of electronic equipment characterized by comprising processor, memory and communication component;
The memory is for storing executable program code;
The communication component applies corresponding item file for being communicated with other electronic equipments, to obtain, wherein described Item file is the file formed in the application development process;
The processor is run and the executable program by reading the executable program code stored in the memory The corresponding program of code, for executing following steps:
Utilize the corresponding mark file of resource file each in item file described in preset each tag replacement, wherein the resource File includes view file, and the mark file, for uniquely determining corresponding resource file, different labels corresponds to different Resource file;
According to preset store path, corresponding first binary coding of each resource file is stored;
In the corresponding compiling file of the item file, each resource is replaced using the binary coding of the store path Corresponding first binary coding of file generates the corresponding installation package file of the application.
CN201710087221.0A 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment Active CN106681788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710087221.0A CN106681788B (en) 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710087221.0A CN106681788B (en) 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment

Publications (2)

Publication Number Publication Date
CN106681788A CN106681788A (en) 2017-05-17
CN106681788B true CN106681788B (en) 2019-10-29

Family

ID=58860953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710087221.0A Active CN106681788B (en) 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment

Country Status (1)

Country Link
CN (1) CN106681788B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958826B (en) * 2017-05-22 2022-06-07 北京京东尚科信息技术有限公司 Method and device for dynamically configuring application installation package
CN109598121B (en) * 2018-12-11 2021-02-12 深圳市网心科技有限公司 Application ID generation method, system, computer device and storage medium
CN111008178B (en) * 2019-11-05 2024-04-30 北京字节跳动网络技术有限公司 Data processing method, device, electronic equipment and computer readable storage medium
WO2021248337A1 (en) * 2020-06-09 2021-12-16 深圳市欢太科技有限公司 Application installation method and apparatus, and device and computer-readable storage medium
CN112632425B (en) * 2020-12-10 2024-02-06 京东科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN117149160B (en) * 2023-08-23 2024-04-02 浙江十勇士网络科技有限公司 Mobile phone game resource packaging method, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462393A (en) * 2014-12-10 2015-03-25 北京国双科技有限公司 Method and device for determining paths for compiling files
CN104765618A (en) * 2015-05-06 2015-07-08 山东中孚信息产业股份有限公司 Manufacturing method and decompression installation method of Linux system self-decompression installation packet
CN105204823A (en) * 2014-05-29 2015-12-30 腾讯科技(深圳)有限公司 Method and device for generating application installation package

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120284696A1 (en) * 2009-12-21 2012-11-08 Nokia Corporation Method, Apparatuses and a System for Compilation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204823A (en) * 2014-05-29 2015-12-30 腾讯科技(深圳)有限公司 Method and device for generating application installation package
CN104462393A (en) * 2014-12-10 2015-03-25 北京国双科技有限公司 Method and device for determining paths for compiling files
CN104765618A (en) * 2015-05-06 2015-07-08 山东中孚信息产业股份有限公司 Manufacturing method and decompression installation method of Linux system self-decompression installation packet

Also Published As

Publication number Publication date
CN106681788A (en) 2017-05-17

Similar Documents

Publication Publication Date Title
CN106681788B (en) Method and device for reducing application installation packages and electronic equipment
KR101523179B1 (en) Method and apparatus for sensory tags providing sound, smell, and haptic feedback
CN106569869B (en) Plug-in unit packaging method and device
CN105893094B (en) The implementation method and device of application plug
CN107133052B (en) Flow creation method and device
CN108345511B (en) Application data checking method and device and electronic equipment
CN103716358B (en) A kind of custom application method for down loading and device
CN108874464B (en) Automatic scanning assembly method and device for middleware and storage medium
CN104395882A (en) Creation and context-aware presentation of customized emoticon item sets
CN110599183B (en) Intelligent contract calling method and device and storage medium
CN108282518A (en) A kind of customer terminal webpage generation method and device
CN104899025A (en) Method and device for generating channel package
CN111930382B (en) Application page access method, device and equipment
CN104731869B (en) The page shows method and device
CN109947643B (en) A/B test-based experimental scheme configuration method, device and equipment
CN102622237B (en) A kind of collocation method of business function procedure and system
CN110704064A (en) Method and device for compiling and executing intelligent contract
CN106796521B (en) API version control independent of product release
CN111399840A (en) Module development method and device
CN108170430A (en) A kind of method and system of showing interface
CN105468350B (en) The processing method and processing device of object tag
CN103686821A (en) Control method for application program traffic statistics according to unique identification of mobile terminal
CN106598662B (en) Android-based application loading method and device
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN110020370B (en) Method and device for realizing animation in client application and framework of animation script

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