Application processing method, device, electronic device and storage medium

By obtaining and encapsulating Java layer information and dynamically binding the standard library, the problem of difficulty and multiple steps in calling the standard library by Android system applications is solved, and a simplified standard library calling process is achieved.

CN114237614BActive Publication Date: 2024-09-13BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111525864.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2024-09-13
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

When existing Android system applications call the standard library, they need to bind the package name, class name, and method name through JNI, which makes the call difficult and requires many steps.

Method used

By obtaining the class files generated by system project compilation, use aspect-oriented programming to obtain Java layer information, including local method information, package information and class information, write it into the configuration file, and encapsulate it into an installation package. When the application is installed, it starts from the configuration Read this information from the file and dynamically bind it to the class object to avoid writing JNI directly.

Benefits of technology

It reduces the difficulty of calling the standard library and simplifies the operation steps, avoids the complex binding process of JNI, and improves the standard library calling efficiency of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237614B
    Figure CN114237614B
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for processing an application, wherein the method comprises: obtaining at least one class file generated by compiling a system project associated with the application; for each class file, if a standard library is called, obtaining the code for the class file to call the standard library by using aspect-oriented programming, reading the Java layer information corresponding to the class file from the code, and writing the Java layer information into a configuration file; and encapsulating the configuration file and the application into an installation package. The embodiment of the present invention can, to a certain extent, solve the technical problem that when an existing application uses an encapsulated standard library, it is necessary to bind the package name, class name, and method name in JNI, which results in a high difficulty in calling the standard library and a large number of operation steps, thereby reducing the difficulty in calling the standard library and simplifying the operation steps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for processing an application program, an electronic device, and a computer-readable storage medium. Background Art

[0002] Currently, most Android system applications can use encapsulated standard libraries (such as C / C++ libraries) by calling the native layer.

[0003] In the related art, the application needs to call the Native layer through the Java Native Interface (JNI for short). One calling method is to declare and implement an interface in a fixed format, and adapt the fixed format interface to the standard library in JNI; another calling method is to bind to the Native method in the form of package name, class name and method name search in the Java Native Interface Load (JNI_OnLoad) function of the Native layer. Regardless of which of the above calling methods is used, when there is a new class or a new business that needs to call the standard library, it is necessary to adapt the new class or new business to the standard library in JNI, which increases the difficulty and operation steps of calling the standard library. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a method and device for processing an application, as well as an electronic device and a computer-readable storage medium, which to some extent solve the problem that the calling of the standard library is difficult and has many operation steps. The specific technical solution is as follows:

[0005] In the first aspect of the implementation of the present invention, a method for processing an application is first provided, comprising: obtaining at least one class file generated by compiling a system project associated with the application; for each of the class files, if the class file calls a standard library, obtaining code for at least one class file calling the standard library using aspect-oriented programming, reading Java layer information corresponding to at least one class file from the code, and writing the Java layer information into a configuration file; the Java layer information includes local method information for calling the standard library, package information corresponding to the class file, and class information corresponding to the class file; and encapsulating the configuration file and the application into an installation package.

[0006] Optionally, the obtaining of at least one class file generated by compiling a system project associated with the application includes: registering a preset transformation application programming interface in a preset build plug-in, and after the transformation application programming interface is registered in the build plug-in, the build plug-in encapsulates the transformation application programming interface as a build task; the transformation application programming interface is used to receive at least one of the class files, and the build plug-in is an automated build tool; when the system project is compiled to generate at least one of the class files, running the build task, and during the running of the build task, the transformation application programming interface obtains at least one of the class files.

[0007] In the second aspect of the implementation of the present invention, a method for processing an application is also provided, comprising: during the installation process of the application, obtaining a configuration file encapsulated in the installation package of the application; reading Java layer information from the configuration file, the Java layer information including local method information, package information and class information of at least one class file calling a standard library; at least one of the class files is generated during compilation for a system project associated with the application; binding the local method information to a class object corresponding to the package information and the class information, and during the running of the application, the class object calls the standard library according to the local method information.

