CN106775781B - 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
CN106775781B
CN106775781B CN201710087493.0A CN201710087493A CN106775781B CN 106775781 B CN106775781 B CN 106775781B CN 201710087493 A CN201710087493 A CN 201710087493A CN 106775781 B CN106775781 B CN 106775781B
Authority
CN
China
Prior art keywords
file
application
program
new
class
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
CN201710087493.0A
Other languages
Chinese (zh)
Other versions
CN106775781A (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 CN201710087493.0A priority Critical patent/CN106775781B/en
Publication of CN106775781A publication Critical patent/CN106775781A/en
Application granted granted Critical
Publication of CN106775781B publication Critical patent/CN106775781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (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: creating a class file corresponding to the application by using a script language; presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.

Description

Method and device for reducing application installation packages and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for reducing an application installation package and electronic equipment.
Background
With the development of network and computer technologies, a wide variety of applications are widely used in various mobile terminals, and gradually become an indispensable part of people's daily life.
The application installation package is used as an application carrier, wherein all files of the application are installed, and the operation of the installation package can release all files of the application to a hard disk to complete the work of modifying a registry, modifying system settings, creating shortcuts and the like. If the application installation package is too large, the flow consumed in the downloading process is high, the downloading process is slow, the efficiency is low, the user is unwilling to download, and the application utilization rate is reduced. Therefore, how to reduce the size of the application installation package becomes a vital task in application development.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present invention is to provide a method for reducing an application installation package, which achieves that the contents of all program files after a project is completed are placed in a class file, and the class file only includes a packet header, thereby reducing the size of the application installation package, saving the space occupied by the application installation package and the flow consumed in the downloading process, improving the downloading speed of the application installation package and the utilization rate of the application, and improving the user experience.
A second object of the present invention is to provide an apparatus for reducing application installation packages.
A third object of the invention is to propose an electronic device.
A fourth object of the invention is to propose a storage medium.
A fifth object of the invention is to propose an application.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for reducing an application installation package, including: creating a class file corresponding to the application by using a script language; presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and copying each new import parameter and the function code in each program file into the class file to generate a new project file corresponding to the application.
In a possible implementation form of the first aspect, the creating a class file corresponding to an application using a scripting language includes:
and creating a class file corresponding to the application by using Python language.
In another possible implementation form of the first aspect, the presetting, in the project file corresponding to the application, each original import parameter in each program file includes:
and respectively adding the class file identification to the project file corresponding to the application in a parent class mode, and each original import parameter in each program file.
In another possible implementation form of the first aspect, after copying the new import parameters and the function codes in the program files into the class file, the method further includes:
judging whether each new import parameter has redundancy;
and if so, deleting the redundancy import parameter.
In another possible implementation form of the first aspect, after the generating a new project file corresponding to the application, the method further includes:
and compiling the new project file to generate an installation package file corresponding to the application.
The method for reducing the application installation package provided by the embodiment of the invention comprises the steps of firstly, creating a class file corresponding to an application by utilizing a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
In order to achieve the above object, a second embodiment of the present invention provides an apparatus for reducing an application installation package, including: the creating module is used for creating a class file corresponding to the application by using the scripting language; the first processing module is used for presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and the second processing module is used for copying each new import parameter and the function code in each program file into the class file to generate a new project file corresponding to the application.
In a possible implementation form of the second aspect, the creating module is specifically configured to:
and creating a class file corresponding to the application by using Python language.
In another possible implementation form of the second aspect, the first processing module is specifically configured to:
and respectively adding the class file identification to the project file corresponding to the application in a parent class mode, and each original import parameter in each program file.
In another possible implementation form of the second aspect, the apparatus for reducing an application installation package further includes:
the judging module is used for judging whether each new import parameter has redundancy;
and the deleting module is used for deleting the redundant import parameters when the new import parameters have redundancy.
In another possible implementation form of the second aspect, the apparatus for reducing an application installation package further includes:
and the third processing module is used for compiling the new project file to generate an installation package file corresponding to the application.
The device for reducing the application installation package provided by the embodiment of the invention firstly utilizes a script language to create a class file corresponding to an application; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
To achieve the above object, a third aspect of the present invention provides an electronic device, including: a processor, a memory, and a communication component;
the memory is used for storing executable program codes;
the communication component is used for communicating with other electronic equipment to acquire project files corresponding to the applications;
the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing the steps of:
creating a class file corresponding to the application by using a script language;
presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file;
and copying each new import parameter and the function code in each program file into the class file to generate a new project file corresponding to the application.
The electronic equipment provided by the embodiment of the application firstly creates a class file corresponding to the application by using a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
To achieve the above object, a fourth aspect of the present invention provides a storage medium, where the storage medium is used to store an application program, and the application program is used to execute, at runtime, the method for reducing an application installation package according to the embodiment of the present invention.
In order to achieve the above object, a fifth aspect of the present invention provides an application program, where the application program is configured to execute, at runtime, the method for reducing an application installation package according to the embodiment of the present invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of a method of reducing application installation packages, in accordance with one embodiment of the present invention;
FIG. 2 is a flow diagram of a method of reducing application installation packages according to another embodiment of the invention;
FIG. 3 is a block diagram of an apparatus for reducing application installation packages, in accordance with one embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for reducing application installation packages in accordance with another embodiment of the present invention;
fig. 5 is a block diagram of an electronic device of an embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. On the contrary, the embodiments of the invention include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
The embodiments of the present invention mainly solve the problems that when the application installation package is too large, the downloading process consumes high flow, the downloading process is slow, the efficiency is low, and the user is unwilling to download, and the application utilization rate is reduced, and provide a method for placing the contents of all program files after the project is completed into one class file to reduce redundant codes, and further reduce the application installation package.
The following describes a method, an apparatus and an electronic device for reducing an application installation package according to an embodiment of the present invention with reference to the drawings.
FIG. 1 is a flow diagram of a method of reducing application installation packages, in accordance with one embodiment of the present invention.
As shown in fig. 1, the method for reducing the application installation package includes:
step 101, creating a class file corresponding to the application by using a script language.
Specifically, the method for reducing the application installation package provided by the embodiment of the present invention may be executed by the apparatus for reducing the application installation package provided by the embodiment of the present invention.
The scripting language is a language between HTML and programming languages such as C, C + +, Java, C #, and the like, and specifically may include JavaScript, VBScript, Python, and the like.
In a specific implementation, for example, Python may be used to create a class file corresponding to an application, where a header of the class file is an identifier or a name of the application, and is used to identify the class file as a file corresponding to the application.
And 102, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file.
And 103, copying the new import parameters and the function codes in the program files into the class file to generate a new project file corresponding to the application.
The project file corresponding to the application is a file formed in the application Development process, and specifically may be a file formed by developing the application in an Integrated Development Environment (IDE). Stored in each program file is program code written using a certain programming language.
It can be understood that, in order to distinguish from program files corresponding to other applications, in the project file corresponding to an application, the header file in each program file includes an identifier corresponding to the application, which is used to uniquely determine the program file corresponding to the application being developed.
In addition, in actual development, since it is necessary to lead in a certain class or interface before using the class, each program file may further include an import parameter (import), for example, import in a Java program, by "import package a.abc"; ", all classes under sub-packet abc in the packa packet can be imported.
In specific implementation, after traversing each program file included in the project file corresponding to the application in sequence, the contents of the application identifier, the import parameter, the function code, and the like of each program file can be obtained.
For example, assuming that application development is performed using the Java programming language, each program file is a Java file with suffix of Java. By traversing the Java file, the contents of the application identifier, import, and function code included in the Java file can be obtained.
In concrete implementation, after the content of each program file is acquired, the content can be copied to the class file created in step 101, and a new project file corresponding to the application is generated.
It should be noted that, since the class file corresponding to the application created in the scripting language in step 101 includes the identifier corresponding to the application, when copying the content in each program file, there is no need to copy the identifier corresponding to the application, that is, there is no need to copy the header portion in each program file, so that only one header is included in the project file corresponding to the application, and the size of the project file is reduced.
In addition, when the content in each program file is copied to the class file created in step 101, since the class to which the original import parameter in each program file is imported is changed, in this embodiment of the present application, the original import parameter in each program file may be subjected to preset processing to obtain new import parameters corresponding to each program file. The specific process can comprise the following steps:
and respectively adding the class file identification to the project file corresponding to the application in a parent class mode, and each original import parameter in each program file.
The class file identifier is used to represent the created class file, and specifically, the naming rule of the class file identifier may be set according to the used programming language.
For example, suppose the class file identifier is X, and the original import parameter of a program file is "import aa.bb; ", where aa is the package name and BB is the class name, through" import aa.BB; if BB class in aa package can be imported, in this embodiment, when the original import parameter is preset, the class file identifier X may be added to the original import parameter in the form of parent class, so as to obtain a new import parameter "import aa.x.bb".
And copying each new import parameter and the function code in each program file into the created class file to generate a new project file corresponding to the application.
It is to be noted that, because the generated new project file corresponding to the application is written by using a high-level language program and is not a machine language that can be recognized by a computer or other electronic devices, in this embodiment, after the new project file corresponding to the application is generated, the new project file needs to be compiled to obtain a binary code corresponding to the new project file, that is, an installation package file corresponding to the application, so that when the application is installed, the installation device can install the application according to the binary code.
The method for reducing the application installation package provided by the embodiment of the invention comprises the steps of firstly, creating a class file corresponding to an application by utilizing a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
Through the analysis, after the project development is completed, after the identification of the class file is added to the import parameter included in each program file in the project file, the new import parameter and the function code are copied into a unified class file, so that the size of the project file is reduced. In practical applications, redundancy may exist in the new import parameters of each program file, which is described in detail below with reference to fig. 2.
FIG. 2 is a flow diagram of a method of reducing application installation packages in accordance with another embodiment of the present invention.
As shown in fig. 2, the method for reducing application installation packages includes:
step 201, creating a class file corresponding to the application by using Python language.
Step 202, adding the class file identifier to the project file corresponding to the application in a parent class form, and adding each original import parameter in each program file.
Step 203, copying the new import parameters and the function codes in the program files into the class files.
The detailed implementation process and principle of steps 201 to 203 may refer to the detailed description of steps 101 to 103 in the above embodiments, and are not described herein again.
Step 204, determining whether each new import parameter has redundancy, if so, executing step 205, otherwise, executing step 206.
Step 205, deleting the redundancy import parameter.
In specific implementation, if the class of the new import parameter import is repeated, it can be determined that the new import parameter has redundancy, and the redundant import parameter can be deleted.
For example, assuming that the created class file is identified as X, the application corresponding program file includes "import aa"; "and" import aa.bb; "two original import parameters, wherein aa is a package name and BB is a class name, according to the method provided by the present invention, X can be added to each original import parameter in each program file in a parent class form, so as to obtain a new import parameter" import aa.x.; "and" import aa.x.bb; ", due to" import aa.x.; "all classes under X in aa packet are imported," import aa.x.bb; "the imported parameter is a BB subclass under an X parent class in the aa packet, and if two new imported parameters have redundancy," import aa.X.BB; "delete.
Step 206, generating a new project file corresponding to the application.
And step 207, compiling the new project file to generate an installation package file corresponding to the application.
The detailed implementation process and principle of the steps 206 to 207 may refer to the detailed description of the step 103 in the foregoing embodiment, and are not described herein again.
The method for reducing the application installation package provided by the embodiment of the invention comprises the steps of firstly creating a class file corresponding to an application by utilizing a script language, then obtaining each new import parameter of each program file, copying each new import parameter and a function code in each program file into the class file, deleting the redundant import parameter when each new import parameter has redundancy, further generating a new project file corresponding to the application, and finally compiling the new project file to obtain an installation package file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, only one packet header is included in the class file, and the redundant import parameters are deleted, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
FIG. 3 is a block diagram of an apparatus for reducing application installation packages, in accordance with one embodiment of the present invention.
As shown in fig. 3, the apparatus for reducing application installation package includes:
a creating module 301, configured to create a class file corresponding to an application by using a scripting language;
a first processing module 302, configured to perform preset processing on each original import parameter in each program file in the project file corresponding to the application, to obtain each new import parameter corresponding to each program file;
the second processing module 303 is configured to copy the new import parameters and the function codes in the program files into the class file, and generate a new project file corresponding to the application.
Specifically, the creating module 301 is specifically configured to:
and creating a class file corresponding to the application by using Python language.
Further, the first processing module 302 is specifically configured to:
and respectively adding the class file identification to the project file corresponding to the application in a parent class mode, and each original import parameter in each program file.
It should be noted that the above description of the method for reducing the application installation package is also applicable to the apparatus for reducing the application installation package provided in this embodiment, and is not repeated here.
The embodiment provides a device for reducing an application installation package, which comprises the steps of firstly, creating a class file corresponding to an application by utilizing a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
Fig. 4 is a block diagram of an apparatus for reducing an application installation package according to another embodiment of the present invention.
As shown in fig. 4, on the basis of fig. 3, the apparatus for reducing an application installation package further includes:
a judging module 304, configured to judge whether each new import parameter has redundancy;
a deleting module 305, configured to delete the redundant import parameters when the redundancy exists in each new import parameter.
A third processing module 306, configured to compile the new project file, and generate an installation package file corresponding to the application.
It should be noted that the above description of the method for reducing the application installation package is also applicable to the apparatus for reducing the application installation package provided in this embodiment, and is not repeated here.
The embodiment provides a device for reducing an application installation package, which comprises the steps of firstly, creating a class file corresponding to an application by utilizing a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may be of various types, such as a computer, a server, and the like, which is not limited in this embodiment.
As shown in fig. 5, the electronic device 50 includes: a processor 501, a memory 502, and a communication component 503;
the memory 502 is used for storing executable program code;
the communication component 503 is configured to communicate with other electronic devices to obtain a project file corresponding to an application;
the processor 501 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 502, for performing the steps of:
creating a class file corresponding to the application by using a script language;
presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file;
and copying each new import parameter and the function code in each program file into the class file to generate a new project file corresponding to the application.
It should be noted that the foregoing explanation on the embodiment of the method for reducing the application installation package shown in fig. 1 and fig. 2 is also applicable to the electronic device of the embodiment, and the implementation principle is similar, and is not described herein again.
The electronic equipment of the embodiment of the application firstly creates a class file corresponding to the application by using a script language; then, presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file; and finally copying each new import parameter and the function code in each program file into a class file to generate a new project file corresponding to the application. Therefore, the content of all the program files after the project is finished is placed into one class file, and the class file only comprises one packet header, 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 of the application installation package and the application utilization rate are improved, and the user experience is improved.
Based on the method for reducing the application installation package provided by the foregoing embodiment, the embodiment of the present application further provides a storage medium, which may be a read-only memory, a magnetic disk, or an optical disk, for example.
The storage medium is used for storing an application program, and the application program is used for executing the method for reducing the application installation package in the embodiment of the invention when running.
Further, an embodiment of the present application also provides an application program, where the application program is configured to execute the method for reducing an application installation package according to the embodiment of the present invention at runtime.
Specifically, the application program in the embodiment of the present application may be implemented by using any language, as long as the method for reducing the application installation package provided in the embodiment of the present application can be implemented.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (7)

1. A method of reducing application installation packages, comprising the steps of:
creating a class file corresponding to the application by using a scripting language, wherein the class file comprises a packet header;
presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file, wherein class file identifications are added to each original import parameter in each program file in the project file corresponding to the application in a parent class mode;
copying each new import parameter and the function code in each program file, except the packet header corresponding to each program file, in the content included in each program file into the class file;
judging whether each new import parameter has redundancy;
if yes, deleting the redundancy import parameters;
and generating a new project file corresponding to the application, wherein the new project file comprises the packet header.
2. The method of claim 1, wherein creating a class file corresponding to the application using the scripting language comprises:
and creating a class file corresponding to the application by using Python language.
3. The method of any of claims 1-2, wherein after generating the new project file corresponding to the application, further comprising:
and compiling the new project file to generate an installation package file corresponding to the application.
4. An apparatus for reducing application installation packages, comprising:
the creating module is used for creating a class file corresponding to the application by using a scripting language, and the class file comprises a packet header;
the first processing module is used for presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file;
a second processing module, configured to copy, into the class file, each new import parameter and a function code in each program file, in the content included in each program file, except for the packet header corresponding to each program file, and generate a new item file corresponding to the application, where the new item file includes the packet header;
the first processing module is specifically configured to:
respectively adding class file identifications to each original import parameter in each program file in the project file corresponding to the application in a parent class mode;
the device further comprises:
the judging module is used for judging whether each new import parameter has redundancy;
and the deleting module is used for deleting the redundant import parameters when the new import parameters have redundancy.
5. The apparatus of claim 4, wherein the creation module is specifically configured to:
and creating a class file corresponding to the application by using Python language.
6. The apparatus of any of claims 4-5, further comprising:
and the third processing module is used for compiling the new project file to generate an installation package file corresponding to the application.
7. An electronic device, comprising: a processor, a memory, and a communication component;
the memory is used for storing executable program codes;
the communication component is used for communicating with other electronic equipment to acquire project files corresponding to the applications;
the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for performing the steps of:
creating a class file corresponding to the application by using a scripting language, wherein the class file comprises a packet header;
presetting each original import parameter in each program file in the project file corresponding to the application to obtain each new import parameter corresponding to each program file, wherein class file identifications are added to each original import parameter in each program file in the project file corresponding to the application in a parent class mode;
copying each new import parameter and the function code in each program file, except the packet header corresponding to each program file, in the content included in each program file into the class file;
judging whether each new import parameter has redundancy;
if yes, deleting the redundancy import parameters;
and generating a new project file corresponding to the application, wherein the new project file comprises the packet header.
CN201710087493.0A 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment Active CN106775781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710087493.0A CN106775781B (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
CN201710087493.0A CN106775781B (en) 2017-02-17 2017-02-17 Method and device for reducing application installation packages and electronic equipment

Publications (2)

Publication Number Publication Date
CN106775781A CN106775781A (en) 2017-05-31
CN106775781B true CN106775781B (en) 2021-04-27

Family

ID=58958125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710087493.0A Active CN106775781B (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) CN106775781B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119274A (en) * 2018-02-05 2019-08-13 北京智明星通科技股份有限公司 A kind of method, apparatus and electric terminal, computer readable storage medium of data compilation
CN110633083B (en) * 2018-06-22 2024-06-18 北京京东尚科信息技术有限公司 Code file processing method, device, electronic equipment and computer readable medium
CN109522020A (en) * 2018-09-29 2019-03-26 中国平安人寿保险股份有限公司 Android system installation kit method for reducing body weight, device, terminal and storage medium
CN110489162B (en) * 2019-08-02 2023-09-22 北京字节跳动网络技术有限公司 Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
CN110888658B (en) * 2019-12-02 2023-04-21 广州市百果园信息技术有限公司 Method and device for dynamically changing function modules in application program and storage medium

Citations (2)

* 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
CN106325834A (en) * 2015-06-18 2017-01-11 腾讯科技(深圳)有限公司 Android installation package compression method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763269A (en) * 2010-01-27 2010-06-30 中兴通讯股份有限公司 Method for making software installation package
CN103336703B (en) * 2013-07-08 2018-09-18 惠州Tcl移动通信有限公司 The method of generation upgrade package, server, method for upgrading software, mobile terminal
US20150082298A1 (en) * 2013-09-19 2015-03-19 Qiu Shi WANG Packaging and deploying hybrid applications
CN103870303A (en) * 2014-02-10 2014-06-18 广东欧珀移动通信有限公司 Method and device for reducing size of software installation package
US9244665B1 (en) * 2014-07-17 2016-01-26 Google Inc. Optimized execution of dynamic languages
CN105718279B (en) * 2014-12-04 2019-12-03 Tcl集团股份有限公司 Generation method and device based on Firefox OS application
CN104991773B (en) * 2015-06-30 2018-05-08 小米通讯技术有限公司 Program creating method and device
CN105915623A (en) * 2016-05-20 2016-08-31 努比亚技术有限公司 Device and method of processing application installation package
CN106020725B (en) * 2016-05-20 2019-07-12 努比亚技术有限公司 Application file processing unit and method

Patent Citations (2)

* 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
CN106325834A (en) * 2015-06-18 2017-01-11 腾讯科技(深圳)有限公司 Android installation package compression method and device

Also Published As

Publication number Publication date
CN106775781A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106775781B (en) Method and device for reducing application installation packages and electronic equipment
US10114745B2 (en) Assisted garbage collection in a virtual machine
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
US10078497B2 (en) Bridging a module system and a non-module system
CN110032388B (en) Incremental file construction, publishing and downloading method and device
US9626171B2 (en) Composing a module system and a non-module system
CN111399840B (en) Module development method and device
CN111209010A (en) Platform and implementation method thereof
CN110609687A (en) Compiling method, device, electronic equipment and storage medium
CN113312046A (en) Sub-application page processing method and device and computer equipment
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
AU2016378425B2 (en) Application program running method and apparatus
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN114490103A (en) Operating system interface calling method and device and electronic equipment
CN113127000A (en) Compiling method, device and equipment of application program assembly and storage medium
CN110442353B (en) Installation package management method and device and electronic equipment
CN109189591B (en) Method and device for calling application component
CN112527302A (en) Error detection method and device, terminal and storage medium
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN116755788A (en) On-line rule modification method, device, equipment and storage medium
CN106778270B (en) Malicious application detection method and system
CN115760391A (en) Intelligent contract changing method and device in block chain, electronic equipment and storage medium
CN111708519B (en) Service component processing method, device, equipment 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
GR01 Patent grant
GR01 Patent grant