[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112148318B - Application package release method, application method, device, medium, server and equipment - Google Patents

Application package release method, application method, device, medium, server and equipment Download PDF

Info

Publication number
CN112148318B
CN112148318B CN202011085779.3A CN202011085779A CN112148318B CN 112148318 B CN112148318 B CN 112148318B CN 202011085779 A CN202011085779 A CN 202011085779A CN 112148318 B CN112148318 B CN 112148318B
Authority
CN
China
Prior art keywords
file
application
application package
hot spot
publishing
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
CN202011085779.3A
Other languages
Chinese (zh)
Other versions
CN112148318A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011085779.3A priority Critical patent/CN112148318B/en
Publication of CN112148318A publication Critical patent/CN112148318A/en
Priority to PCT/CN2021/113283 priority patent/WO2022078057A1/en
Application granted granted Critical
Publication of CN112148318B publication Critical patent/CN112148318B/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/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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 embodiment of the application provides an application package publishing method, an application package application method, an application package publishing device, an application package application device, a storage medium, a server and electronic equipment, comprising: acquiring a first distribution file of an application package; precompiled the target code segment in the application source code to obtain the corresponding byte code; adding the byte code into the first release file to obtain a second release file; and publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file. In the method for publishing the application package, the target code segments in the application source code are precompiled to form the byte codes, so that when the application package is started each time, the electronic equipment does not need to compile the target code segments in the application source code, the process of analyzing and compiling the byte codes of the target code segments can be omitted, the time consumption of the starting process can be saved, and the starting speed of the application package can be improved.

Description

Application package release method, application method, device, medium, server and equipment
Technical Field
The present invention relates to the field of computer software technologies, and in particular, to a method for publishing an application package, an application method for an application package, a device for publishing an application package, a device for applying an application package, a storage medium, a server, and an electronic device.
Background
In recent years, in the field of computer software, the market of application packages is vigorously developed, and more software platforms supporting the application packages are also provided. Wherein the application packages are also referred to as light applications, applets, etc. The application package usually occupies a small space, is convenient for users to use and runs by means of a software platform.
Each time an application package runs, a series of processes are required to be performed on a start file by an engine, so that the application package is started, which results in a slow start speed of the application package.
Disclosure of Invention
The embodiment of the application provides a release method of an application package, an application method of the application package, a release device of the application package, an application device of the application package, a storage medium, a server and electronic equipment, and can improve the starting speed of the application package.
The embodiment of the application provides a release method of an application package, which comprises the following steps:
acquiring a first distribution file of an application package, wherein the first distribution file comprises application source codes;
Precompiled the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code;
adding the byte code into the first release file to obtain a second release file;
and publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file.
The embodiment of the application also provides an application method of the application package, which comprises the following steps:
acquiring a release file of an application package, wherein the release file comprises application source codes;
installing the release file to an installation directory to form an installation file;
precompiled the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code;
and storing the byte codes into the installation catalog to finish the installation of the application package.
The embodiment of the application also provides a device for publishing the application package, which comprises:
the first acquisition module is used for acquiring a first distribution file of the application package, wherein the first distribution file comprises application source codes;
the first pre-compiling module is used for pre-compiling the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code;
The first processing module is used for adding the byte code into the first release file to obtain a second release file;
and the release module is used for releasing the application package according to the first release file and the second release file or releasing the application package according to the first release file.
The embodiment of the application also provides an application device of the application package, which comprises:
the second acquisition module is used for acquiring a release file of the application package, wherein the release file comprises application source codes;
the installation module is used for installing the release file to an installation directory to form an installation file;
the second pre-compiling module is used for pre-compiling the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code;
and the second processing module is used for storing the byte codes into the installation catalog so as to finish the installation of the application package.
The embodiment of the application also provides a storage medium, in which a computer program is stored, when the computer program runs on a computer, the computer is caused to execute the method for publishing the application package, or the computer is caused to execute the method for applying the application package.
The embodiment of the application also provides a server for executing the release method of the application package.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for executing the application method of the application package by calling the computer program stored in the memory.
In the method for publishing the application package, the target code segments in the application source code of the first publishing file are precompiled to form the byte codes, so that after the electronic device downloads and installs the application package, the electronic device does not need to compile the target code segments in the application source code every time the application package is started, the process of analyzing and compiling the byte codes of the target code segments can be omitted, time consumption in the starting process can be saved, and the starting speed of the application package is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that are required to be used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a first application scenario of an application package provided in an embodiment of the present application.
Fig. 2 is a schematic diagram of a first starting process of an application package according to an embodiment of the present application.
Fig. 3 is a flow chart of a method for publishing an application package according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a second application scenario of an application package according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a second starting process of an application package according to an embodiment of the present application.
Fig. 6 is a flowchart of an application method of an application package according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a third application scenario of an application package according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of an application package publishing device according to an embodiment of the present application.
Fig. 9 is a schematic diagram of a first structure of an application device of an application package according to an embodiment of the present application.
Fig. 10 is a schematic diagram of a second structure of an application device of an application package according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present application based on the embodiments herein.
An electronic device, such as a smart phone, may run various applications, such as an application package. Wherein the application packages are also called fast applications, light applications, applets, etc. The application package usually occupies a small space, is convenient for users to use and runs by means of a software platform.
Referring to fig. 1, fig. 1 is a schematic diagram of a first application scenario of an application package according to an embodiment of the present application.
The application package may be developed by a developer. In the development process of the application package, a developer can write a code file by using a programming language (such as JavaScript and the like), and package the code file and the used resource file together to form a release file. The developer may then publish the application package to the application marketplace for download by the user.
The application market can be used as a platform for a developer to issue application packages and a platform for providing application package downloading services for users. After the developer publishes the application package to the application marketplace, the application marketplace may provide the application package to the user for download. The application market may be implemented by an application program that manages an application package, for example, a software store, an application manager, etc. developed by each manufacturer. It will be appreciated that the application marketplace may run on a server that provides the distribution platform services and download services for application packages.
When the user needs to use the application package, the user can download the application package from the application market of the server, then install the application package on the electronic device, and start the application package to realize the required functions. It will be appreciated that the application package may be run on a user's electronic device, such as a smart phone or the like. It should be noted that, since the application package generally occupies a small space, the downloading process and the installation process of the application package are both fast, for example, the time required for downloading one application package may be less than 1 second, and the time required for installing the application package may be less than 1 second. Thus, the download process and the installation process of the application package may be hidden from the user. For example, when a user needs to use the application package, the user can click on an icon or a link of the application package, the application package is downloaded and installed in the background, the application package is started immediately after the installation is completed, and an interface which is the interface after the application package is started is presented to the user. Thus, for a user, the application package may be embodied as "point-to-use", i.e., may be launched for use immediately after clicking.
Referring to fig. 2 at the same time, fig. 2 is a schematic diagram of a first starting procedure of an application package according to an embodiment of the present application.
After the application package is downloaded and installed, when the electronic device starts the application package, the electronic device needs to sequentially analyze the code files of the application package, compile byte codes, interpret and execute the byte codes, compile machine codes and the like.
It should be noted that, each time the electronic device starts the application package, the above processes need to be repeatedly executed. Wherein the time taken to parse and compile the bytecode is about 30% of the total time required to launch the application package. For example, if it takes 2 seconds to start an application package, it takes about 0.6 seconds to parse and compile the bytecode. It follows that parsing and compiling bytecodes is time consuming in the start-up of an application package.
The embodiment of the application package publishing method can be applied to a server, for example, an application package management server, and the application package publishing method is executed through the server.
Referring to fig. 3, fig. 3 is a first flowchart of a method for publishing an application package according to an embodiment of the present application. The application package publishing method comprises the following steps:
110, a first distribution file of the application package is obtained, wherein the first distribution file comprises application source code.
The server may obtain a first profile of the application package. The first publishing file may be a publishing file provided to an application market after the developer completes development of the application package. It will be appreciated that the first profile may include code files written by the developer and resource files used, which may include, for example, functions that need to be used. Both the code file and the resource file may be presented as code, i.e. application source code corresponding to an application package.
And 120, precompiled the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code.
After the server obtains the first distribution file, the target code segment in the application source code can be precompiled to obtain the byte code corresponding to the target code segment in the application source code. The object code segment may include a code that needs to be executed when the application package is started, and may also include a code that needs to be executed in a running process after the application package is started. Precompiled may include both parsing and compiling bytecodes, i.e., the target code segment is parsed and then compiled into bytecodes.
Therefore, after downloading and installing the application package, the electronic device does not need to analyze and compile byte codes for the target code segment each time the application package is started, namely, does not need to analyze and compile byte codes for the code to be executed when the application package in the target code segment is started, so that the time consumption in the starting process can be saved, and the starting speed of the application package can be improved.
It can be understood that when the object code segment further includes a code that needs to be executed in the running process after the application package is started, for example, the object code segment may include all codes in the application source code, in this case, during the running process of the application package, the electronic device does not need to parse and compile a byte code for the code that needs to be executed in the running process of the application package in the object code segment, so that the response speed of the application package can be improved, and the power consumption of the application package in the running process can be reduced.
In some embodiments, the first profile further includes a hotspot file. The hot spot file may include any one of a start hot spot file and an operation hot spot file. The starting hot spot file is used for recording functions which need to be executed when the application package is started, namely starting hot spot functions. The operation hot spot file is used for recording functions which need to be executed in the operation process after the application package is started, namely operation hot spot functions. The starting hot spot function and the running hot spot function can comprise a plurality of functions. It can be appreciated that after the development of the application package is completed, a developer can record the functions that need to be executed in the starting process of the application package and the functions that need to be executed in the running process after the starting process through tools such as a hot spot recording tool, so as to generate the starting hot spot file and the running hot spot file.
When precompiling the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code, the server may precompile the target code segment in the application source code to obtain the byte code based on the hotspot function information recorded in the hotspot file. For example, the starting hot-spot function recorded in the starting hot-spot file may be precompiled to obtain a corresponding byte code, or the starting hot-spot function recorded in the starting hot-spot file and the running hot-spot function recorded in the running hot-spot file may be precompiled at the same time to obtain a corresponding byte code.
Therefore, when the user starts the application package each time, the electronic equipment does not need to analyze and compile the byte codes for the hotspot functions recorded in the hotspot file any more, so that the time required for analyzing and compiling the hotspot functions can be saved, the time consumption in the starting process can be saved, and the starting speed of the application package can be improved.
130, adding the byte code to the first release file to obtain a second release file.
After obtaining the byte code corresponding to the target code segment in the application source code, the server adds the byte code into the first distribution file, for example, the byte code can be packaged into the first distribution file to obtain a second distribution file.
140, publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file.
After the server obtains the second release file, the application package can be released according to the first release file and the second release file, or the application package can be released according to the first release file, so that a user can download the application package. For example, when the user needs to use the application package, the server may provide the first published file for the user to download, or may provide the second published file for the user to download.
In the description of the present application, it should be understood that terms such as "first," "second," and the like are used merely to distinguish between similar objects and should not be construed to indicate or imply relative importance or implying any particular order of magnitude of the technical features indicated.
Referring to fig. 4 and fig. 5, fig. 4 is a schematic view of a second application scenario of an application package provided in an embodiment of the present application, and fig. 5 is a schematic view of a second starting process of the application package provided in an embodiment of the present application.
Wherein the application package is developed by a developer. After development is completed, the developer may publish the application package to the application marketplace, forming a first publication file that includes application source code. And then, the server precompiles the target code segment in the application source code, and adds the precompiled byte code into the first release file to obtain a second release file. Subsequently, the first published file and the second published file are provided for the user to download. When the user needs to use the application package, the application package is downloaded, installed and started in sequence. It can be understood that the user can perform only one operation in the whole process of downloading the application package, installing the application package and starting the application package.
After the server precompiles all application source codes of the application package, the electronic device only needs to perform the following processes when the application package is started each time: the machine code is interpreted, executed and compiled as shown in fig. 5. Thus, during the start-up of the application package, the electronic device may omit the process of parsing and compiling the bytecode. Therefore, time consumption in the starting process can be saved, and the starting speed of the application package can be improved. In addition, because the operation hot spot functions which are required to be used in the operation process of the application package are precompiled in the precompiled process, the application package does not need to analyze and compile byte codes for the called operation hot spot functions in the operation process, so that the response speed of the application package can be improved, and the power consumption of the application package in the operation process can be reduced.
After the server precompiles codes corresponding to the hot spot functions recorded in the hot spot files of the application package, when the application package is started each time, the electronic equipment does not need to analyze and compile the hot spot functions when analyzing and compiling the byte codes, so that time required for analyzing and compiling the hot spot functions can be saved, time consumption in the starting process can be saved, and the starting speed of the application package is improved.
In some embodiments, when the application package is published according to the first published file and the second published file or the application package is published according to the first published file, the server may perform the following steps:
when receiving a downloading request for downloading the application package sent by the electronic equipment, determining the network environment state of the electronic equipment, wherein the network environment state comprises a local area network environment and a mobile network environment;
and sending a corresponding release file to the electronic equipment according to the network environment state.
After the server obtains the second release file, when receiving a download request sent by the electronic device for downloading the application package, for example, when a user clicks an icon or a link of the application package, the electronic device generates the download request and sends the generated download request to an application market of the server, and at this time, the server can determine a network environment state of the electronic device, for example, by communicating with the electronic device, to obtain network environment state information of the electronic device. Wherein the network environment state includes a local area network environment and a mobile network environment. A local area network environment is understood to mean that an electronic device is already connected to a local area network and communicates with a network device via the local area network. A mobile network environment is understood to mean that the electronic device is not connected to a local area network and communicates with the network device via the mobile network.
And then, the server sends a corresponding release file to the electronic equipment according to the network environment state. For example, when the network environment state is a local area network environment, the server sends the second release file to the electronic device; and when the network environment state is a mobile network environment, the server sends the first distribution file to the electronic equipment.
It can be appreciated that, since the second release file is a byte code obtained by adding pre-compilation into the first release file, the data size of the second release file is larger than the data size of the first release file. When the electronic equipment of the user is in a mobile network environment, namely, is not connected with the local area network, the network resource of the electronic equipment can be saved by sending the first distribution file to the electronic equipment. When the electronic equipment of the user is in the local area network environment, the network resource of the local area network is generally superior to that of the mobile network, so that the second release file with larger data volume can be sent to the electronic equipment.
It will be appreciated that in some embodiments, when receiving a download request sent by the electronic device to download the application package, the server may further determine whether the second published file exists in the application market. For example, when the server only precompiles the code corresponding to the hotspot file of the application package, if the first publishing file does not include the code corresponding to the hotspot file, the server does not need to perform precompilation operation, and at this time, the second publishing file is not formed. If the second release file exists, a corresponding release file is sent to the electronic equipment according to the network environment state; and if the second release file does not exist, the first release file is directly sent to the electronic equipment.
In the method for publishing the application package, the target code segments in the application source code of the first publishing file are precompiled to form the byte codes, so that after the electronic device downloads and installs the application package, the electronic device does not need to compile the target code segments in the application source code every time the application package is started, the process of analyzing and compiling the byte codes of the target code segments can be omitted, time consumption in the starting process can be saved, and the starting speed of the application package is improved.
The embodiment of the application also provides an application method of the application package, and the application method of the application package can be applied to the electronic equipment. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook computer, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, or the like.
Referring to fig. 6, fig. 6 is a flowchart of an application method of an application package according to an embodiment of the present application. The application method of the application package comprises the following steps:
And 210, acquiring a release file of the application package, wherein the release file comprises application source codes.
The electronic device may obtain a release file of the application package, e.g., download the release file of the application package from an application marketplace of the server. For example, when a user clicks an icon or link of an application package, the electronic device may be triggered to download the application package from the application marketplace. Wherein, the release file can be a release file provided to an application market for a developer of the application package. The release files may include code files written by the developer and resource files used, which may include, for example, functions that need to be used. Both the code file and the resource file may be presented as code, i.e. application source code corresponding to an application package.
220 install the published file to an installation directory to form an installation file.
After the electronic equipment acquires the release file of the application package, the electronic equipment can install the release file into an installation directory of the electronic equipment to form an installation file. It will be appreciated that the installation file includes files formed during installation of the published file, such as files released during installation.
230, precompiling the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code.
In the installation process of the application package, the electronic device may precompiled the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code. The object code segment may include a code that needs to be executed when the application package is started, and may also include a code that needs to be executed in a running process after the application package is started. Precompiled may include both parsing and compiling bytecodes, i.e., the target code segment is parsed and then compiled into bytecodes.
Therefore, after downloading and installing the application package, the electronic device does not need to analyze and compile byte codes for the target code segment each time the application package is started, namely, does not need to analyze and compile byte codes for the code to be executed when the application package in the target code segment is started, so that the time consumption in the starting process can be saved, and the starting speed of the application package can be improved.
It can be understood that when the object code segment further includes a code that needs to be executed in the running process after the application package is started, for example, the object code segment may include all codes in the application source code, in this case, during the running process of the application package, the electronic device does not need to parse and compile a byte code for the code that needs to be executed in the running process of the application package in the object code segment, so that the response speed of the application package can be improved, and the power consumption of the application package in the running process can be reduced.
In some embodiments, the published file further includes a hotspot file. The hot spot file may include any one of a start hot spot file and an operation hot spot file. The starting hot spot file is used for recording functions which need to be executed when the application package is started, namely starting hot spot functions. The operation hot spot file is used for recording functions which need to be executed in the operation process after the application package is started, namely operation hot spot functions. The starting hot spot function and the running hot spot function can comprise a plurality of functions. It can be appreciated that after the development of the application package is completed, a developer can record the functions that need to be executed in the starting process of the application package and the functions that need to be executed in the running process after the starting process through tools such as a hot spot recording tool, so as to generate the starting hot spot file and the running hot spot file.
When precompilation is performed on the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code, the electronic device may precompile the target code segment in the application source code to obtain the byte code based on the hotspot function information recorded in the hotspot file. For example, the starting hot-spot function recorded in the starting hot-spot file may be precompiled to obtain a corresponding byte code, or the starting hot-spot function recorded in the starting hot-spot file and the running hot-spot function recorded in the running hot-spot file may be precompiled at the same time to obtain a corresponding byte code.
Therefore, when the user starts the application package each time, the electronic equipment does not need to analyze and compile the byte codes for the hotspot functions recorded in the hotspot file any more, so that the time required for analyzing and compiling the hotspot functions can be saved, the time consumption in the starting process can be saved, and the starting speed of the application package can be improved.
240, storing the byte code in the installation catalog to complete the installation of the application package.
And after the electronic equipment obtains the byte codes corresponding to the target code segments in the application source codes, storing the byte codes into the installation catalog to finish the installation of the application package. After the installation is completed, the application package can be started.
In some embodiments, the application method of the application package further includes:
receiving a starting instruction of the application package;
and executing the installation file and the byte codes corresponding to the target code segments in the application source code according to the starting instruction so as to start the application package.
When the electronic device receives a starting instruction of the application package, the installation file and the byte code corresponding to the target code segment in the application source code can be executed according to the starting instruction so as to start the application package. For example, after the application package is installed, when the user clicks an icon of the application package, a start instruction is triggered at this time, and the electronic device receives the start instruction and starts the application package. For another example, when the application package is not yet installed, when the user clicks the application package icon or link in the application market, the downloading, the installation and the starting of the application package can be triggered simultaneously, that is, in this case, the downloading instruction, the installation instruction and the starting instruction of the application package can be triggered simultaneously, then the electronic device downloads the application package according to the downloading instruction, the installation instruction and the starting instruction, installs immediately after the downloading is completed, and starts immediately after the installation is completed.
It can be understood that when the electronic device executes the installation file and the byte code corresponding to the target code segment in the application source code to start the application package, the target code segment in the application source code does not need to be parsed and compiled, so that the time consumption in the starting process can be saved, and the starting speed of the application package can be improved.
Referring to fig. 7 at the same time, fig. 7 is a schematic diagram of a third application scenario of an application package according to an embodiment of the present application.
Wherein the application package is developed by a developer. After the development is completed, the developer can publish the application package to the application market to form a published file. The application marketplace may provide published files to users for download. When the user needs to use the application package, the application package is downloaded, installed and started in sequence. When an application package is installed, the electronic device may precompiled the target code segment in the application source code to obtain a byte code corresponding to the target code segment in the application source code, and then store the byte code in the installation directory to complete the installation of the application package. It can be understood that the user can perform only one operation in the whole process of downloading the application package, installing the application package and starting the application package.
After the electronic device precompiles all application source codes of the application package in the installation process of the application package, the electronic device only needs to perform the following processes when the application package is started each time: the machine code is interpreted, executed and compiled as shown in fig. 5. Thus, during the start-up of the application package, the electronic device may omit the process of parsing and compiling the bytecode. Therefore, time consumption in the starting process can be saved, and the starting speed of the application package can be improved. In addition, because the operation hot spot functions which are required to be used in the operation process of the application package are precompiled in the precompiled process, the application package does not need to analyze and compile byte codes for the called operation hot spot functions in the operation process, so that the response speed of the application package can be improved, and the power consumption of the application package in the operation process can be reduced.
After the electronic device precompiles the codes corresponding to the hot spot functions recorded in the hot spot files of the application package in the installation process of the application package, when the application package is started each time, the electronic device does not need to analyze and compile the hot spot functions when analyzing and compiling the byte codes, so that the time required for analyzing and compiling the hot spot functions can be saved, the time consumption in the starting process can be saved, and the starting speed of the application package is improved.
In the application method of the application package, the target code segments in the application source codes of the release files are precompiled to form the byte codes in the installation process of the application package, so that after the installation is completed, the electronic equipment does not need to compile the target code segments in the application source codes every time the application package is started, the process of analyzing and compiling the byte codes of the target code segments can be omitted, the time consumption in the starting process can be saved, and the starting speed of the application package is improved.
The embodiment of the application also provides a release device of the application package, which can be integrated in a server, for example, an application package management server.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an application package publishing device 300 according to an embodiment of the present application. Wherein, the application package publishing device 300 includes:
a first obtaining module 301, configured to obtain a first profile of an application package, where the first profile includes application source code;
a first pre-compiling module 302, configured to pre-compile a target code segment in the application source code to obtain a byte code corresponding to the target code segment in the application source code;
A first processing module 303, configured to add the byte code to the first published file to obtain a second published file;
and the publishing module 304 is configured to publish the application package according to the first publishing file and the second publishing file or publish the application package according to the first publishing file.
In some embodiments, the first profile further includes a hotspot file, and the first pre-compiling module 302 is configured to:
and precompiling the target code segment in the application source code based on the hot spot function information recorded in the hot spot file to obtain the byte code, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file.
In some embodiments, the publishing module 304 is to:
when receiving a downloading request for downloading the application package sent by the electronic equipment, determining the network environment state of the electronic equipment, wherein the network environment state comprises a local area network environment and a mobile network environment;
when the network environment state is a local area network environment, the second release file is sent to the electronic equipment;
and when the network environment state is a mobile network environment, the first distribution file is sent to the electronic equipment.
The specific implementation manner of each module of the application package publishing device 300 may refer to the description in the above application package publishing method, which is not described herein.
According to the application package publishing device, the target code segments in the application source codes of the first publishing file are precompiled to form the byte codes, so that after the electronic device downloads and installs the application package, the electronic device does not need to compile the target code segments in the application source codes every time the application package is started, the process of analyzing and compiling the byte codes of the target code segments can be omitted, time consumption in the starting process can be saved, and the starting speed of the application package is improved.
The embodiment of the application also provides an application device of the application package, and the application device of the application package can be integrated in the electronic equipment. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook computer, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, or the like.
Referring to fig. 9, fig. 9 is a schematic diagram of a first structure of an application device 400 of an application package according to an embodiment of the present application. Wherein, the application device 400 of the application package includes:
a second obtaining module 401, configured to obtain a release file of an application package, where the release file includes application source code;
an installation module 402, configured to install the published file to an installation directory to form an installation file;
a second pre-compiling module 403, configured to pre-compile the target code segment in the application source code to obtain a byte code corresponding to the target code segment in the application source code;
and the second processing module 404 is configured to store the bytecode in the installation directory to complete the installation of the application package.
In some embodiments, the published file further includes a hotspot file, and the second pre-compiling module 403 is configured to:
and precompiling the target code segment in the application source code based on the hot spot function information recorded in the hot spot file to obtain the byte code, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file.
In some embodiments, referring to fig. 10, fig. 10 is a second structural schematic diagram of an application device 400 of an application package according to an embodiment of the present application. The application device 400 of the application package further includes a starting module 405, where the starting module 405 is configured to:
Receiving a starting instruction of the application package;
and executing the installation file and the byte codes corresponding to the target code segments in the application source code according to the starting instruction so as to start the application package.
For specific implementation manners of each module of the application device 400 of the application package, reference may be made to the description in the application method of the application package, which is not described herein.
According to the application device of the application package, in the installation process of the application package, the target code segments in the application source codes of the release files are precompiled to form the byte codes, so that after the installation is completed, when the application package is started each time, the electronic equipment does not need to compile the target code segments in the application source codes, the process of analyzing and compiling the byte codes of the target code segments can be omitted, time consumption in the starting process can be saved, and the starting speed of the application package is improved.
The embodiment of the application also provides electronic equipment. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook computer, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, or the like.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an electronic device 500 according to an embodiment of the present application. Wherein the electronic device 500 comprises a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 501 is a control center of the electronic device 500, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling computer programs stored in the memory 502, and calling data stored in the memory 502, thereby performing overall monitoring of the electronic device.
In the present embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to the processes of one or more computer programs into the memory 502 according to the following steps, and the processor 501 executes the computer programs stored in the memory 502, so as to perform the following steps:
acquiring a first distribution file of an application package, wherein the first distribution file comprises application source codes;
precompiled the target code segment in the application source code to obtain the byte code corresponding to the target code segment in the application source code;
adding the byte code into the first release file to obtain a second release file;
And publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file.
In some embodiments, when publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file, the processor 501 performs the steps of:
when receiving a downloading request for downloading the application package sent by the electronic equipment, determining the network environment state of the electronic equipment, wherein the network environment state comprises a local area network environment and a mobile network environment;
when the network environment state is a local area network environment, the second release file is sent to the electronic equipment;
and when the network environment state is a mobile network environment, the first distribution file is sent to the electronic equipment.
In some embodiments, when the first profile further includes a hot file and precompiled the target code segment in the application source code to obtain the bytecode corresponding to the target code segment in the application source code, the processor 501 performs the following steps:
and precompiling the target code segment in the application source code based on the hot spot function information recorded in the hot spot file to obtain the byte code, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file.
Memory 502 may be used to store computer programs and data. The memory 502 stores computer programs that include instructions executable in a processor. The computer program may constitute various functional modules. The processor 501 executes various functional applications and data processing by calling a computer program stored in the memory 502.
According to the electronic device provided by the embodiment of the application package, the target code segments in the application source codes of the release files are precompiled to form the byte codes in the installation process of the application package, so that after the installation is completed, the electronic device does not need to compile the target code segments in the application source codes every time the application package is started, the process of analyzing and compiling the byte codes of the target code segments can be omitted, the time consumption in the starting process can be saved, and the starting speed of the application package is improved.
The embodiment of the application also provides a storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer executes the method for publishing the application package according to any one of the embodiments or executes the method for applying the application package according to any one of the embodiments.
It should be noted that, those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the storage medium may include, but is not limited to: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The above describes the publishing method of the application package, the application method, the device, the storage medium and the electronic device of the application package provided in the embodiments of the present application in detail. The principles and embodiments of the present application are described herein with specific examples, the above examples being provided only to assist in understanding the methods of the present application and their core ideas; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. A method for publishing an application package, comprising:
acquiring a first distribution file of an application package, wherein the first distribution file comprises application source codes and hot spot files;
Precompilation is carried out on the target code segment in the application source code based on the hot spot function information recorded in the hot spot file to obtain byte codes, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file;
adding the byte code into the first release file to obtain a second release file;
and publishing the application package according to the first publishing file and the second publishing file or publishing the application package according to the first publishing file.
2. The method for publishing an application package according to claim 1, wherein the publishing the application package according to the first publishing file and the second publishing file or the publishing the application package according to the first publishing file comprises:
when receiving a downloading request for downloading the application package sent by the electronic equipment, determining the network environment state of the electronic equipment, wherein the network environment state comprises a local area network environment and a mobile network environment;
when the network environment state is a local area network environment, the second release file is sent to the electronic equipment;
and when the network environment state is a mobile network environment, the first distribution file is sent to the electronic equipment.
3. An application method of an application package, comprising:
acquiring a release file of an application package, wherein the release file comprises an application source code and a hot spot file;
installing the release file to an installation directory to form an installation file;
precompilation is carried out on the target code segment in the application source code based on the hot spot function information recorded in the hot spot file to obtain byte codes, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file;
and storing the byte codes into the installation catalog to finish the installation of the application package.
4. A method of applying an application package according to claim 3, further comprising:
receiving a starting instruction of the application package;
and executing the installation file and the byte codes corresponding to the target code segments in the application source code according to the starting instruction so as to start the application package.
5. An application package issuing apparatus, comprising:
the first acquisition module is used for acquiring a first distribution file of the application package, wherein the first distribution file comprises application source codes and hot spot files;
the first pre-compiling module is used for pre-compiling the target code segment in the application source code to obtain byte codes based on the hot spot function information recorded in the hot spot file, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file;
The first processing module is used for adding the byte code into the first release file to obtain a second release file;
and the release module is used for releasing the application package according to the first release file and the second release file or releasing the application package according to the first release file.
6. An application device for an application package, comprising:
the second acquisition module is used for acquiring release files of the application package, wherein the release files comprise application source codes and hot spot files;
the installation module is used for installing the release file to an installation directory to form an installation file;
the second pre-compiling module is used for pre-compiling the target code segment in the application source code to obtain byte codes based on the hot spot function information recorded in the hot spot file, wherein the hot spot file comprises any one of a starting hot spot file and an operating hot spot file;
and the second processing module is used for storing the byte codes into the installation catalog so as to finish the installation of the application package.
7. A storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the method of publishing an application package as claimed in any one of claims 1 to 2 or to perform the method of applying an application package as claimed in any one of claims 3 to 4.
8. A server for executing the distribution method of the application package according to any one of claims 1 to 2.
9. An electronic device comprising a processor and a memory, wherein the memory has stored therein a computer program, and wherein the processor is configured to execute the application method of the application package according to any one of claims 3 to 4 by calling the computer program stored in the memory.
CN202011085779.3A 2020-10-12 2020-10-12 Application package release method, application method, device, medium, server and equipment Active CN112148318B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011085779.3A CN112148318B (en) 2020-10-12 2020-10-12 Application package release method, application method, device, medium, server and equipment
PCT/CN2021/113283 WO2022078057A1 (en) 2020-10-12 2021-08-18 Method and apparatus for publishing application package, method and apparatus for applying application package, and medium, server and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011085779.3A CN112148318B (en) 2020-10-12 2020-10-12 Application package release method, application method, device, medium, server and equipment

Publications (2)

Publication Number Publication Date
CN112148318A CN112148318A (en) 2020-12-29
CN112148318B true CN112148318B (en) 2024-02-13

Family

ID=73951462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011085779.3A Active CN112148318B (en) 2020-10-12 2020-10-12 Application package release method, application method, device, medium, server and equipment

Country Status (2)

Country Link
CN (1) CN112148318B (en)
WO (1) WO2022078057A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148318B (en) * 2020-10-12 2024-02-13 Oppo广东移动通信有限公司 Application package release method, application method, device, medium, server and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177199A (en) * 2011-12-22 2013-06-26 盛乐信息技术(上海)有限公司 Webpage application code protective method and system, and executive speed-up method and system
US9280339B1 (en) * 2013-12-12 2016-03-08 Amazon Technologies, Inc. Class replacer during application installation
CN105630569A (en) * 2015-12-17 2016-06-01 北京金山安全软件有限公司 Software source code processing method and device and electronic equipment
CN108664773A (en) * 2018-04-26 2018-10-16 北京三快在线科技有限公司 The guard method of Java source code and device
CN111159658A (en) * 2019-12-16 2020-05-15 广州三七互娱科技有限公司 Byte code processing method, system, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148318B (en) * 2020-10-12 2024-02-13 Oppo广东移动通信有限公司 Application package release method, application method, device, medium, server and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177199A (en) * 2011-12-22 2013-06-26 盛乐信息技术(上海)有限公司 Webpage application code protective method and system, and executive speed-up method and system
US9280339B1 (en) * 2013-12-12 2016-03-08 Amazon Technologies, Inc. Class replacer during application installation
CN105630569A (en) * 2015-12-17 2016-06-01 北京金山安全软件有限公司 Software source code processing method and device and electronic equipment
CN108664773A (en) * 2018-04-26 2018-10-16 北京三快在线科技有限公司 The guard method of Java source code and device
CN111159658A (en) * 2019-12-16 2020-05-15 广州三七互娱科技有限公司 Byte code processing method, system, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112148318A (en) 2020-12-29
WO2022078057A1 (en) 2022-04-21

Similar Documents

Publication Publication Date Title
JP6294886B2 (en) Generate native code from intermediate language code for applications
US6779179B1 (en) Registry emulation
KR101807897B1 (en) Cross―platform application framework
EP3035191B1 (en) Identifying source code used to build executable files
US20040045016A1 (en) Registry emulation
CN110187910B (en) Thermal updating method, device, equipment and computer readable storage medium
GB2589658A (en) Method and apparatus for running an applet
US11625253B2 (en) Application-level runtime environment for executing applications native to mobile devices without full installation
EP2812794A1 (en) Dynamic injection of code into running process
CN103544434A (en) Method and terminal used for ensuring safe operation of application program
CN108089870B (en) Method and apparatus for repairing applications
CN114115904A (en) Information processing method, information processing apparatus, server, and storage medium
CN112667246A (en) Application function extension method and device and electronic equipment
US7844960B2 (en) Optimizing software program execution during class loading phase
CN112148318B (en) Application package release method, application method, device, medium, server and equipment
US10552135B1 (en) Reducing a size of an application package
CN110502251B (en) Application installation method and device
CN110018831B (en) Program processing method, program processing apparatus, and computer-readable storage medium
CN116009831B (en) Mobile application program development method, device and equipment
CN114398102B (en) Application package generation method and device, compiling server and computer readable storage medium
CN114489698A (en) Application program installation method and device
CN111338633B (en) Method and device for generating installation-free file and electronic equipment
CN117827228B (en) Quick application deployment method and related equipment
CN116974653B (en) Class loading method and system
CN111694730B (en) Method and device for eliminating error reference control resource

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