[0008] Optionally, binding the native method information to a class object corresponding to the package information and the class information includes: using multiple variables of a Java native interface native tool type array to respectively define the name, parameters, return value and pointer of the native method information; and dynamically registering the Java native interface native tool type array to the class object using a preset JNI function local registrar.

[0009] Optionally, the obtaining of the configuration file encapsulated in the installation package of the application includes: calling a preset Java native interface loading function to read the configuration file.

[0010] Optionally, before dynamically registering the Java native interface local tool type array to the class object using the local registrar of the preset JNI function, the method further includes: acquiring the class object using the class object loader of the pointer and a preset correspondence relationship, wherein the correspondence relationship indicates the correspondence between the package information, the class information and the class object.

[0011] In the third aspect of the implementation of the present invention, there is also provided an application processing device, including: a class file acquisition module, used to acquire at least one class file generated by compiling a system project associated with the application; an information writing module, used to, for each of the class files, if the class file calls a standard library, obtain the code of at least one class file calling the standard library by using aspect-oriented programming, read out Java layer information corresponding to at least one class file from the code, and write the Java layer information into a configuration file; the Java layer information includes local method information calling the standard library, package information corresponding to the class file, and class information corresponding to the class file; an installation package encapsulation module, used to encapsulate the configuration file and the application into an installation package.

[0012] Optionally, the class file acquisition module includes: a registration and encapsulation module, used to register a preset transformation application programming interface in a preset build plug-in, after the transformation application programming interface is registered in the build plug-in, the build plug-in encapsulates the transformation application programming interface as a build task; the transformation application programming interface is used to receive at least one of the class files, and the build plug-in is an automated build tool; a task running module, used to run the build task when the system project is compiled and at least one of the class files is generated, during the running of the build task, the transformation application programming interface obtains at least one of the class files.

[0013] In the fourth aspect of the implementation of the present invention, there is also provided an application processing device, comprising: a configuration file acquisition module, used to acquire the configuration file encapsulated in the installation package of the application during the installation process of the application; an information reading module, used to read Java layer information from the configuration file, the Java layer information including local method information, package information and class information of at least one class file calling a standard library; at least one of the class files is generated during compilation for a system project associated with the application; an information binding module, used to bind the local method information to a class object corresponding to the package information and the class information, wherein during the running of the application, the class object calls the standard library according to the local method information.

[0014] Optionally, the information binding module includes: an array definition module, which is used to use multiple variables of the Java native interface local tool type array to respectively define the name, parameters, return value and pointer of the local method information; and a dynamic registration module, which is used to dynamically register the Java native interface local tool type array to the class object using a preset JNI function local registrar.

[0015] Optionally, the configuration file acquisition module is used to call a preset Java native interface loading function to read the configuration file.

[0016] Optionally, the device also includes: a class object loading module, which is used to obtain the class object by using the class object loader of the pointer and a preset correspondence relationship before the dynamic registration module uses the local registrar of the preset JNI function to dynamically register the Java local interface local tool type array to the class object, and the correspondence relationship indicates the correspondence between the package information and the class information and the class object.

[0017] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any one of the above-mentioned application processing methods.

[0018] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned application processing methods.

[0019] The processing scheme for the application provided by the embodiment of the present invention obtains at least one class file generated by compiling the system project associated with the application. For each class file, if the class file calls the standard library, the code for the class file to call the standard library is obtained by using aspect-oriented programming, and the Java layer information corresponding to the class file is read from the code. The Java layer information includes the local method information for calling the standard library, the package information corresponding to the class file, and the class information corresponding to the class file. The Java layer information is written into the configuration file, and then the configuration file and the application are encapsulated into an installation package. When the application uses the encapsulated standard library, the relevant Java layer information can be obtained from the configuration file of the application, avoiding the writing of JNI. To a certain extent, it can solve the technical problem that when the existing application uses the encapsulated standard library, it needs to bind the package name, class name, and method name in JNI, which leads to the difficulty of calling the standard library and the large number of operation steps, thereby reducing the difficulty of calling the standard library and simplifying the operation steps. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0021] Figure 1 The present invention is a flowchart of a method for processing an application program according to an embodiment of the present invention.

