CN112882694A - Program compiling method and device, electronic equipment and readable storage medium - Google Patents

Program compiling method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112882694A
CN112882694A CN202110128982.2A CN202110128982A CN112882694A CN 112882694 A CN112882694 A CN 112882694A CN 202110128982 A CN202110128982 A CN 202110128982A CN 112882694 A CN112882694 A CN 112882694A
Authority
CN
China
Prior art keywords
target
program
application
target application
compiling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110128982.2A
Other languages
Chinese (zh)
Inventor
李焕达
王进
李冲
杨杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110128982.2A priority Critical patent/CN112882694A/en
Publication of CN112882694A publication Critical patent/CN112882694A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

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

Abstract

The invention relates to the technical field of computer program compilation, in particular to a program compilation method, a program compilation device, electronic equipment and a readable storage medium. The method comprises the following steps: acquiring a target application package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler; compiling the application program package file by using the target compiler according to the configuration file; and loading and running the compiled application program package file on the target system. The program compiling scheme provided by the application improves the running speed and efficiency of the application program.

Description

Program compiling method and device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of computer program compilation, in particular to a program compilation method, a program compilation device, electronic equipment and a readable storage medium.
Background
The biggest common fault of the android system at present is that the android system becomes stuck and slow in response after long-term use. The performance of the same mobile phone is rapidly reduced after the mobile phone is used for a long time, great inconvenience is brought to a wide range of android users, and even if some flagship models are loaded with the latest and most advanced CPU and the largest memory, the problem of blockage or slow response also occurs after the use time is long. The main reason is that in the android system, the operation of the application depends on the analysis processing of the system on the application code, that is, the operation process of the application is a processing process of executing and analyzing at the same time, wherein the execution efficiency of the application is seriously affected by the analysis process, and a large amount of memory occupation is caused by caching some analysis records in the analysis process. Before the 5.0 version of Android, the Android adopts a Dalvik virtual machine, besides analysis and execution, a JIT (Just in Time) compiler is also introduced, part of frequently called Java codes can be compiled into machine codes in the program running stage, and in the 5.0 to 6.0 Android stages, the ART (Android runtime) is introduced by Google, and the problem of Java code execution efficiency is solved by using the AOT compiler. However, when the Android application is installed, the system can compile part of Java code into machine code in advance, and this mode has two disadvantages: firstly, the installation speed is slow, and secondly, the disk space is occupied. In summary, although Google also adjusts the code compiling mode for many times, the current Android system still has a code running mode of analyzing and executing while running, which causes the execution efficiency and performance of the application to be affected to some extent.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks. The technical scheme adopted by the application is as follows:
in a first aspect, an embodiment of the present application discloses a program compiling method, where the method includes:
acquiring a target application package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
compiling the application program package file by using the target compiler according to the configuration file;
and loading and running the compiled application program package file on the target system.
Further, the acquiring the target application program comprises: acquiring an application package file meeting a preset operation frequency threshold as a target application package according to the preset operation frequency threshold; wherein the operating frequency threshold is acceptable for user-defined settings.
Further, obtaining the target application configuration file comprises: acquiring the name and the characteristic requirement of a target application; wherein the characteristic requirements include, but are not limited to: a program package file naming rule, a compiling rule, a coupling characteristic and a loading characteristic; and writing a configuration file of the target application according to the name and the characteristic requirement of the target application.
Further, writing the configuration file of the target application according to the name and the characteristic requirement of the target application comprises:
naming the configuration file according to the name of the target application;
writing the content of the configuration file according to the characteristic requirement of the target application; wherein the contents of the configuration file include: a generic content parameter and an application content parameter associated with the target application.
Wherein the composition common content parameters include, but are not limited to: setting a decoupling enabling parameter of the target application as starting, and setting a delay binding enabling parameter of the target application as starting.
Wherein the application content parameters related to the target application include, but are not limited to: the target applies the compilation rules and the plug-in compilation parameters.
Wherein the writing plug-in compiling parameters include but are not limited to: and compiling directory information parameters of the plug-ins in the target application, plug-in type parameters and reference relations of the plug-ins to the target application package files.
Further, the target system includes: configuring a CPU architecture and a system so file of a target client to 64 bits; wherein the configured system is the target system.
Further optionally, the method further comprises:
performing operation test on the compiled target application package file;
if the test is not passed, comparing the target application program packages before and after compiling to obtain difference data;
and modifying the compiled target application program package according to the difference data.
Optionally, the target compiler is a ark compiler.
In another aspect, an embodiment of the present application provides a program compiling apparatus, where the apparatus includes: a processing module, a compiling module, an executing module, wherein,
the processing module is used for acquiring a target application program package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
the compiling module is used for compiling the application program package file by using the target compiler according to the configuration file;
and the execution module is used for loading and running the compiled application program package file on the target system.
Further, the processing module is specifically configured to obtain, according to a preset operating frequency threshold, an application package file meeting the preset operating frequency threshold as a target application package; wherein the operating frequency threshold is acceptable for user-defined settings;
and the processing module writes a configuration file of the target application according to the name and the characteristic requirement of the target application. Wherein the characteristic requirements of the target application include, but are not limited to: package file naming rules, compilation rules, coupling characteristics, loading characteristics.
Further, the processing module is also used for configuring the CPU architecture and the system so file of the target client to 64 bits; wherein the configured system is the target system.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
the memory is used for storing operation instructions;
the processor is configured to execute the method in any of the embodiments by calling the operation instruction.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the method of any one of the above embodiments.
According to the program compiling scheme provided by the embodiment of the application, the application program to be compiled is configured, and the corresponding configuration file is configured, and then the compiler, particularly the advantages of the ark compiler, is utilized to compile the application program running at high frequency so as to finish analysis of the running code before application execution.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a flowchart illustrating a program compiling method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a program compiling apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, 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 drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
It will be understood by those skilled in the art that, unless otherwise specified, the singular forms "a", "an", "the" and "the" may include the plural forms, and the plural forms "a", "an", "a", and "the" are merely intended to illustrate the object definition for clarity and do not limit the object itself, and certainly, the object definition for "a" and "an" may be the same terminal, device, user, etc., and may also be the same terminal, device, user, etc. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items. In addition, it is to be understood that "at least one" in the embodiments of the present application means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple.
Fig. 1 shows a flowchart of program compiling provided in an embodiment of the present application, and as shown in fig. 1, the method mainly includes:
s101, acquiring a target application package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
s102, compiling the application program package file by using the target compiler according to the configuration file;
and S103, loading and running the compiled application package file on the target system.
In the preferred embodiment, the target compiler is a arklet compiler, since the arklet compiler is the first static compiler to completely replace the language virtual machine, requiring no interpreter at all. And the compiler gives consideration to both Java development efficiency and C language operation efficiency. Compared with the existing compiling mechanism:
1. the ark compiler is a static compiling mode, and in the existing android system, an application program is operated, a virtual machine is firstly started, then application program codes are read in, and the application program codes are interpreted and executed item by item. It will occupy more processing resources and affect the efficiency of program execution. Of course, there are also advanced or runtime compilation techniques, including AOT or JIT, that convert portions of a program into machine code for execution directly on a CPU. However, it is still impossible to get 100% free from the execution of the virtual machine, which is also the key that the current android camps are inferior to the IOS camps.
2. The static compiling mode of the Hua-Wei-Canoe compiler can directly translate the dynamic characteristics in the language into machine codes, and the mobile phone can run programs at full speed after installing application programs, so that the defects of a virtual machine are thoroughly eliminated, and the efficiency is greatly improved.
3. The ark compiler is a compiler deployed in a development environment, and the existing compiling process mainly occurs in a mobile phone, so that additional resource consumption is brought.
Based on the above points, the application compiled by the ark compiler can significantly improve the running efficiency of the application. However, how to compile the system application by using the ark compiler to improve the running efficiency of the application is difficult to implement due to different schemes and certain technologies existing in some interfaces and module adaptation problems.
In a further embodiment, the process of obtaining the file included in the target application program comprises: acquiring an application package file meeting a preset operation frequency threshold as a target application package according to the preset operation frequency threshold; wherein the operating frequency threshold is acceptable for user-defined settings.
In a further embodiment, the process of obtaining the target application configuration file is as follows: acquiring the name and the characteristic requirement of a target application; wherein the characteristic requirements include, but are not limited to: a program package file naming rule, a compiling rule, a coupling characteristic and a loading characteristic; and writing a configuration file of the target application according to the name and the characteristic requirement of the target application. Further, writing the configuration file of the target application according to the name and the characteristic requirement of the target application comprises:
step 1, naming the configuration file according to the name of the target application; the naming example can refer to the following rules:
and adding ". conf" after the name of the APK, and if the name of the target APK to be compiled is test.
Step 2, writing the content of the configuration file according to the characteristic requirement of the target application; wherein the contents of the configuration file include: a generic content parameter and an application content parameter associated with the target application.
The common content parameter is a parameter for controlling the overall process and configuration of compilation, and includes parameters such as decoruple and lazybind. In the embodiment of the application, a Decouple parameter (a target application decoupling enabling parameter) can be set as default starting so as to enable the APP and the system decoupling function, and therefore the APP can be used across system versions; furthermore, a lazybind parameter (target application delay binding enabling parameter) can be acquiescently determined to be started, that is, a plurality of classloaders are involved to load the same plugin scene to be started (the plugin scene is not started by default), and the lazybind parameter is also started by default in a hot patch scene.
Wherein the target application-related application content parameters, namely, the mainAPK parameters include, but are not limited to: the target applies the compilation rules and the plug-in compilation parameters. The target application compilation rules and plug-in compilation parameters written in the configuration file may be seen in the following examples:
when a symbol in dex under an APK root directory depends on a certain plug-in, the plug-in needs to be configured in front; the Main Default APP Key Words are reserved Words and mean Main APK; if some symbols of the Main APK are defined in the plugin libandroine-test-Buscoded. so, libandroine-test-Buscoded. so needs to be configured in front, Main App replaceable assertions can be configured into libandroine-test-Buscoded. so, and if no dependency exists, the Main App replaceable assertions can be not configured or configured to be null;
further, the writing plug-in compiling parameters include, but are not limited to: and compiling directory information parameters, plug-in type parameters and reference relations of the plug-ins to the target application program package files in the target application, namely path, asset-stype and is-reusable-Main-Apk parameters of the target application plug-ins.
Wherein the content of the first and second substances,
the path parameter refers to a directory parameter of the plug-in the APK, and if there is gdt _ plug-in. jar packet in the assets/super plug-in directory in test.
The asset-stype parameter refers to the type parameter of the plug-in, and there are generally three parameters, namely dex, jar and APK. These three types are not necessarily determined by suffix name, but should be associated with the file itself, e.g., a file with a suffix name of. so, possibly actually a zip-compressed APK renamed plug-in, compiled in APK.
The is-reviable-Main-Apk parameter refers to a reference relation of the plug-in to the target application package file, and specifically indicates whether the plug-in refers to a definition or a symbol in the Main Apk, if so, the plug-in needs to be configured to true, otherwise, the plug-in is false.
The process of writing a profile for a target application according to its name and property requirements is described below in one specific example:
first, the naming of the configuration file is done, and as suggested in the above embodiments, the name of apk plus ". conf" may be used, and if the target compilation apk name is test.
Secondly, writing the content of the configuration file according to the characteristic requirement of the target application; wherein the contents of the configuration file include: a generic content parameter and an application content parameter associated with the target application.
Example configuration files:
[common]
decouple=true
lazybind=true
[mainapk]
assetsList=libandroid-phone-test-
buscodedpe.so;MainDefaultAPPKeyWords;libandroid-phone-test-hichat.so
mainAppReliableAssets=libandroid-phone-test-buscodedpe.so
[libandroid-phone-test-buscodedpe.so]
path=lib/arm64-v8a
assetstype=apk
isReliableMainApk=false
[libandroid-phone-test-hichat.so]
path=lib/arm64-v8a
assetstype=apk
isReliableMainApk=true
wherein the above example profile detail fields are explained as follows:
the [ common ] item mainly controls global parameters, including decoruple, lazybind and other parameters.
Figure BDA0002924511320000091
The [ mainapk ] item is used for describing a main apk compiling rule and comprises a plug-in compiling sequence and the like, and when a symbol in dex under an apk root directory depends on a certain plug-in, the plug-in needs to be configured in front; MainDefaultAppKeyWords is a reserved word and means a main apk; if some symbols of the main apk are defined in a plugin libandbone-phone-test-busodedpe.so, libandbone-phone-test-busodedpe.so needs to be configured in front, the mainappReliableAssessions are configured as libandbone-phone-test-busodedpe.so, and if no dependency exists, the nAmappReliableAssessions are not configured or are configured to be empty;
a subsequent [ libandroid-phone-test-buscodedpe.so ] item is a compiling configuration item of the plug-in, and path, assetstype and isReliableMainApk are necessary configuration items;
Figure BDA0002924511320000092
Figure BDA0002924511320000101
in a further optional embodiment, the target system comprises: configuring a CPU architecture and a system so file of a target client to 64 bits; wherein the configured system is the target system. In the process of configuring the CPU architecture, if the project is packaged through the gradle, the configuration needs to be performed in the build. The implementation process for configuring the system so file into 64 bits: and (3) combing the so file in the system, if the so file with the same file name cannot be found under the so file arm64-v8a folder, the so file is considered not to support 64 bits, due to the particularity of the library file, 64 bits of development and transformation are required to be carried out on a source project for generating the so file, and the 64 bits of so file is regenerated after the transformation is finished. And introducing 64-bit so files into the system again for packaging.
In a specific embodiment, after the target application program file package and the compiling configuration file of the configured target application program are selected, the 64-bit version of the target application program file package and the corresponding ark compiling configuration file are uploaded to a wary ark compiling platform for compiling.
In a further optional embodiment, after the compiling is completed, the compiled target application program needs to be tested, and the testing method flow includes:
step 1, running test is carried out on a compiled target application program package file;
step 2, if the test is not passed, comparing the target application program packages before and after compiling to obtain difference data;
and 3, modifying the compiled target application program package according to the difference data.
In the specific embodiment of compiling by using the ark compiler, the application program compiled by the ark compiler needs to be tested, if an exception occurs in the test process, the application program needs to be compared with the version before compiling, if the version before compiling has the same problem, the problem needs to be solved on the basis of the original package, and if the version only has the problem, the ark version needs to be checked.
Based on the program compiling method shown in fig. 1, another aspect of the present application provides a program compiling apparatus, as shown in fig. 2, the apparatus may include: 201 processing module, 202 compiling module, 203 executing module, wherein,
the 201 processing module is used for acquiring a target application package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
the 202 compiling module is configured to compile the application package file by using the target compiler according to a configuration file;
and the 203 execution module is used for loading and running the compiled application package file on the target system.
Further, the 201 processing module is specifically configured to, according to a preset operating frequency threshold, acquire an application package file meeting the preset operating frequency threshold as a target application package; wherein the operating frequency threshold is acceptable for user-defined settings;
the 201 processing module writes a configuration file of the target application according to the name and the characteristic requirements of the target application. Wherein the characteristic requirements of the target application include, but are not limited to: package file naming rules, compilation rules, coupling characteristics, loading characteristics.
Further, the 201 processing module is also used for configuring the CPU architecture and the system so file of the target client to 64 bits; wherein the configured system is the target system.
It is to be understood that the above-mentioned respective constituent devices of the program compiling apparatus in the present embodiment have functions of realizing the respective steps of the method in the embodiment shown in fig. 1. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules or means corresponding to the functions described above. The modules and devices can be software and/or hardware, and the modules and devices can be realized independently or integrated by a plurality of modules and devices. For the functional description of each module and apparatus, reference may be specifically made to the corresponding description of the method in the embodiment shown in fig. 1, and therefore, the beneficial effects that can be achieved by the method may refer to the beneficial effects in the corresponding method provided above, which are not described again here.
It should be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the specific structure of the program compiling apparatus. In other embodiments of the present application, the program compiling device may include more or fewer components than those shown, or may combine some components, or may split some components, or may be arranged in different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The embodiment of the application provides an electronic device, which comprises a processor and a memory;
a memory for storing operating instructions;
and the processor is used for executing the program compiling method provided by any embodiment of the application by calling the operation instruction.
As an example, fig. 3 shows a schematic structural diagram of an electronic device to which the embodiment of the present application is applied, and as shown in fig. 3, the electronic device 300 includes: a processor 301 and a memory 303. Wherein processor 301 is coupled to memory 303, such as via bus 302. Optionally, the electronic device 300 may further include a transceiver 304. It should be noted that the practical application of the transceiver 304 is not limited to one. It is to be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation to the specific structure of the electronic device 300. In other embodiments of the present application, electronic device 300 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Optionally, the electronic device may further include a display screen 305 for displaying images or receiving operation instructions of a user as needed.
The processor 301 is applied to the embodiment of the present application, and is configured to implement the method shown in the foregoing method embodiment. The transceiver 304 may include a receiver and a transmitter, and the transceiver 304 is applied in the embodiment of the present application and is used for implementing the function of the electronic device of the embodiment of the present application to communicate with other devices when executed.
The Processor 301 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 301 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Processor 301 may also include one or more processing units, such as: the processor 301 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a Neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors. The controller may be, among other things, a neural center and a command center of the electronic device 300. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution. A memory may also be provided in processor 301 for storing instructions and data. In some embodiments, the memory in the processor 301 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 301. If the processor 301 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 301, thereby increasing the efficiency of the system.
The processor 301 may run the program compiling method provided in the embodiment of the present application, so as to reduce the operation complexity of the user, improve the intelligent degree of the terminal device, and improve the user experience. The processor 301 may include different devices, for example, when the CPU and the GPU are integrated, the CPU and the GPU may cooperate to execute the program compiling method provided in the embodiment of the present application, for example, part of the algorithm in the program compiling method is executed by the CPU, and another part of the algorithm is executed by the GPU, so as to obtain faster processing efficiency.
Bus 302 may include a path that transfers information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 302 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
The Memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact disk), a high speed Random Access Memory, a non-volatile Memory such as at least one magnetic disk storage device, a flash Memory device, a universal flash Memory (UFS), or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, a magnetic disk storage medium, or other magnetic storage device, Or any other medium which can be used to carry or store desired program code in the form of instructions or data structures and which can be accessed by a computer, but is not limited to such.
Optionally, the memory 303 is used for storing application program codes for executing the scheme of the present application, and is controlled by the processor 301 to execute. The processor 301 is configured to execute the application program code stored in the memory 303 to implement the program compiling method provided in any embodiment of the present application.
The memory 303 may be used to store computer-executable program code, which includes instructions. The processor 301 executes various functional applications of the electronic device 300 and data processing by executing instructions stored in the memory 303. The memory 303 may include a program storage area and a data storage area. Wherein, the storage program area can store the codes of the operating system and the application program, etc. The storage data area may store data created during use of the electronic device 300 (e.g., images, video, etc. captured by a camera application), and the like.
The memory 303 may further store one or more computer programs corresponding to the program compiling method provided by the embodiment of the present application. The one or more computer programs stored in the memory 303 and configured to be executed by the one or more processors 301 include instructions that may be used to perform the various steps in the respective embodiments described above.
Of course, the codes of the program compiling method provided by the embodiment of the present application may also be stored in the external memory. In this case, the processor 301 may execute the code of the program compiling method stored in the external memory through the external memory interface, and the processor 301 may control the execution of the program compiling flow.
The display screen 305 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 300 may include 1 or N display screens 305, N being a positive integer greater than 1. The display screen 305 may be used to display information input by or provided to the user as well as various Graphical User Interfaces (GUIs). For example, the display screen 305 may display a photograph, video, web page, or file, etc.
The electronic device provided by the embodiment of the present application is applicable to any embodiment of the above method, and therefore, the beneficial effects that can be achieved by the electronic device can refer to the beneficial effects in the corresponding method provided above, and are not described again here.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the program compiling method shown in the above method embodiment.
The computer-readable storage medium provided in the embodiments of the present application is applicable to any embodiment of the foregoing method, and therefore, the beneficial effects that can be achieved by the computer-readable storage medium can refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute the above related steps to implement the method in the above embodiment. The computer program product provided in the embodiments of the present application is applicable to any of the embodiments of the method described above, and therefore, the beneficial effects that can be achieved by the computer program product can refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
The program compiling scheme provided by the embodiment of the application comprises the steps of obtaining a target application program package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler; compiling the application program package file by using the target compiler according to the configuration file; and loading and running the compiled application program package file on the target system. The program compiling scheme provided by the application compiles the application program running at high frequency by using the advantage of a compiler, particularly a ark compiler, after the application program to be compiled and the corresponding configuration file are configured, so that the running code can be analyzed before the application is executed, and the running speed and the running efficiency of the application program are improved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be discarded or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and can make several modifications and decorations, and these changes, substitutions, improvements and decorations should also be considered to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A method of program compilation, the method comprising:
acquiring a target application package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
compiling the application program package file by using the target compiler according to the configuration file;
and loading and running the compiled application program package file on the target system.
2. The program compiling method according to claim 1, wherein the acquiring the target application program includes a file including:
acquiring an application package file meeting a preset operation frequency threshold as a target application package according to the preset operation frequency threshold; wherein the operating frequency threshold is acceptable for user-defined settings.
3. The program compiling method according to claim 1 or 2 wherein the obtaining of the target application configuration file comprises:
acquiring the name and the characteristic requirement of a target application; wherein the characteristic requirements include, but are not limited to: a program package file naming rule, a compiling rule, a coupling characteristic and a loading characteristic;
and writing a configuration file of the target application according to the name and the characteristic requirement of the target application.
4. The program compiling method of claim 3 wherein the writing a configuration file for the target application according to the name and property requirements of the target application comprises:
naming the configuration file according to the name of the target application;
writing the content of the configuration file according to the characteristic requirement of the target application; wherein the contents of the configuration file include: a generic content parameter and an application content parameter associated with the target application.
5. The program compiling method according to claim 4 wherein the authoring generic content parameter includes but is not limited to:
setting a decoupling enabling parameter of the target application as starting, and setting a delay binding enabling parameter of the target application as starting.
6. The method for program compilation according to claim 5, wherein the target application-related application content parameters include, but are not limited to: the target applies the compilation rules and the plug-in compilation parameters.
7. The program compiling method according to claim 6, wherein the writing plug-in compiling parameters include but are not limited to:
and compiling directory information parameters of the plug-ins in the target application, plug-in type parameters and reference relations of the plug-ins to the target application package files.
8. The program compiling method according to claim 1 or 7 wherein the target system comprises:
configuring a CPU architecture and a system so file of a target client to 64 bits; wherein the configured system is the target system.
9. The program compiling method according to claim 8, wherein the method further comprises:
performing operation test on the compiled target application package file;
if the test is not passed, comparing the target application program packages before and after compiling to obtain difference data;
and modifying the compiled target application program package according to the difference data.
10. The program compiling method according to claim 1 or 9 wherein the target compiler is a ark compiler.
11. A program compiling apparatus, characterized in that the apparatus comprises: a processing module, a compiling module, an executing module, wherein,
the processing module is used for acquiring a target application program package file and a configuration file; the configuration file is used for configuring the characteristic parameters of the application package file according to the characteristics of the target compiler;
the compiling module is used for compiling the application program package file by using the target compiler according to the configuration file;
and the execution module is used for loading and running the compiled application program package file on the target system.
12. The program compiling device of claim 11, wherein the processing module is specifically configured to, according to a preset operating frequency threshold, obtain an application package file that meets the preset operating frequency threshold as a target application package; wherein the operating frequency threshold is acceptable for user-defined settings;
the processing module writes a configuration file of the target application according to the name and the characteristic requirement of the target application; wherein the characteristic requirements of the target application include, but are not limited to: package file naming rules, compilation rules, coupling characteristics, loading characteristics.
13. The program compiling device of claim 12 wherein the processing module is further configured to configure the target client's CPU architecture and system so files as 64 bits; wherein the configured system is the target system.
14. An electronic device comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is used for executing the method of any one of claims 1-10 by calling the operation instruction.
15. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1-10.
CN202110128982.2A 2021-01-29 2021-01-29 Program compiling method and device, electronic equipment and readable storage medium Pending CN112882694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110128982.2A CN112882694A (en) 2021-01-29 2021-01-29 Program compiling method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110128982.2A CN112882694A (en) 2021-01-29 2021-01-29 Program compiling method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112882694A true CN112882694A (en) 2021-06-01