[0022] Figure 2The present invention is a flowchart of another method for processing an application program according to an embodiment of the present invention.

[0023] Figure 3 The present invention is a flowchart of a solution for generating an application installation package under an Android system according to an embodiment of the present invention.

[0024] Figure 4 The present invention is a flowchart of a C / C++ library calling scheme under an Android system according to an embodiment of the present invention.

[0025] Figure 5 The present invention is a schematic diagram of the structure of a processing device for an application program according to an embodiment of the present invention.

[0026] Figure 6 A schematic diagram of the structure of another application processing device according to an embodiment of the present invention.

[0027] Figure 7 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0029] The embodiment of the present invention proposes a processing scheme for an application, which can mainly include two processing stages, wherein, during the execution of stage one, the Java layer information of calling the standard library, such as the package name, class name, and Native method information, is recorded in a configuration file, and the configuration file is encapsulated in the installation package of the application. During the execution of stage two, when the application is installed, the configuration file is read from the installation package, and the Native method information is bound to the class object corresponding to the package name and class name. During the operation of the application, the class object can call the standard library according to the Native method information.

[0030] like Figure 1 As shown, a flowchart of a method for processing an application program according to an embodiment of the present invention is shown. The method for processing an application program can be applied to a terminal or a server. The method for processing an application program is the execution process of the above-mentioned stage 1, and can specifically include the following steps.

[0031] Step 101: Obtain at least one class file generated by compiling a system project associated with an application.

[0032] In an embodiment of the present invention, a corresponding class file is generated when an Android project is compiled. In practical applications, compiling an Android project can generate multiple Class files.

[0033] Step 102, for each class file, if the class file calls a standard library, use aspect-oriented programming to obtain the code of at least one class file calling the standard library, read the Java layer information corresponding to at least one class file from the code, and write the Java layer information into the configuration file.

[0034] In an embodiment of the present invention, if a Class file calls a standard library, for example, a Class file calls a C / C++ library, the code for the Class file to call the C / C++ library is obtained using aspect-oriented programming (AOP for short), and the Java layer information corresponding to the Class file is read from the code. In actual applications, the Java layer information may include Native method information for calling the C / C++ library, package information corresponding to the Class file, and class information corresponding to the Class file. Among them, the package information may be a package name, and the class information may be a class name. The Java layer information is then written into a configuration file. For multiple Class files that call the C / C++ library, it is necessary to read out the respective Java layer information for each Class file, and all the read Java layer information is written into a configuration file.

[0035] Step 103: Package the configuration file and the application program into an installation package.

[0036] In an embodiment of the present invention, the configuration file and the application are packaged into an installation package, so that when the application is installed, the Java layer information is read from the configuration file, and then the standard library is called using the Java layer information.

[0037] The processing scheme for the application provided by the embodiment of the present invention obtains at least one class file generated by compiling the system project associated with the application. For each class file, if the class file calls the standard library, the code for the class file to call the standard library is obtained by using aspect-oriented programming, and the Java layer information corresponding to the class file is read from the code. The Java layer information includes the local method information for calling the standard library, the package information corresponding to the class file, and the class information corresponding to the class file. The Java layer information is written into the configuration file, and then the configuration file and the application are encapsulated into an installation package. When the application uses the encapsulated standard library, the relevant Java layer information can be obtained from the configuration file of the application, avoiding the writing of JNI. To a certain extent, it can solve the technical problem that when the existing application uses the encapsulated standard library, it needs to bind the package name, class name, and method name in JNI, which leads to the difficulty of calling the standard library and the large number of operation steps, thereby reducing the difficulty of calling the standard library and simplifying the operation steps.

[0038] In an exemplary embodiment of the present invention, an implementation method of obtaining at least one class file generated by compiling a system project associated with an application is to register a preset transformation application programming interface in a preset build plug-in, wherein the transformation application programming interface is used to receive at least one class file, and the build plug-in is an automated build tool. After the transformation application programming interface is registered in the build plug-in, the build plug-in encapsulates the transformation application programming interface as a build task. When the system project is compiled and at least one class file is generated, the build task is run. During the execution of the build task, the transformation application programming interface obtains at least one class file.

[0039] For example, when compiling an Android project, if you want to obtain the Class file generated during compilation, you can receive the Class file by writing a Transform Application Programming Interface. In addition, the Transform plugin is registered through the build (Gradle) plugin. Among them, the Gradle plugin is a project automation build tool. Everything in the Gradle plugin is based on two basic concepts: projects and tasks. Projects represent what is done in the Gradle plugin. A project consists of one or more tasks. Tasks represent some specific work to be performed during the project build process. The Transform Application Programming Interface is one of the many application programming interfaces in the Gradle plugin. Since the specific work performed in the Gradle plugin needs to be completed through tasks, the Transform Application Programming Interface registered by the Gradle plugin will be encapsulated into a build task (Gradle Task) by the Gradle plugin. In the Gradle Task encapsulation process, you can specify the category (Type) for the Gradle Task through "type:SomeType". The purpose of specifying the Type is to inform the Gradle plugin which base class Task the Gradle Task is derived from. In addition, you can also customize GradleTask in the following three ways: Method 1, define it in the configuration center file that carries trust information; Method 2, define it in the project; Method 3, define it in the project. Moreover, the Gradle Task will run after the Java compile task (Compile Task) is executed. Since the Gradle Task is encapsulated based on the Transform Application Programming Interface, running the Gradle Task is equivalent to executing the Transform Application Programming Interface. Moreover, the function of the Transform Application Programming Interface is to obtain the Class file, so the Class file can be obtained by running the Gradle Task.

[0040] like Figure 2As shown, a flowchart of another method for processing an application according to an embodiment of the present invention is shown. The method for processing an application can be applied to a terminal or a server. The method for processing an application is the execution process of the above-mentioned stage 2, and can specifically include the following steps.

[0041] Step 201: During the installation process of the application, a configuration file encapsulated in the installation package of the application is obtained.

[0042] In the embodiment of the present invention, when the application is installed using the installation package of the application, the configuration file can be obtained from the installation package of the application using the operating system in which the application is installed.

[0043] Step 202: Read Java layer information from the configuration file.

[0044] In an embodiment of the present invention, the Java layer information includes local method information, package information, and class information of at least one class file calling a standard library, etc. Among them, at least one class file is generated when compiling a system project associated with the application.

[0045] Step 203: Bind the local method information to the class object corresponding to the package information and the class information. During the running of the application, the class object calls the standard library according to the local method information.

[0046] In the embodiment of the present invention, the Class object is a specific instance of the Class file. After the Native method information is bound to the Class object, when the application is running, the Class object can directly call the standard library through the bound Native method information.

[0047] In an exemplary embodiment of the present invention, an implementation method of binding native method information to a class object corresponding to package information and class information is to use multiple variables of a Java native interface native tool type array to respectively define the name, parameter, return value and pointer of the native method information. The Java native interface native tool type array is dynamically registered to the class object using a preset JNI function native register.

[0048] In actual applications, system projects associated with applications, such as Android system projects, use a mapping table array of Java and C functions to define local method information. The type of the mapping table array is a Java Native Interface Native Method (JNINativeMethod) type array. The definition of JNINativeMethod is as follows:

[0049] typedef struct{

[0050] const char*name;

[0051] const char* signature;

[0052] void*fnPtr;

[0053] }JNINativeMethod;

[0054] The first variable name defines the name of the local method information. The second variable signature defines the parameters and return value of the local method information. The third variable fnPtr defines the pointer of the local method information. Then, the local register (RegisterNatives) is used to dynamically register JNINativeMethod to the Class object. RegisterNatives can be declared as:

[0055] jint RegisterNatives(jclass clazz, const JNINativeMethod*methods jintnMethods)