Family

ID=76051976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110128982.2A Pending CN112882694A (en) 2021-01-29 2021-01-29 Program compiling method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112882694A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114895959A (en) * 2022-05-06 2022-08-12 建信金融科技有限责任公司 Data processing method, device, equipment and computer storage medium
CN115543351A (en) * 2022-01-29 2022-12-30 荣耀终端有限公司 Application program installation method and electronic equipment
CN117152320A (en) * 2023-02-15 2023-12-01 荣耀终端有限公司 Image processing method and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543351A (en) * 2022-01-29 2022-12-30 荣耀终端有限公司 Application program installation method and electronic equipment
CN115543351B (en) * 2022-01-29 2023-09-12 荣耀终端有限公司 Application program installation method and electronic equipment
CN114895959A (en) * 2022-05-06 2022-08-12 建信金融科技有限责任公司 Data processing method, device, equipment and computer storage medium
CN117152320A (en) * 2023-02-15 2023-12-01 荣耀终端有限公司 Image processing method and electronic device

Similar Documents

Publication Publication Date Title
CN112882694A (en) Program compiling method and device, electronic equipment and readable storage medium
JP6195849B2 (en) Software code generation and caching
CN107077337B (en) System and method for executing application code compiled from two instruction set architectures
KR102084816B1 (en) Layout and execution of software applications using bpram
US20090024986A1 (en) Runtime code modification
US7743228B2 (en) Information processing apparatus and method for obtaining software processing log
RU2632163C2 (en) General unpacking of applications for detecting malicious programs
WO2022083316A1 (en) Application running method and apparatus, and computer storage medium
US8799889B2 (en) Application downloading
CN111176717B (en) Method and device for generating installation package and electronic equipment
US20200183669A1 (en) Improving emulation and tracing performance using compiler-generated emulation optimization metadata
CN112667246B (en) Application function expansion method and device and electronic equipment
CN110609687A (en) Compiling method, device, electronic equipment and storage medium
US20150067686A1 (en) Auto-Cloudifying Applications Via Runtime Modifications
CN116934330A (en) Method for calling intelligent contract, executing method, computer equipment and storage medium
EP2511820A1 (en) Bypassing user mode redirection
CN114090171A (en) Virtual machine creation method, migration method and computer readable medium
US8276132B1 (en) System and method for representing and managing a multi-architecture co-processor application program
US11500982B2 (en) Systems and methods for reliably injecting control flow integrity into binaries by tokenizing return addresses
CN114911541B (en) Processing method and device of configuration information, electronic equipment and storage medium
WO2023016481A1 (en) Data processing method and related apparatus
CN111971655A (en) Native runtime techniques for hypertext markup language graphical content
CN114490103A (en) Operating system interface calling method and device and electronic equipment
US8347310B1 (en) System and method for representing and managing a multi-architecure co-processor application program
CN115421875B (en) Binary translation method and device

Legal Events

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