[0056] Among them, clazz represents the class whose native method information is to be registered. methods is an array of native method information, that is, JNINativeMethod. nMethods represents the length of JNINativeMethod. Therefore, the above RegisterNatives can be expressed as registering nMethods native method information to class clazz.

[0057] In an exemplary embodiment of the present invention, one implementation method of obtaining the configuration file encapsulated in the installation package of the application is to call a preset Java native interface loading function to read the configuration file. For example, the JNI_OnLoad function can be called to read the configuration file.

[0058] In an exemplary embodiment of the present invention, before dynamically registering the Java native interface local tool type array to the class object using the preset JNI function local register, the class object can be obtained using the class object loader of the pointer of the local method information and the preset correspondence relationship. For example, the Class object is obtained using the FindClass function of the Java native interface environment (JNI Environment, referred to as JNIEnv) and the correspondence relationship between the package information and the class information and the Class object.

[0059] Based on the above description of an embodiment of a method for processing an application, a solution for generating an application installation package under an Android system is introduced below. Figure 3 As shown, a schematic diagram of a process for generating an application installation package under an Android system is shown.

[0060] Step 301, customize the Transform application programming interface (Application Programming Interface, API for short).

[0061] After the Android project starts compiling, you can use the Transform API to receive and read the Class file.

[0062] Step 302, determine whether the current Class file calls a C / C++ library.

[0063] If the current Class file does not call the C / C++ library, then execute step 303 and determine whether the next Class file calls the C / C++ library. If the current Class file calls the C / C++ library, then execute step 304.

[0064] Step 303, use TransformAPI to read the next Class file.

[0065] Step 304, read the package name, class name and native method name from the code of the C / C++ library called by the current Class file, and store the package name, class name and native method name in the configuration file.

[0066] Furthermore, the logical information of how the Class file calls the C / C++ library is written into the configuration file.

[0067] After all Class files are acquired by using the Transform API and it is determined whether to call the C / C++ library, step 305 is executed.

[0068] Step 305: encapsulate the configuration file into the application installation package.

[0069] At this point, the application installation package is generated.

[0070] Based on the above description of an embodiment of a processing method for an application, a calling scheme of a C / C++ library under an Android system is introduced below. Figure 4As shown, a flowchart of a calling scheme of a C / C++ library under an Android system is shown. During the installation process of the application, step 401 is executed. In step 401, the Android system can call the JNI_OnLoad function and use the JNI_OnLoad function to read the configuration file in the application installation package. In step 402, the Native method information, package information and class information of each Class file calling the C / C++ library are read from the configuration file, and the Native method information, package information and class information are defined using the JNINativeMethod type array. In step 403, FindClass is used to obtain the Class object corresponding to the package information and class information, and RegisterNatives is used to dynamically register the JNINativeMethod type array to the Class object. In step 404, when the application is running, the Class object can directly call the C / C++ library according to the Native method information. At this point, the C / C++ library call is completed.

[0071] like Figure 5 FIG. 1 is a schematic diagram showing a structure of a processing device for an application program according to an embodiment of the present invention. The processing device for the application program can be applied to a terminal or a server. The processing device can specifically include the following modules.

[0072] A class file acquisition module 51 is used to acquire at least one class file generated by compiling a system project associated with an application program;

[0073] The information writing module 52 is used for obtaining, for each class file, a code for at least one class file to call the standard library by using aspect-oriented programming, reading Java layer information corresponding to at least one class file from the code, and writing the Java layer information into a configuration file; the Java layer information includes local method information for calling the standard library, package information corresponding to the class file, and class information corresponding to the class file;

[0074] The installation package packaging module 53 is used to package the configuration file and the application into an installation package.

[0075] In an exemplary embodiment of the present invention, the class file acquisition module 51 includes:

[0076] A registration and encapsulation module, used for registering a preset transformation application programming interface in a preset construction plug-in, after the transformation application programming interface is registered in the construction plug-in, the construction plug-in encapsulates the transformation application programming interface as a construction task; the transformation application programming interface is used to receive at least one of the class files, and the construction plug-in is an automated construction tool;

[0077] The task running module is used to run the construction task when the system project is compiled to generate at least one class file. During the running of the construction task, the transformation application programming interface obtains at least one class file.

[0078] like Figure 6 FIG. 1 is a schematic diagram showing the structure of another application processing device according to an embodiment of the present invention. The application processing device can be applied to a terminal or a server. The processing device can specifically include the following modules.

[0079] The configuration file acquisition module 61 is used to acquire the configuration file packaged in the installation package of the application during the installation process of the application;

[0080] An information reading module 62 is used to read Java layer information from the configuration file, wherein the Java layer information includes local method information, package information and class information of at least one class file calling a standard library; at least one class file is generated during compilation of a system project associated with the application;

[0081] The information binding module 63 is used to bind the local method information to the class object corresponding to the package information and the class information. During the running of the application, the class object calls the standard library according to the local method information.

[0082] In an exemplary embodiment of the present invention, the information binding module 63 includes:

[0083] An array definition module, used to respectively define the name, parameter, return value and pointer of the native method information by using multiple variables of the Java native interface native tool type array;

[0084] The dynamic registration module is used to dynamically register the Java native interface local tool type array to the class object by using a preset JNI function local register.

[0085] In an exemplary embodiment of the present invention, the configuration file acquisition module 61 is used to call a preset Java native interface loading function to read the configuration file.

[0086] In an exemplary embodiment of the present invention, the device further comprises:

[0087] A class object loading module is used to obtain the class object by using the class object loader of the pointer and a preset correspondence relationship before the dynamic registration module dynamically registers the Java local interface local tool type array to the class object by using the local registrar of the preset JNI function, wherein the correspondence relationship indicates the correspondence between the package information, the class information and the class object.

[0088] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0089] Memory 703, used for storing computer programs;

[0090] The processor 701, when used to execute the program stored in the memory 703, can implement the following steps:

[0091] Obtain at least one class file generated by compiling a system project associated with the application;

[0092] For each of the class files, if the class file calls a standard library, the code for at least one of the class files to call the standard library is obtained by using aspect-oriented programming, Java layer information corresponding to at least one of the class files is read from the code, and the Java layer information is written into a configuration file; the Java layer information includes local method information for calling the standard library, package information corresponding to the class file, and class information corresponding to the class file;

[0093] The configuration file and the application are packaged into an installation package.

[0094] The step of obtaining at least one class file generated by compiling a system project associated with the application program includes:

[0095] Registering a preset transformation application programming interface in a preset construction plug-in, after the transformation application programming interface is registered in the construction plug-in, the construction plug-in encapsulates the transformation application programming interface as a construction task; the transformation application programming interface is used to receive at least one of the class files, and the construction plug-in is an automated construction tool;

[0096] When the system project is compiled to generate at least one of the class files, the build task is executed. During the execution of the build task, the transformation application programming interface obtains at least one of the class files.

[0097] When the processor 701 is used to execute the program stored in the memory 703, it can also implement the following steps:

[0098] During the installation process of the application, obtaining a configuration file packaged in the installation package of the application;

[0099] Reading Java layer information from the configuration file, the Java layer information including local method information, package information and class information of at least one class file calling a standard library; at least one class file is generated during compilation of a system project associated with the application;

[0100] The local method information is bound to a class object corresponding to the package information and the class information. During the running of the application, the class object calls the standard library according to the local method information.

[0101] The step of binding the local method information to a class object corresponding to the package information and the class information comprises:

[0102] Using multiple variables of the Java native interface native tool type array, respectively define the name, parameters, return value and pointer of the native method information;

[0103] The Java native interface native tool type array is dynamically registered on the class object using a preset JNI function native register.

[0104] The obtaining of the configuration file packaged in the installation package of the application comprises:

[0105] Call a preset Java native interface loading function to read the configuration file.

[0106] Before dynamically registering the Java native interface native tool type array to the class object using the local registrar of the preset JNI function, the method further includes:

[0107] The class object is acquired by using the class object loader of the pointer and a preset corresponding relationship, wherein the corresponding relationship indicates that the package information, the class information and the class object correspond to each other.

[0108] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0109] The communication interface is used for communication between the above terminal and other devices.

[0110] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0111] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0112] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the processing method of the application program described in any of the above embodiments.

[0113] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the method for processing an application program described in any one of the above embodiments.

[0114] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0115] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0116] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0117] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for processing an application, characterized in that: include: Registering a preset transformation application programming interface in a preset build plug-in; after the transformation application programming interface is registered in the build plug-in, the build plug-in encapsulates the transformation application programming interface as a build task; the transformation application programming interface is used to receive at least one of the class files, and the build plug-in is an automated build tool; when the system project is compiled and at least one of the class files is generated, the build task is run, and during the running of the build task, the transformation application programming interface obtains at least one of the class files; For each of the class files, if the class file calls a standard library, the code for at least one of the class files to call the standard library is obtained by using aspect-oriented programming, Java layer information corresponding to at least one of the class files is read from the code, and the Java layer information is written into a configuration file; logical information for the class file to call the standard library is written into the configuration file; the Java layer information includes local method information for calling the standard library, package information corresponding to the class file, and class information corresponding to the class file; The configuration file and the application are packaged into an installation package.

2. A method for processing an application, characterized in that: include: During the installation process of the application, obtaining a configuration file packaged in the installation package of the application; Reading Java layer information from the configuration file, the Java layer information including local method information, package information and class information of at least one class file calling a standard library; at least one class file is generated during compilation of a system project associated with the application; Using multiple variables of the Java native interface native tool type array, respectively define the name, parameter, return value and pointer of the native method information; Dynamically registering the Java native interface local tool type array to the class object using a preset JNI function local register; During the running of the application program, the class object calls the standard library according to the local method information.

3. The method according to claim 2, characterized in that The obtaining of the configuration file packaged in the installation package of the application comprises: Call a preset Java native interface loading function to read the configuration file.

4. The method according to claim 2, characterized in that: Before dynamically registering the Java native interface native tool type array to the class object using the local registrar of the preset JNI function, the method further includes: The class object is acquired by using the class object loader of the pointer and a preset corresponding relationship, wherein the corresponding relationship indicates that the package information, the class information and the class object correspond to each other.

5. A processing device for an application, characterized in that: include: A class file acquisition module is used to register a preset transformation application programming interface in a preset construction plug-in. After the transformation application programming interface is registered in the construction plug-in, the construction plug-in encapsulates the transformation application programming interface as a construction task. The transformation application programming interface is used to receive at least one of the class files. The construction plug-in is an automated construction tool. When the system project is compiled and at least one of the class files is generated, the construction task is run. During the running of the construction task, the transformation application programming interface obtains at least one of the class files. An information writing module is used for obtaining, for each class file, a code for at least one class file to call the standard library by using aspect-oriented programming, reading Java layer information corresponding to at least one class file from the code, and writing the Java layer information into a configuration file; writing logic information of the class file calling the standard library into the configuration file; the Java layer information includes local method information for calling the standard library, package information corresponding to the class file, and class information corresponding to the class file; The installation package packaging module is used to package the configuration file and the application into an installation package.

6. A processing device for an application, characterized in that: include: A configuration file acquisition module, used to acquire the configuration file packaged in the installation package of the application during the installation process of the application; An information reading module, used for reading Java layer information from the configuration file, wherein the Java layer information includes local method information, package information and class information of at least one class file calling a standard library; at least one class file is generated during compilation of a system project associated with the application; An information binding module, used to use multiple variables of the Java native interface native tool type array to respectively define the name, parameter, return value and pointer of the native method information; Dynamically registering the Java native interface local tool type array to the class object using a preset JNI function local register; During the running of the application program, the class object calls the standard library according to the local method information.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 4 when executing a program stored in a memory.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.