WO2022016991A1 - 一种应用程序的处理方法、装置、设备及介质 - Google Patents
一种应用程序的处理方法、装置、设备及介质 Download PDFInfo
- Publication number
- WO2022016991A1 WO2022016991A1 PCT/CN2021/095992 CN2021095992W WO2022016991A1 WO 2022016991 A1 WO2022016991 A1 WO 2022016991A1 CN 2021095992 W CN2021095992 W CN 2021095992W WO 2022016991 A1 WO2022016991 A1 WO 2022016991A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bytecode
- file
- optimization
- optimized
- processed
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
- G06F9/45508—Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- the present application relates to the field of computer technology, and in particular, to a method for processing an application program, an apparatus for processing an application program, a processing device for an application program, and a computer-readable storage medium.
- the size of the installation package of the application is constantly growing.
- the size of the installation package is closely related to the download conversion rate.
- the size of the installation package of the application will also have a greater impact on the promotion of the application.
- an Android (Android, a mobile operating system) application platform stipulates that the installation package size exceeds 100 megabytes of applications. It can only be uploaded in the form of an extended file, which is not conducive to the promotion of the application. It can be seen that when building or iterating the installation package of an application, the size of the installation package needs to be strictly controlled.
- the size of the installation package is mainly controlled by obfuscating and compressing the installation package of the application.
- Embodiments of the present application provide an application processing method, apparatus, device, and computer-readable storage medium, which can achieve targeted compression to a greater degree and ensure compatibility and stability.
- an embodiment of the present application provides a method for processing an application, the method comprising:
- the present application provides a processing device for an application program, the device comprising:
- an acquisition unit for obtaining the bytecode file to be processed from the archive file of the target application, wherein the archive is used to build or update the installation package of the target application;
- a processing unit configured to traverse the bytecode file to be processed to collect bytecodes corresponding to N optimization tasks, where N is a positive integer; wherein one optimization task is used to optimize one type of bytecode; and It is used to perform optimization processing on the collected bytecode corresponding to each optimization task to obtain an optimized bytecode file.
- the present application provides an application processing device, the device includes:
- a processor adapted to execute a computer program
- a computer-readable storage medium where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, realizes the processing method of the above-mentioned application program.
- the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor and execute the processing method of the above-mentioned application program.
- the present application provides a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium.
- the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned processing method of the application program.
- Fig. 1a shows a schematic diagram of files required for building an installation package of an application provided by an exemplary embodiment of the present application
- Fig. 1b shows a schematic diagram of files required for updating an installation package of an application program provided by an exemplary embodiment of the present application
- Fig. 1c shows a process diagram of building an installation package of an application provided by an exemplary embodiment of the present application
- FIG. 2 shows a flowchart of an application processing method provided by an exemplary embodiment of the present application
- FIG. 3 shows a flowchart of another application processing method provided by an exemplary embodiment of the present application
- Figure 4a shows a flowchart of a system annotation optimization task provided by an exemplary embodiment of the present application
- Figure 4b shows a flowchart of a source file format optimization task provided by an exemplary embodiment of the present application
- Figure 4c shows a flowchart of restoring the bytecode of the source file format provided by an exemplary embodiment of the present application
- Figure 4d shows a schematic diagram of a coding tree provided by an exemplary embodiment of the present application
- FIG. 4e shows a flowchart of a global variable optimization task provided by an exemplary embodiment of the present application
- FIG. 4f shows a flowchart of an access method optimization task provided by an exemplary embodiment of the present application
- FIG. 5 shows a schematic structural diagram of an apparatus for processing an application program provided by an exemplary embodiment of the present application
- FIG. 6 shows a schematic structural diagram of an application processing device provided by an exemplary embodiment of the present application.
- An application's installation package is a self-extractable collection of files that contains all the files installed by the application.
- Running the installation package of the application program can release all the files of the application program to the hard disk of the computer device, and complete the work of modifying the registry, modifying the system settings, creating shortcuts, etc., so that the computer device can use the functions of the application program.
- the installation environment of the application is different, and the format of the installation package of the application is also different.
- the installation environment here refers to the operating system environment of the computer device, for example, the application in the Android (Android, a mobile operating system) environment.
- the installation package is in the APK (Android application package, Android application package) format; the installation package of the application in the IOS (a mobile operating system) environment is in the IPA (iPhone Application, Apple application package) format.
- APK Android application package, Android application package
- IOS a mobile operating system
- IPA iPhone Application, Apple application package
- An application's archive file is a file used to aggregate the application's class files, metadata (that is, data used to describe properties), and resources (such as text, pictures, etc.); it can be used to build The installation package of the application can also be used to update the installation package of the application.
- Fig. 1a shows a schematic diagram of files required to construct an installation package of an application provided by an exemplary embodiment of the present application; the installation package of the application shown in Fig. 1a is an APK, and the archive file of the APK is a Jar package. As shown in Figure 1a, the APK is obtained by co-packaging and constructing M archive files (Jar packages) and other files (eg, entry files), where M is a positive integer.
- FIG. 1b shows a schematic diagram of files required for updating an installation package of an application provided by an exemplary embodiment of the present application
- the updated APK is a new archive file to the old archive file in the original APK Replaced, or by adding the new archive as an addition to the original APK.
- the archive file of the application program contains a class (Class) file
- the class (Class) file is a binary file with a suffix of ".class" generated by the compiler after compiling the source file of the application program.
- Class files can be converted into bytecode files.
- a bytecode file is a binary file that contains an executable program and consists of a sequence of operation code/data pairs. It is a file preprocessed by a compiler and is an application program. Existing form of the executable file.
- the embodiment of the present application proposes an application processing scheme, which can effectively compress the size of the installation package of the application.
- the scheme has the following characteristics: (1) The design goals of the scheme are universality and scalability , High performance is the main.
- Versatility refers to: supporting all applications to quickly and easily access this solution to achieve the goal of compressing the size of the installation package; scalability refers to: supporting the expansion of new optimized forms and the ability to quickly access the solution, through continuous expansion and optimization It can continuously enhance the bytecode compression capability; high performance means: this solution will be involved in the construction process of the installation package of the application. After the construction process of the installation package of the application is connected to this solution, it can reduce the The resulting compile time delta. (2) The solution supports the construction process of accessing the installation package of the application in the form of a plug-in.
- the obfuscation task or JarMerge (Jar file merging) task of the installation package of the application is removed, and the obfuscation task is collected or
- the bytecode file in the archive file is optimized in a targeted and extreme manner to reduce the size of the bytecode file, which is conducive to reducing the size of the target application after updating or building
- the size of the post-installation package, and it has good compatibility and stability; the application can optimize the bytecode file by using the plug-in in the build script, so as to ensure the generality of the optimization scheme.
- the number of optimization tasks for bytecode files can be set as needed to support the expansion of optimization tasks, which can continuously increase the compression and optimization capabilities of bytecode files, and further control the size of the installation package after the target application is updated or built. .
- the archive file refers to a file used to update and replace the installation package of the target application, or a file used to construct the installation package of the target application.
- the bytecode files in the archive files included in the installation package of the target application can be optimized in a targeted and extreme manner to reduce the size of the bytecode files, thereby helping to reduce the target application
- the size of the installation package after the program is updated or built, and has good compatibility and stability; and the number of optimization tasks can be set as needed, supports the expansion of optimization tasks, and can continuously increase the compression and optimization capabilities of bytecode files. Further control over the size of the target application's post-update or post-build installation package.
- Fig. 1c shows a construction process diagram of an application installation package provided by an exemplary embodiment of the present application.
- the embodiment of the present application designs a processing method of an application program in the construction process of the installation package of the application program, and the method mainly collects the bytecode to be optimized from the bytecode file of the application program, These bytecodes are then optimized (such as deleted or replaced) to achieve the purpose of compressing the installation package of the application.
- the processing method of the application program provided by this application can also be used to optimize the bytecode in the archive file included in the installation package of the application program, so as to compress the application program.
- the purpose of the installation package is a construction process diagram of an application installation package provided by an exemplary embodiment of the present application.
- the application processing method can be applied to a terminal device or a server
- the terminal device can include but is not limited to: smart phones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, mobile Internet Devices (Mobile Internet Devices, referred to as MID) and other computer equipment
- the server may include but is not limited to a cluster server, which is not limited in this embodiment of the present application.
- the processing flow of the application mainly includes: 1 Obtaining the bytecode file to be processed from the archive file (jar package) of the target application; 2 Traversing the bytecode file to be processed To collect bytecodes corresponding to N optimization tasks (such as annotation optimization tasks, debugging information optimization tasks, global variable optimization tasks, etc.), N is a positive integer; the value of N can be set according to actual needs, such as N for 3, 5 and so on. The larger the value of N, the more comprehensive the optimization task, and the better the compression effect of the bytecode file; at the same time, the complexity of the optimization execution is correspondingly higher, and the time and resources are relatively high.
- N optimization tasks such as annotation optimization tasks, debugging information optimization tasks, global variable optimization tasks, etc.
- the embodiment of the present application focuses on multi-dimensional optimization of the bytecode file corresponding to the archived file.
- the to-be-processed bytecode file is obtained from the archived file of the target application, and N optimization tasks are set as needed;
- the bytecodes corresponding to the N optimization tasks in the bytecode file are processed, and then optimization processing is performed on the bytecodes corresponding to each of the collected optimization tasks to obtain an optimized bytecode file.
- the bytecode files in the archive files included in the installation package of the target application can be optimized in a targeted and extreme manner to reduce the size of the bytecode files.
- FIG. 2 shows a flowchart of an application processing method provided by an exemplary embodiment of the present application.
- the application processing method includes but is not limited to the following steps 201 to 203 .
- a method for processing an application program provided by the embodiment of the present application is described in detail below:
- the target application can be a browser application, a shopping application, a game application, and the like.
- the processing device of the application program decodes the archive file of the target application program to obtain the class file of the target application program, and then encodes and converts the class file to obtain the to-be-processed bytecode file of the target application program.
- one optimization task can be used to optimize one type of bytecode; for example, optimization task 1 can be used to optimize the bytecode representing system annotations, and optimization task 2 can be used to optimize the bytecode representing the source program format. optimize, etc.
- the value of N can be set as needed; for example, considering the balance between the compression effect of the bytecode file and the resource consumption, the value of N is set to 5. For another example, if three types of bytecodes in the bytecode file of application 1 are required to be optimized, the value of N is 3. It can be seen that the application processing method provided by the embodiment of the present application can be compatible with multiple optimization tasks, and can optimize multiple types of bytecodes, thereby ensuring compatibility and scalability.
- Optimization processing includes but is not limited to modification processing and deletion processing; for example, the processing device of the application performs deletion processing on the bytecode corresponding to optimization task 1, and changes the bytecode "cafe 01" corresponding to optimization task 2 to "ba” .
- the embodiment of the present application focuses on multi-dimensional optimization of the bytecode file corresponding to the archived file.
- the to-be-processed bytecode file is obtained from the archived file of the target application, and N optimization tasks are set as needed;
- the bytecode corresponding to the N optimization tasks in the section code file is optimized, and the optimized bytecode file is obtained by performing optimization processing on the bytecode corresponding to each collected optimization task.
- the bytecode files in the archive files included in the installation package of the target application can be optimized in a targeted and extreme manner to reduce the size of the bytecode files.
- FIG. 3 shows a flowchart of another application processing method provided by an exemplary embodiment of the present application.
- the application processing method includes but is not limited to the following steps 301 to 322 .
- a method for processing an application program provided by the embodiment of the present application is described in detail below:
- a class is a cohesive package composed of certain metadata.
- a class includes interfaces and structures.
- One or more classes are aggregated into a class (Class) file, and a class file is a binary file with a suffix named ".class" generated by the compiler after compiling the classes in the source file of the application.
- the first encoding conversion processing here refers to the process of converting a class file into a computer-identifiable bytecode file to be processed by a compiler; the bytecode file to be processed is stored in the form of bytes in the processing device of the application program. in memory.
- the processing device of the application program traverses the bytecode file to be processed at least once, parses the classes in the bytecode file to be processed and the elements contained in each class, and obtains the inheritance relationship of each class, the so-called inheritance
- a new class is derived from an existing class.
- the new class can absorb the data attributes and behaviors of the existing class, and can extend new capabilities.
- An existing class is called a parent class, and a new class is called a child class.
- the so-called inheritance relationship refers to the parent-child relationship between the parent class and the child class.
- the inheritance relationship includes: the child class inherits the characteristics and behavior of the parent class, so that the object (instance) of the child class has the attributes and methods of the parent class; or the child class inherits the characteristics and behaviors of the parent class.
- the parent class inherits the method, so that the child class has the same behavior as the parent class.
- Construct the data structure of the target application program according to the inheritance relationship of each class the data structure includes the inheritance relationship of each class in the target application program; the data structure may include but not limited to: array structure, tree structure and so on. Taking the tree structure as an example, the present application can construct an inheritance tree including all classes according to the inheritance relationship of each class in the target application.
- the first bytecode refers to the bytecode used to represent the system annotation in the bytecode file to be processed; wherein, the system annotation is used to represent various reflection information about the class (and methods and fields), and the system annotation may specifically include But not limited to: getEnclosingMethod, getSimpleName, isLocalOrAnonymousClass, getGenericSuperclass, getTypeParameters.
- Fig. 4a shows a flowchart of a system annotation optimization task provided by an exemplary embodiment of the present application.
- the system annotation optimization task includes two stages: "information collection” and "optimization execution". Assuming that the target bytecode is any first bytecode in the first bytecode set, in the information collection stage, the processing device of the application first determines whether the system annotation represented by the target bytecode is used, that is, to determine whether the target bytecode is used.
- the class to which the section code belongs calls the system annotation method; if the system annotation represented by the target bytecode is used, it is further judged whether the class to which the system annotation represented by the target bytecode belongs is an interface implementation class, or, according to the data
- the inheritance relationship in the structure determines whether the class to which the system annotation represented by the target bytecode belongs has a parent class; if the class to which the system annotation represented by the target bytecode belongs is an interface implementation class, or the system annotation represented by the target bytecode belongs to If the class has a parent class, it is determined that the target bytecode meets the protection conditions, and the target bytecode is added to the whitelist.
- the first bytecode in the whitelist satisfies the following conditions: (1) the system annotation represented by the first bytecode in the whitelist is used; (2) the system represented by the first bytecode in the whitelist
- the class to which the annotation belongs has a parent class, or the class to which the system annotation represented by the first bytecode in the whitelist belongs is the interface implementation class.
- the processing device of the application program deletes the first bytecodes in the bytecode file to be processed that belong to the first bytecode set and do not belong to the whitelist to obtain an optimized bytecode file.
- the system annotation represented by the deleted first bytecode satisfies the following conditions: the system annotation represented by the deleted first bytecode is not used, and the system annotation represented by the deleted first bytecode
- the class to which the system annotation belongs has no parent class, and the class to which the system annotation represented by the deleted bytecode belongs is not an interface implementation class.
- the processing device of the application can adaptively filter and delete the bytecode representing the system annotation that can be deleted in the bytecode file to be processed according to the protection conditions, and then the optimized bytecode file.
- the to-be-processed bytecode file can be compressed on the premise of ensuring the availability and stability of the application program.
- FIG. 4b shows a flowchart of a source file format optimization task provided by an exemplary embodiment of the present application.
- the processing device of the application first collects bytecodes in all source file formats, that is, traverses the bytecode file to be processed to obtain the second bytecode, where the second bytecode refers to the word to be processed
- the bytecode in the bytecode file is used to represent the source file (sourceFile) format
- the source file format is the filename used to mark the code file (such as a java file).
- the application's processing device re-encodes the bytecode in the source file format, resulting in a simplified bytecode.
- the processing device of the application program constructs the Huffman tree according to the frequency (number of times) of occurrence of the second bytecode in the bytecode file to be processed.
- Fig. 4c shows a flowchart of restoring bytecodes in a source file format provided by an exemplary embodiment of the present application.
- the processing device of the application program imports a mapping file, and then restores the bytecode in the simplified source file format to the original bytecode in the source file format according to the mapping file.
- the processing device of the application program can compress the bytecode used to represent the source file format through the coding tree, and then obtain the optimized bytecode file; Restore the compressed bytecode.
- the optimization configuration information includes the identification of the debugging information to be optimized (such as the package name of the debugging information, the regular expression of the package name of the debugging information); the debugging information includes the line number and the local variable table, and the debugging information is reserved in the pending processing.
- Bytecode files present a security risk to the target application.
- the optimization configuration information of the debugging information optimization task may be pre-configured, or may be configured by the user according to actual requirements when compressing the installation package of the target application.
- the third bytecode refers to a bytecode for representing debug information to be optimized.
- the processing device of the application program can dynamically delete the bytecode used to represent the debugging information in the to-be-processed bytecode file according to the optimization configuration information, thereby obtaining an optimized bytecode file.
- FIG. 4e shows a flowchart of a global variable optimization task provided by an exemplary embodiment of the present application.
- the processing device of the application first collects the bytecode corresponding to the initial value of the global variable in the bytecode file to be processed, obtains the bytecode set used to represent the initial value of the global variable, and according to the The bytecode collection determines the initial value corresponding to each global variable.
- the constructor it is judged whether the initialized value of each global variable is a preset value, that is, the fourth bytecode is filtered out from the bytecode file to be processed; among them, the constructor is mainly used to initialize the object when the object is created, that is An initial value is assigned to an object member variable, and the fourth bytecode refers to a bytecode used to represent the initial value of the global variable whose initial value is a preset value.
- the fourth bytecode refers to the bytecode used to represent the initial value of the global variable whose initial value is 0 (that is, the fourth bytecode refers to the bytecode used to represent the initial value of 0).
- Table 2 is an invalid variable initialization table that supports automatic deletion provided by the embodiment of the present application.
- Table 2 shows the invalid initial values corresponding to global variables under each data type.
- the processing device of the application program can delete the bytecode corresponding to the invalid initialization value in the bytecode file to be processed, thereby obtaining an optimized bytecode file.
- step 316 For the specific implementation of step 316, reference may be made to the specific implementation of step 303, which will not be repeated here. It should be noted that, if the optimization task includes the system annotation optimization task, and the processing device of the application has constructed the data structure of the target application program when executing the system annotation optimization task, this step will not be performed; similarly, if the optimization task includes the global variable optimization task, and the processing device of the application has constructed the data structure of the target application program when performing the global variable optimization task, then when the system annotation optimization task is performed, step 303 is not performed.
- FIG. 4f shows a flowchart of an access method optimization task provided by an exemplary embodiment of the present application.
- the access method optimization task consists of two phases: "information collection” and "optimization execution".
- the processing device of the application screens the fifth bytecode in the bytecode file to be processed, the fifth bytecode refers to the bytecode used to represent the target access method, and the target access method can be the target application Any access method in the program; in one embodiment, the access method refers to the Access method, which is used to bridge the nested class and the private member, so that the nested class and the private member can access each other.
- a nested class refers to another class defined in one class, for example, if class 1 is a class defined in class 2, class 1 is a nested class of class 2.
- Private members are data and functions that are private in a class.
- the processing device of the application extracts the information to be optimized, and the information to be optimized includes the access member corresponding to the target access method and the calling method of the access member.
- the processing device of the application program analyzes the target access method to determine the access member, and determines the calling method of the access member according to the inheritance relationship of each class in the data structure.
- the application's processing device modifies the visibility of the access members.
- the processing device of the application program changes the visibility of the access member from private to package-visible, that is, modifies the private member to the package-visible member, and correspondingly modifies the calling method of the access member , that is, the original access through the Access method is changed to direct access.
- the processing device of the application program updates the corresponding bytecode in the bytecode file to be processed according to the modification in step 319; for example, the bytecode used to indicate the private member corresponding to the access method is modified as The bytecode of the corresponding package-visible member. Then delete the fifth bytecode in the to-be-processed bytecode file to obtain an optimized bytecode file.
- the processing device of the application program can modify the access member corresponding to the access method and the calling method of the member according to the access method and the inheritance relationship of each class in the data structure, and delete the access method, and then obtain Optimized bytecode file.
- the value of N is 5, and the N optimization tasks include: the system corresponding to step 303-step 306 Annotation optimization task, source file format optimization task corresponding to step 307-step 310, debugging information optimization task corresponding to step 311-step 313, global variable optimization task corresponding to step 314 and step 315, and access method corresponding to step 316-step 320 optimization tasks.
- the processing device of the application may perform one or more of the above optimization tasks according to actual requirements, and each optimization task may be performed in parallel or in a specified order.
- This embodiment of the present application is not limited; for example, the processing device of the application may only execute the global variable optimization task and the access method optimization task, and the global variable optimization task and the access method optimization task may be executed in parallel, or may be executed first
- the access method optimization task executes the global variable optimization task.
- the application processing method provided by the present application can also add other optimization tasks during use; for example, an R file optimization task can also be added, wherein the R file is used to declare static variables. document.
- the processing device of the application program detects whether the optimized bytecode file satisfies the encoding specification; for example, detects whether each bytecode in the optimized bytecode file corresponds to Whether the members can be accessed normally. If the optimized bytecode file does not meet the encoding specification, the optimization task will be abandoned and other optimization tasks will continue to be performed. If the optimized bytecode file meets the encoding specification, the application's The processing device detects whether the N optimization tasks have been completed. If the N optimization tasks have been completed, the optimized bytecode file is subjected to a second encoding conversion process to obtain an updated class file.
- the second encoding conversion process refers to the process of converting the optimized bytecode file into an updated class file by the compiler, and the optimized bytecode file is stored in the memory of the processing device of the application in the form of bytes , and the updated class file is stored in the hard disk of the processing device of the application program.
- the processing device of the application program encodes the updated class file to obtain the updated archive file, and uses the updated archive file to construct the installation package of the target application, or uses the updated archive file to construct the installation package of the target application.
- the file updates the installation package of the target application (for example, the updated archive file is used to replace the corresponding original archive file in the installation package of the target application).
- the application processing method provided by the embodiments of the present application may be used in combination with an existing application installation package compression solution (eg, a proguard solution).
- a proguard solution e.g. a proguard solution
- the experimental data shows that after using the proguard scheme to process the target application, and then compressing the bytecode of the target application processed by the proguard scheme by using the application processing method provided in the embodiment of the present application, the bytecode can be compressed.
- the size of the target application is compressed by 12%; if the bytecode of the target application is compressed by the application processing method provided by the embodiment of the present application alone, the size of the bytecode can be compressed by 25%.
- the embodiment of the present application focuses on multi-dimensional optimization of the bytecode file corresponding to the archive file of the target application program, obtains the bytecode file to be processed from the archive file of the target application program, and uses five optimization tasks to separately perform the bytecode file to be processed.
- the section code file is optimized.
- the bytecode files in the archive files included in the installation package of the target application can be optimized to the greatest extent, and the size of the bytecode files can be reduced, thereby helping to reduce the target application
- the size of the installation package after the program is updated or built, and has good compatibility and stability; and the number of optimization tasks can be set as needed, supports the expansion of optimization tasks, and can continuously increase the compression and optimization capabilities of bytecode files. Further control over the size of the target application's post-update or post-build installation package.
- FIG. 5 shows a schematic structural diagram of an application processing apparatus provided by an exemplary embodiment of the present application.
- the application processing apparatus may be mounted on the application processing device in the above method embodiment.
- the processing device of the application can be a plug-in, such as a compression plug-in; when the installation package of the application needs to be updated or constructed, the purpose of compressing the installation package of the application can be achieved by calling the compression plug-in.
- the processing apparatus for the application program provided by the embodiment of the present application has strong versatility.
- the processing device of the application program shown in FIG. 5 may be used to execute some or all of the functions in the method embodiments described in the foregoing FIG. 2 and FIG. 3 .
- the detailed description of each unit is as follows:
- an obtaining unit 501 configured to obtain a bytecode file to be processed from an archive file of a target application, wherein the archive is used to build or update an installation package of the target application;
- a processing unit 502 configured to traverse the bytecode file to be processed to collect bytecodes corresponding to N optimization tasks respectively, where N is a positive integer; wherein, one optimization task is used to optimize one type of bytecode; and performing optimization processing on the collected bytecodes corresponding to each optimization task to obtain an optimized bytecode file.
- the processing unit 502 is further configured to obtain the bytecode file to be processed from the archive file of the target application, and is specifically configured to:
- a first encoding conversion process is performed on the class file to obtain a to-be-processed bytecode file.
- the optimization task includes a system annotation optimization task
- the processing unit 502 is further configured to traverse the to-be-processed bytecode file to collect bytecodes corresponding to the N optimization tasks, specifically for:
- the collected bytecode corresponding to the system annotation optimization task refers to the first bytecode located in the first bytecode set and not belonging to the whitelist.
- the target bytecode is set to be any one of the first bytecode set; the processing unit 502 is also used to judge whether the target bytecode satisfies the protection condition, and is specifically used for:
- the class to which the target bytecode belongs calls the system annotation method, it is judged whether the class to which the target bytecode belongs is an interface implementation class, or the target bytecode is judged according to the inheritance relationship in the data structure of the target application. Whether the class to which it belongs has a parent class; wherein, the data structure includes the inheritance relationship of each class in the target application;
- the class to which the target bytecode belongs is an interface implementation class, or if the class to which the target bytecode belongs has a parent class, it is determined that the target bytecode satisfies the protection conditions.
- the processing unit 502 is further configured to perform optimization processing on the collected bytecodes corresponding to each optimization task to obtain an optimized bytecode file, which is specifically used for:
- the optimization task includes a source file format optimization task; the collected bytecode corresponding to the source file format optimization task is the second bytecode in the bytecode file to be processed, and the second bytecode is Used to represent the bytecode of the source file format; the processing unit 502 is also used to perform optimization processing on the collected bytecode corresponding to each optimization task, to obtain an optimized bytecode file, which is specifically used for:
- the second bytecode in the to-be-processed bytecode file is replaced by the simplified bytecode to obtain the optimized bytecode file;
- the simplified bytecode can be restored to the second bytecode by using the mapping file.
- the optimization task includes a debugging information optimization task; the processing unit 502 is further configured to traverse the to-be-processed bytecode file to collect bytecodes corresponding to the N optimization tasks respectively, and is specifically used for:
- optimization configuration information where the optimization configuration information includes an identifier of the debugging information to be optimized
- the processing unit 502 is further configured to perform optimization processing on the collected bytecode corresponding to each optimization task to obtain an optimized bytecode file, which is specifically used for:
- the optimization task includes a global variable optimization task; the processing unit 502 is further configured to traverse the bytecode file to be processed to collect bytecodes corresponding to the N optimization tasks respectively, specifically for:
- the fourth bytecode is filtered out from the to-be-processed bytecode file, where the fourth bytecode is a bytecode used to represent an initial value of a global variable whose initial value is a preset value.
- the processing unit 502 is further configured to perform optimization processing on the collected bytecodes corresponding to each optimization task to obtain an optimized bytecode file, which is specifically used for:
- the optimization task includes an access method optimization task; the processing unit 502 is further configured to traverse the to-be-processed bytecode file to collect bytecodes corresponding to the N optimization tasks respectively, and is specifically used for:
- the fifth bytecode in the bytecode file to be processed is the bytecode used to represent the target access method, and the target access method is any access method in the target application;
- the information to be optimized is determined according to the target access method and the inheritance relationship of each class in the data structure, and the to-be-optimized information includes the access member corresponding to the target access method and the calling method of the access member.
- the processing unit 502 is further configured to perform optimization processing on the collected bytecodes corresponding to each optimization task to obtain an optimized bytecode file, which is specifically used for:
- the bytecode corresponding to the calling method of the access member is updated according to the modification, and the fifth bytecode is deleted to obtain an optimized bytecode file.
- processing unit 502 is further configured to:
- the second encoding conversion process is performed on the optimized bytecode file to obtain an updated class file;
- the updated class file is encoded to obtain the updated archive file.
- step 201 shown in FIG. 2 may be performed by the acquiring unit 501 shown in FIG. 5
- steps 202 and 203 may be performed by the processing unit 502 shown in FIG. 5
- steps 304, 307 and 311 shown in FIG. 3 can be performed by the acquisition unit 501 shown in FIG. 5, and steps 301-303, 305, 306, 308-310 and 312-322 can be shown in Figure
- the processing unit 502 shown in 5 executes.
- the apparatus for processing an application program may also include other units.
- these functions may also be implemented with the assistance of other units, and may be implemented by cooperation of multiple units.
- a general-purpose computing device such as a computer including processing elements such as a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements.
- CPU central processing unit
- RAM random access storage medium
- ROM read-only storage medium
- Run a computer program capable of executing the steps involved in the corresponding methods as shown in Figures 2 and 3, to construct a processing device for an application as shown in Figure 5, and to implement the implementation of the present application Example application processing method.
- the computer program can be recorded on, for example, a computer-readable recording medium, and loaded in the above-mentioned computing apparatus through the computer-readable recording medium, and executed therein.
- FIG. 6 shows a schematic structural diagram of an application processing device provided by an exemplary embodiment of the present application.
- the application processing device may be a terminal device or a server; the application processing device at least It includes a processor 601 , a communication interface 602 and a memory 603 .
- the processor 601, the communication interface 602, and the memory 603 may be connected through a bus or other means, and the embodiment of the present application takes the connection through a bus as an example.
- the processor 601 (or Central Processing Unit (CPU)) is the computing core and the control core of the application processing device, which can parse various instructions in the terminal device and process various data of the terminal device.
- CPU Central Processing Unit
- the CPU can be used to parse the power-on/off command sent by the user to the terminal device, and control the terminal device to perform power-on/off operations; another example: the CPU can transmit various interactive data between the internal structures of the terminal device, and so on.
- the communication interface 602 can include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.), and can be used to send and receive data under the control of the processor 601; the communication interface 602 can also be used for the transmission of internal data of the terminal device and interact.
- the memory 603 (Memory) is a memory device in the terminal device for storing programs and data.
- the memory 603 here can include both the built-in memory of the terminal device, and certainly also the extended memory supported by the terminal device.
- the memory 603 provides storage space, and the storage space stores the operating system of the terminal device, which may include but not limited to: Android system, iOS system, Windows Phone system, etc., which is not limited in this application.
- the processing device of the application may refer to a terminal device or a server.
- the processor 601 executes the following operations by running the executable program code in the memory 603:
- the specific implementation manner in which the processor 601 obtains the bytecode file to be processed from the archive file of the target application program is:
- a first encoding conversion process is performed on the class file to obtain a to-be-processed bytecode file.
- the optimization task includes a system annotation optimization task, and the specific implementation of the processor 601 traversing the bytecode file to be processed to collect the bytecode corresponding to the N optimization tasks is as follows:
- the collected bytecode corresponding to the system annotation optimization task refers to the first bytecode located in the first bytecode set and not belonging to the whitelist.
- the processor 601 also performs the following operations by running the executable program code in the memory 603:
- the class to which the target bytecode belongs calls the system annotation method, it is judged whether the class to which the target bytecode belongs is an interface implementation class, or the target bytecode is judged according to the inheritance relationship in the data structure of the target application. Whether the class to which it belongs has a parent class; wherein, the data structure includes the inheritance relationship of each class in the target application;
- the class to which the target bytecode belongs is an interface implementation class, or if the class to which the target bytecode belongs has a parent class, it is determined that the target bytecode satisfies the protection conditions.
- the processor 601 performs optimization processing on the collected bytecodes corresponding to each optimization task, and the specific implementation manner of obtaining an optimized bytecode file is as follows:
- the optimization task includes a source file format optimization task;
- the collected bytecode corresponding to the source file format optimization task is the second bytecode in the bytecode file to be processed, and the second bytecode is used for Represents the bytecode of the source file format;
- the processor 601 performs optimization processing on the collected bytecode corresponding to each optimization task, and the specific implementation of obtaining the optimized bytecode file is as follows:
- the second bytecode in the to-be-processed bytecode file is replaced by the simplified bytecode to obtain the optimized bytecode file;
- the simplified bytecode can be restored to the second bytecode by using the mapping file.
- the optimization task includes a debugging information optimization task; the specific implementation of the processor 601 calling to traverse the to-be-processed bytecode file to collect the bytecodes corresponding to the N optimization tasks respectively is as follows:
- optimization configuration information where the optimization configuration information includes an identifier of the debugging information to be optimized
- the processor 601 performs optimization processing on the collected bytecode corresponding to each optimization task, and the specific implementation manner of obtaining the optimized bytecode file is as follows:
- the optimization task includes a global variable optimization task; the specific implementation of the processor 601 traversing the to-be-processed bytecode file to collect the bytecodes corresponding to the N optimization tasks respectively is as follows:
- the fourth bytecode is filtered out from the to-be-processed bytecode file, where the fourth bytecode is a bytecode used to represent an initial value of a global variable whose initial value is a preset value.
- the processor 601 performs optimization processing on the collected bytecodes corresponding to each optimization task, and the specific implementation manner of obtaining an optimized bytecode file is as follows:
- the optimization task includes an access method optimization task; the specific implementation of the processor 601 traversing the to-be-processed bytecode file to collect the bytecode corresponding to the N optimization tasks is as follows:
- the fifth bytecode in the bytecode file to be processed is the bytecode used to represent the target access method, and the target access method is any access method in the target application;
- the information to be optimized is determined according to the target access method and the inheritance relationship of each class in the data structure, and the to-be-optimized information includes the access member corresponding to the target access method and the calling method of the access member.
- the processor 601 performs optimization processing on the collected bytecodes corresponding to each optimization task, and the specific implementation manner of obtaining an optimized bytecode file is as follows:
- the bytecode corresponding to the calling method of the access member is updated according to the modification, and the fifth bytecode is deleted to obtain an optimized bytecode file.
- the processor 601 further performs the following operations by running the executable program code in the memory 603:
- the second encoding conversion process is performed on the optimized bytecode file to obtain an updated class file;
- the updated class file is encoded to obtain the updated archive file.
- Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program is adapted to be loaded by a processor and execute the processing method of the application program of the foregoing method embodiments.
- Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
- the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned method of processing the application program.
- the modules in the apparatus of the embodiment of the present application may be combined, divided and deleted according to actual needs.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种应用程序的处理方法、装置、设备及介质。其中方法包括:从目标应用程序的归档文件中获取待处理字节码文件(201),其中,所述归档文件用于构建或更新所述目标应用程序的安装包,收集待处理字节码文件中与N个优化任务分别对应的字节码,N为正整数(202),其中,一个优化任务用于对一种类型的字节码进行优化;对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件(203)。
Description
本申请要求于2020年7月21日提交中国专利局、申请号为202010704842.0,发明名称为“一种应用程序的处理方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,具体涉及一种应用程序的处理方法、一种应用程序的处理装置、一种应用程序的处理设备及计算机可读存储介质。
随着计算机技术的进步,各个应用平台上涌现出海量的应用程序。随着应用程序的迭代发展,面临着应用程序的安装包的大小不断增长的情况。一方面,安装包的大小与下载转化率息息相关,应用程序的安装包大小越大,则应用程序的下载转化率越低。另一方面,应用程序的安装包的大小对应用程序的推广也会产生较大影响,例如:某安卓(Android,一种移动操作系统)应用平台规定安装包大小超过100兆字节的应用程序只能以扩展文件的方式上传,这就不利于应用程序的推广。由此可见,在对应用程序的安装包进行构建或者迭代时,需要严格控制安装包的大小,目前主要通过对应用程序的安装包进行混淆压缩来对安装包的大小进行控制。
技术内容
本申请实施例提供一种应用程序的处理方法、装置、设备及计算机可读存储介质,能够实现较大程度的针对性压缩,并能保证兼容性和稳定性。
一方面,本申请实施例提供了一种应用程序的处理方法,该方法包括:
从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归档文件用于构建或更新所述目标应用程序的安装包;
遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;
对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
一方面,本申请提供了一种应用程序的处理装置,该装置包括:
获取单元,用于从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归 档文件用于构建或更新所述目标应用程序的安装包;
处理单元,用于遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;以及用于对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
一方面,本申请提供了一种应用程序的处理设备,该设备包括:
处理器,适于执行计算机程序;
计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被处理器执行时,实现上述应用程序的处理方法。
一方面,本申请提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,该计算机程序适于由处理器加载并执行上述应用程序的处理方法。
一方面,本申请提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述应用程序的处理方法。
附图简要说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a示出了本申请一个示例性实施例提供的一种构建应用程序的安装包所需的文件示意图;
图1b示出了本申请一个示例性实施例提供的一种更新应用程序的安装包所需的文件示意图;
图1c示出了本申请一个示例性实施例提供的一种应用程序的安装包构建过程图;
图2示出了本申请一个示例性实施例提供的一种应用程序的处理方法的流程图;
图3示出了本申请一个示例性实施例提供的另一种应用程序的处理方法的流程图;
图4a示出了本申请一个示例性实施例提供的一种系统注解优化任务的流程图;
图4b示出了本申请一个示例性实施例提供的一种源文件格式优化任务的流程图;
图4c示出了本申请一个示例性实施例提供的一种还原源文件格式的字节码的流程图;
图4d示出了本申请一个示例性实施例提供的一种编码树的示意图;
图4e示出了本申请一个示例性实施例提供的一种全局变量优化任务的流程图;
图4f示出了本申请一个示例性实施例提供的一种访问方法优化任务的流程图;
图5示出了本申请一个示例性实施例提供的一种应用程序的处理装置的结构示意图;
图6示出了本申请一个示例性实施例提供的一种应用程序的处理设备的结构示意图。
下面将结合附图对本申请实施例中的技术方案进行描述。
应用程序的安装包是可自行解压缩文件的集合,其中包含应用程序安装的所有文件。运行应用程序的安装包就可以将应用程序的所有文件释放到计算机设备的硬盘上,完成修改注册表、修改系统设置、创建快捷方式等工作,从而使得计算机设备能够使用应用程序的功能。应用程序的安装环境不同,应用程序的安装包的格式也有所不同,此处的安装环境是指计算机设备的操作系统环境,例如:Android(安卓,一种移动操作系统)环境中的应用程序的安装包为APK(Android application package,安卓应用程序包)格式;IOS(一种移动操作系统)环境中的应用程序的安装包为IPA(iPhoneApplication,苹果应用程序包)格式。本申请后续实施例中以APK安装包为例进行说明。
应用程序的归档文件是用于对应用程序的类(Class)文件、元数据(即用于描述属性的数据)及资源(如文本、图片等)等进行聚合的文件;它可以被用来构建应用程序的安装包,也可以被用来对应用程序的安装包进行更新。图1a示出了本申请一个示例性实施例提供的一种构建应用程序的安装包所需的文件示意图;图1a所示的应用程序的安装包为APK,该APK的归档文件为Jar包。如图1a所示,该APK是由M个归档文件(Jar包)和其他文件(如入口文件)共同打包构建得到的,其中,M为正整数。图1b示出了本申请一个示例性实施例提供的一种更新应用程序的安装包所需的文件示意图;图1b中,更新后的APK是采用新的归档文件对原始APK中的旧归档文件进行替换,或者将新的归档文件作为新增文件加入原始APK中得到的。由此可见,不论是在对应用程序的安装包进行构建或者更新时,都需要用到归档文件。应用程序的归档文件中包含类(Class)文件,类(Class)文件是由编译器对应用程序的源文件进行编译之后产生的后缀名为“.class”的二进制文件。类文件可以转换为字节码文件,字节码文件是一种包含执行程序,由一序列操作代码/数据对组成的二进制文件,它是经过编译器预处理过的一种文件,是应用程序的执行文件的存在形式。
由于应用程序的安装包的大小与下载转化率息息相关,并且对应用程序的推广也会产生较大影响,因此在对应用程序的安装包进行构建或者迭代时,需要严格控制安装包的大小。基于此,本申请实施例提出了一种应用程序的处理方案,该方案能够有效压缩应用程序的安装包的大小,该方案具备如下特点:(1)方案的设计目标是以通用性、扩展性、高性能为主。通用性是指:支持所有应用程序能够快速简单的接入本方案,实现压缩安装包大小的目标;扩展性是指:支持新的优化形式的扩展与快速接入本方案能力,通过不断扩充优化形式,能够不断的增强字节码压缩能力;高性能是指:本方案会介入到应用程序的安装包的构建过程,应用程序的安装包的构建过程接入本方案后,能够尽可能的减少造成的编译时间增量。(2)方案支持以插件形式接入至应用程序的安装包的构建流程,在构建流程中去hook(钩子)应用程序的安装包的混淆任务或者JarMerge(Jar文件合并)任务,收集混淆任务或者JarMerge任务输出的归档文件,对该归档文件中的字节码文件进行有针对性地、较极致地优化处理,减小字节码文件的大小,从而有利于减小目标应用程序更新后或者构建后安装包的大小,且具备良好的兼容性和稳定性;应用程序通过在构建脚本中使用插件即可对字节码文件进行优化,以此保证优化方案的通用性。(3)针对字节码文件的优化任务的数量可按需设置,支持优化任务的扩展,能够不断增加字节码文件的压缩优化能力,进一步控制目标应用程序更新后或者构建后安装包的大小。
本申请实施例中,归档文件是指用于对目标应用程序的安装包进行更新替换的文件,或者是用于构建目标应用程序的安装包的文件,本申请实施例专注于对目标应用程序的归档文件对应的字节码文件进行多维优化,首先从目标应用程序的归档文件中获取待处理字节码文件,并按需设置N个优化任务;然后收集待处理字节码文件中N个优化任务分别对应的字节码,再对收集的每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。通过上述流程,能够对目标应用程序的安装包包含的归档文件中的字节码文件进行有针对性地、较极致地优化处理,减小字节码文件的大小,从而有利于减小目标应用程序更新后或者构建后安装包的大小,且具备良好的兼容性和稳定性;并且,优化任务的数量可按需设置,支持优化任务的扩展,能够不断增加字节码文件的压缩优化能力,进一步控制目标应用程序更新后或者构建后安装包的大小。
图1c示出了本申请一个示例性实施例提供的一种应用程序安装包的构建过程图。如图1c所示,本申请实施例在应用程序的安装包的构建过程中设计了一种应用程序的处理方法,该方法主要是从应用程序的字节码文件中收集待优化字节码,然后对这些字节码进行优化(如删除或者替换),进而达到压缩应用程序的安装包的目的。同理,在应用程序的安装 包的更新过程中,也可以使用本申请提供的应用程序的处理方法对应用程序的安装包包含的归档文件中的字节码进行优化,进而达到压缩应用程序的安装包的目的。该应用程序的处理方法可以被应用于终端设备或服务器中,终端设备可以包括但不限于:智能手机(如Android手机、iOS手机等)、平板电脑、便携式个人计算机、移动互联网设备(MobileInternetDevices,简称MID)等计算机设备,服务器可以包括但不限于集群服务器,本申请实施例不做限定。
在图1c所示的安卓安装包构建过程中,应用程序的处理流程主要包括:①从目标应用程序的归档文件(jar包)中获取待处理字节码文件;②遍历待处理字节码文件以收集与N个优化任务(如注解优化任务、调试信息优化任务、全局变量优化任务等)分别对应的字节码,N为正整数;N的取值可以根据实际需要进行设定,例如N为3、5等等。N值越大,则优化任务越全面,那么字节码文件的压缩效果就越好;与此同时,优化执行的复杂度也相应较高,耗费的时间和资源相对也较多。③对收集的与每个优化任务对应的字节码执行优化处理(如对表示源文件格式的字节码进行重新编码,得到简化的字节码;删除优化配置信息中指示的调试信息等),得到优化后的字节码文件(即压缩后的字节码文件)。
可见,本申请实施例专注于对归档文件对应的字节码文件进行多维优化,首先从目标应用程序的归档文件中获取待处理字节码文件,并按需设置N个优化任务;然后收集待处理字节码文件中N个优化任务分别对应的字节码,再对收集的每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。通过上述流程,能够对目标应用程序的安装包包含的归档文件中的字节码文件进行有针对性地、较极致地优化处理,减小字节码文件的大小,由于目标应用程序的更新过程和构建过程都涉及归档文件,因此对归档文件对应的字节码文件进行多维优化有利于减小目标应用程序更新后或者构建后安装包的大小,且具备良好的兼容性和稳定性;并且,优化任务的数量可按需设置,支持优化任务的扩展,能够不断增加字节码文件的压缩优化能力,进一步控制目标应用程序更新后或者构建后安装包的大小。
图2示出了本申请一个示例性实施例提供的一种应用程序的处理方法的流程图。如图2所示,应用程序的处理方法包括但不限于如下步骤201-步骤203。下面对本申请实施例提供的一种应用程序的处理方法进行详细介绍:
201、从目标应用程序的归档文件中获取待处理字节码文件。
目标应用程序可以是浏览器应用程序、购物应用程序、游戏应用程序等。在一种实施方式中,应用程序的处理设备对目标应用程序的归档文件进行解码处理,得到目标应用程 序的类文件,然后对类文件进行编码转换得到目标应用程序的待处理字节码文件。
202、遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数。
其中,一个优化任务可用于对一种类型的字节码进行优化;例如,优化任务1可用于对表示系统注解的字节码进行优化,优化任务2可用于对表示源程序格式的字节码进行优化,等等。N的数值可以按需设置;例如,考虑到字节码文件的压缩效果及资源耗费度之间的平衡性,N的取值设为5。再如,若要求对应用程序一的字节码文件中的3种类型的字节码进行优化,则N的值为3。由此可见,本申请实施例提供的应用程序的处理方法能够兼容多个优化任务,能对多种类型的字节码进行优化,从而保证了兼容性和可扩展性。
203、对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
优化处理包括但不限于修改处理及删除处理;例如,应用程序的处理设备对优化任务1对应的字节码执行删除处理,将优化任务2对应的字节码“cafe 01”修改为“ba”。
本申请实施例专注于对归档文件对应的字节码文件进行多维优化,首先从目标应用程序的归档文件中获取待处理字节码文件,并按需设置N个优化任务;然后收集待处理字节码文件中与N个优化任务分别对应的字节码,再对收集的每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。通过上述流程,能够对目标应用程序的安装包包含的归档文件中的字节码文件进行有针对性地、较极致地优化处理,减小字节码文件的大小,由于目标应用程序的更新过程和构建过程都涉及归档文件,因此对归档文件对应的字节码文件进行多维优化有利于减小目标应用程序更新后或者构建后安装包的大小,且具备良好的兼容性和稳定性;并且,优化任务的数量可按需设置,支持优化任务的扩展,能够不断增加字节码文件的压缩优化能力,进一步控制目标应用程序更新后或者构建后安装包的大小。
图3示出了本申请一个示例性实施例提供的另一种应用程序的处理方法的流程图。如图3所示,应用程序的处理方法包括但不限于如下步骤301-步骤322。下面对本申请实施例提供的一种应用程序的处理方法进行详细介绍:
301、对目标应用程序的归档文件进行解码处理,得到目标应用程序的类文件。目标应用程序包含多个类,类是由某种特定的元数据所组成的内聚的包,类包括接口和结构。一个或多个类被聚合为一个类(Class)文件,类文件是由编译器对应用程序的源文件中的类进行编译之后产生的后缀名为“.class”的二进制文件。
302、对类文件进行第一编码转换处理,得到待处理字节码文件。此处的第一编码转 换处理是指通过编译器将类文件转换为计算机可识别的待处理字节码文件的过程;该待处理字节码文件以byte形式被存储在应用程序的处理设备的内存中。
303、遍历待处理字节码文件,并构造目标应用程序的数据结构。
在一种实施方式中,应用程序的处理设备对待处理字节码文件进行至少一次遍历,解析待处理字节码文件中的类及各个类中包含的元素,得到各个类的继承关系,所谓继承是从已有的类中派生出新的类,新的类能吸收已在类的数据属性和行为,并能扩展新的能力。已有的类称为父类,新的类称为子类。所谓继承关系是指父类与子类之间的父子关系,该继承关系包括:子类继承父类的特征和行为,使得子类对象(实例)具有父类的属性和方法;或子类从父类继承方法,使得子类具有父类相同的行为。根据各个类的继承关系构造目标应用程序的数据结构,该数据结构包含目标应用程序中的各个类的继承关系;该数据结构可包括但不限于:数组结构、树结构等等。以树结构为例,本申请可根据目标应用程序中的各个类的继承关系构造一颗包含所有类的继承树。
304、遍历待处理字节码文件以获取第一字节码集合。
第一字节码是指待处理字节码文件中用于表示系统注解的字节码;其中,系统注解用于表示关于类(以及方法和字段)的各种反射信息,系统注解具体可以包括但不限于:getEnclosingMethod,getSimpleName,isLocalOrAnonymousClass,getGenericSuperclass,getTypeParameters。
305、将第一字节码集合中满足保护条件的第一字节码添加至白名单中。
图4a示出了本申请一个示例性实施例提供的一种系统注解优化任务的流程图。如图4a所示,系统注解优化任务包括“信息收集”和“优化执行”两个阶段。设目标字节码是第一字节码集合中的任一第一字节码,在信息收集阶段,应用程序的处理设备首先判断目标字节码表示的系统注解是否被使用,即判断目标字节码所属的类是否对系统注解方法进行调用;若目标字节码表示的系统注解有被使用,则进一步判断目标字节码表示的系统注解所属的类是否是接口实现类,或者,根据数据结构中的继承关系判断目标字节码表示的系统注解所属的类是否存在父类;如果目标字节码表示的系统注解所属的类是接口实现类,或者目标字节码表示的系统注解所属的类存在父类,则判定目标字节码满足保护条件,该目标字节码被添加至白名单中。可见,白名单中的第一字节码满足以下条件:(1)白名单中的第一字节码表示的系统注解有被使用;(2)白名单中的第一字节码表示的系统注解所属的类存在父类,或者,白名单中的第一字节码该字节码表示的系统注解所属的类是接口实现类。
306、将待处理字节码文件中属于第一字节码集合,且不属于白名单的第一字节码进行删除,得到优化后的字节码文件。
在优化执行阶段,应用程序的处理设备将待处理字节码文件中属于第一字节码集合,且不属于白名单的第一字节码进行删除,得到优化后的字节码文件。可以理解的是,被删除的第一字节码表示的系统注解满足以下条件:该被删除的第一字节码表示的系统注解未被使用,且该被删除的第一字节码表示的系统注解所属的类不存在父类,且该被删除的字节码表示的系统注解所属的类不是接口实现类。
可见,通过执行系统注解优化任务,应用程序的处理设备可以根据保护条件自适应的去筛选并删除待处理字节码文件中可以被删除的用于表示系统注解的字节码,进而得到优化后的字节码文件。通过上述动态删除方法,能够在保证应用程序的可用性和稳定性的前提下对待处理字节码文件进行压缩。
307、遍历待处理字节码文件以获取第二字节码。
图4b示出了本申请一个示例性实施例提供的一种源文件格式优化任务的流程图。如图4b所示,应用程序的处理设备首先收集所有源文件格式的字节码,即遍历待处理字节码文件以获取第二字节码,其中,第二字节码是指待处理字节码文件中用于表示源文件(sourceFile)格式的字节码,源文件格式是用于标记代码文件(如java文件)的文件名。
308、根据第二字节码在待处理字节码文件中的出现频率,构建第二字节码的编码树。
应用程序的处理设备对源文件格式的字节码重新编码,得到简化的字节码。在一种实施方式中,应用程序的处理设备根据第二字节码在待处理字节码文件中的出现频率(次数),构建哈夫曼树。
309、按照编码树的编码规则对第二字节码进行编码,得到简化的字节码和映射文件。
映射文件用于将简化的字节码还原为第二字节码。图4c示出了本申请一个示例性实施例提供的一种还原源文件格式的字节码的流程图。如图4c所示,应用程序的处理设备导入映射(mapping)文件,然后根据映射文件将简化的源文件格式的字节码还原为源文件格式的原始字节码。
310、采用简化的字节码对待处理字节码文件中的第二字节码进行替换,得到优化后的字节码文件。
下面通过一个完整的例子对源文件格式优化任务进行说明,假设字节码1为“XXXXXXXX”,字节码2为“YYYYYYYY”,字节码3为“ZZZZZZZZ”,即字节码1-字节码3的长度均为8,字节码1在待处理字节码文件中的出现次数为5次,字节码2在待处 理字节码文件中的出现次数为7次,字节码3在待处理字节码文件中的出现次数为13次,则根据字节码1-字节码3在待处理字节码文件中出现的次数构建的哈夫曼树如图4d所示,根据图4d所示的编码树的编码规则对字节码1-字节码3进行编码得到:字节码1的简化字节码为“00”,字节码2的简化字节码为“01”,字节码3的简化字节码为“1”,字节码1-字节码3的映射文件如表1所示:
表1
| 字节码 | 简化字节码 |
| XXXXXXXX | 00 |
| YYYYYYYY | 01 |
| ZZZZZZZZZ | 1 |
由上述可知,在简化前,字节码1-字节码3在待处理字节码文件中的总长度为:8*(5+7+13)=200;简化后,字节码1-字节码3在优化后的字节码文件中的总长度为:2*5+2*7+1*13=37。
可见,通过执行源文件格式优化任务,应用程序的处理设备可以通过编码树对用于表示源文件格式的字节码进行压缩,进而得到优化后的字节码文件;此外,还可以通过映射文件对压缩后的字节码进行还原。
311、获取优化配置信息。
优化配置信息包括待优化的调试信息的标识(如调试信息的包名,调试信息的包名的正则表达式);其中,调试信息包含了行号和局部变量表,且调试信息保留在待处理的字节码文件中会导致目标应用程序存在安全风险。在一种实施方式中,调试信息优化任务的优化配置信息可以是预先配置的,也可以是用户在对目标应用程序的安装包进行压缩时,根据实际需求配置的。
312、根据待优化的调试信息的标识确定待处理字节码文件中的第三字节码。第三字节码是指用于表示待优化的调试信息的字节码。
313、删除第三字节码,得到优化后的字节码文件。
可见,通过执行调试信息优化任务,应用程序的处理设备可以根据优化配置信息对待处理字节码文件中用于表示调试信息的字节码进行动态删除,进而得到优化后的字节码文件。
314、从待处理字节码文件中筛选出第四字节码。
图4e示出了本申请一个示例性实施例提供的一种全局变量优化任务的流程图。如图 4e所示,应用程序的处理设备首先收集待处理字节码文件中的全局变量的初始值对应的字节码,得到用于表示全局变量的初始值的字节码集合,并根据该字节码集合确定各个全局变量对应的初始值。然后在构造函数中判断各个全局变量初始化的值是否为预设值,即从待处理字节码文件中筛选出第四字节码;其中,构造函数主要用于在创建对象时初始化对象,即为对象成员变量赋初始值,第四字节码是指用于表示初始值为预设值的全局变量的初始值的字节码。在一种实施方式中,第四字节码是指用于表示初始值为0的全局变量的初始值的字节码(即第四字节码是指用于表示初始值0的字节码)。
表2为本申请实施例提供的支持自动化删除的无效的变量初始化表。
表2
表2示出了在各个数据类型下,全局变量对应的无效初始值。当全局变量的初始值与表2中各个数据类型对应的初始值相同时,应用程序的处理设备将该全局变量的初始值对应的字节码确定为第四字节码;例如,假设应用程序1中存在全局变量a,且“int a=0”,则应用程序的处理设备将“int a=0”中的“0”对应的字节码确定为第四字节码。
315、删除第四字节码,得到优化后的字节码文件。
可见,通过执行全局变量优化任务,应用程序的处理设备可以删除待处理字节码文件中无效的初始化值对应的字节码,进而得到优化后的字节码文件。
316、遍历待处理字节码文件,并构造目标应用程序的数据结构。
步骤316的具体实施方式可参考步骤303的具体实施方式,在此不再赘述。需要说明的是,若优化任务中包括系统注解优化任务,且应用程序的处理设备在执行系统注解优化任务时已经构造目标应用程序的数据结构,则不再执行此步骤;同理,若优化任务中包括全局变量优化任务,且应用程序的处理设备在执行全局变量优化任务时已经构造目标应用程序的数据结构,则在执行系统注解优化任务时,不再执行步骤303。
317、读取待处理字节码文件中的第五字节码。
图4f示出了本申请一个示例性实施例提供的一种访问方法优化任务的流程图。如图4f所示,访问方法优化任务包括“信息收集”和“优化执行”两个阶段。在信息收集阶段,应用程序的处理设备筛选待处理字节码文件中的第五字节码,第五字节码是指用于表示目标访问方法的字节码,目标访问方法可以是目标应用程序中的任一访问方法;在一种实施方 式中,访问方法是指Access方法,该访问方法用于对嵌套类和私有成员进行桥接,使得嵌套类和私有成员能够相互访问。此处,嵌套类是指被定义在一个类中的另一个类,例如,假设类1是定义在类2中的一个类,则类1是类2的嵌套类。私有成员是指一个类中私有的数据和函数。
318、根据目标访问方法和数据结构中各个类的继承关系确定待优化信息。
应用程序的处理设备提取待优化信息,待优化信息包括目标访问方法对应的访问成员和该访问成员的调用方法。在一种实施方式中,应用程序的处理设备分析目标访问方法确定访问成员,根据数据结构中各个类的继承关系确定访问成员的调用方法。
319、修改访问成员的可见性及访问成员的调用方法。
在优化执行阶段,应用程序的处理设备修改访问成员的可见性。在一种实施方式中,应用程序的处理设备将访问成员的可见性由私有的(private)改为包(package)可见,即将私有成员修改为包可见成员,并对应修改该访问成员的调用方法,即将原有的通过Access方法访问改为直接访问。
320、在待处理字节码文件中根据修改更新访问成员的调用方法对应的字节码,并删除第五字节码,得到优化后的字节码文件。
在一种实施方式中,应用程序的处理设备根据步骤319中的修改更新待处理字节码文件中对应的字节码;例如,将用于指示访问方法对应的私有成员的字节码修改为相应的包可见成员的字节码。然后删除待处理字节码文件中的第五字节码,得到优化后的字节码文件。
可见,通过执行访问方法优化任务,应用程序的处理设备可以根据访问方法和数据结构中各个类的继承关系对访问方法对应的访问成员及该成员的调用方法进行修改,并删除访问方法,进而得到优化后的字节码文件。
根据上述实施例的描述,考虑到字节码文件的压缩效果、资源耗费度及实际的优化需求,本实施中N的取值为5,N个优化任务包括:步骤303-步骤306对应的系统注解优化任务,步骤307-步骤310对应的源文件格式优化任务,步骤311-步骤313对应的调试信息优化任务,步骤314和步骤315对应的全局变量优化任务以及步骤316-步骤320对应的访问方法优化任务。在实际对目标应用程序的安装包进行压缩时,应用程序的处理设备可以根据实际需求执行上述优化任务中的一个或多个,各个优化任务可以是并行的,也可以是按指定顺序执行的,对此本申请实施例不做限制;例如,应用程序的处理设备可以仅执行全局变量优化任务和访问方法优化任务,全局变量优化任务和访问方法优化任务可以是并 行执行的,也可以是先执行访问方法优化任务再执行全局变量优化任务。并且,除了上述5种优化任务外,本申请提供的应用程序的处理方法还可以在使用时加入其它优化任务;例如,还可以加入R文件优化任务,其中,R文件是用于声明静态变量的文件。
321、若优化后的字节码文件满足编码规范,则对优化后的字节码文件进行第二编码转换处理,得到更新后的类文件。
在一种实施方式中,应用程序的处理设备在每个优化任务执行完成后,检测优化后的字节码文件是否满足编码规范;例如,检测优化后的字节码文件中各个字节码对应的成员之间是否能正常访问,若优化后的字节码文件不满足编码规范,则放弃该优化任务,继续执行其他优化任务,若优化后的字节码文件满足编码规范,则应用程序的处理设备检测N个优化任务是否已经全部完成,若N个优化任务已经全部完成,则对优化后的字节码文件进行第二编码转换处理,得到更新后的类文件;相应地,若还有未完成的优化任务,则继续执行未完成的优化任务,直至N个优化任务全部完成。第二编码转换处理是指通过编译器将优化后的字节码文件转换为更新后的类文件的过程,该优化后的字节码文件以byte形式被存储在应用程序的处理设备的内存中,转换得到更新后的类文件则被存储在应用程序的处理设备的硬盘中。
322、对更新后的类文件进行编码处理,得到更新后的归档文件。
在一种实施方式中,应用程序的处理设备对更新后的类文件进行编码处理,得到更新后的归档文件,并采用更新后的归档文件构建目标应用程序的安装包,或者采用更新后的归档文件更新目标应用程序的安装包(如采用更新后的归档文件替换目标应用程序的安装包中对应的原始归档文件)。
在一些实施例中,在实际应用时,可将本申请实施例提供的应用程序的处理方法与现有的应用程序的安装包压缩方案(如proguard方案)结合使用。实验数据显示,在使用proguard方案对目标应用程序进行处理后,再通过本申请实施例提供的应用程序的处理方法对proguard方案处理后的目标应用程序的字节码进行压缩,可将字节码的大小压缩12%;若单独使用本申请实施例提供的应用程序的处理方法对目标应用程序的字节码进行压缩,可将字节码的大小压缩25%。
本申请实施例专注于对目标应用程序的归档文件对应的字节码文件进行多维优化,从目标应用程序的归档文件中获取待处理字节码文件,并通过五个优化任务分别对待处理的字节码文件进行针对性的优化。通过上述流程,能够对目标应用程序的安装包包含的归档文件中的字节码文件进行有针对性地、最大程度地优化处理,减小字节码文件的大小,从 而有利于减小目标应用程序更新后或者构建后安装包的大小,且具备良好的兼容性和稳定性;并且,优化任务的数量可按需设置,支持优化任务的扩展,能够不断增加字节码文件的压缩优化能力,进一步控制目标应用程序更新后或者构建后安装包的大小。
上述详细阐述了本申请实施例的方法,为了便于更好地实施本申请实施例的上述方案,相应地,下面提供了本申请实施例的装置。
请参见图5,图5示出了本申请一个示例性实施例提供的一种应用程序的处理装置的结构示意图,该应用程序的处理装置可以搭载在上述方法实施例中的应用程序的处理设备上,该应用程序的处理装置可以是一个插件,例如:压缩插件;在需要对应用程序的安装包进行更新或构建时,通过调用该压缩插件,即可达到压缩应用的安装包的目的,由此可见,本申请实施例提供的应用程序的处理装置具有很强的通用性。图5所示的应用程序的处理装置可以用于执行上述图2和图3所描述的方法实施例中的部分或全部功能。其中,各个单元的详细描述如下:
获取单元501,用于从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归档文件用于构建或更新所述目标应用程序的安装包;
处理单元502,用于遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;以及用于对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
在一种实施方式中,处理单元502还用于,从目标应用程序的归档文件中获取待处理字节码文件,具体用于:
对目标应用程序的归档文件进行解码处理,得到该目标应用程序的类文件;
对类文件进行第一编码转换处理,得到待处理字节码文件。
在一种实施方式中,优化任务包括系统注解优化任务,处理单元502还用于,遍历待处理字节码文件以收集与N个优化任务对应的字节码,具体用于:
遍历待处理字节码文件以获取第一字节码集合,该第一字节码集合中包含至少一个第一字节码,第一字节码是用于表示系统注解的字节码;
将第一字节码集合中满足保护条件的第一字节码添加至白名单中;
将所述待处理字节码文件中属于所述第一字节码集合,且不属于所述白名单的第一字节码,作为与所述系统注解优化任务对应的字节码;
其中,收集的系统注解优化任务对应的字节码是指位于第一字节码集合,且不属于白名单的第一字节码。
在一种实施方式中,设目标字节码是第一字节码集合中的任一个;处理单元502还用于,判断目标字节码是否满足保护条件,具体用于:
判断目标字节码所属的类是否对系统注解方法进行调用;
若目标字节码所属的类对系统注解方法进行调用,则判断该目标字节码所属的类是否是接口实现类,或者,根据目标应用程序的数据结构中的继承关系判断该目标字节码所属的类是否存在父类;其中,所述数据结构中包含所述目标应用程序中的各个类的继承关系;
如果目标字节码所属的类是接口实现类,或者该目标字节码所属的类存在父类,判定该目标字节码满足保护条件。
在一种实施方式中,处理单元502还用于,对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件,具体用于:
将待处理字节码文件中属于第一字节码集合,且不属于白名单的第一字节码进行删除,得到优化后的字节码文件。
在一种实施方式中,优化任务包括源文件格式优化任务;收集的与源文件格式优化任务对应的字节码是待处理字节码文件中的第二字节码,第二字节码是用于表示源文件格式的字节码;处理单元502还用于,对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件,具体用于:
根据第二字节码在待处理字节码文件中的出现频率,构建第二字节码的编码树;
按照编码树的编码规则对第二字节码进行编码,得到简化的字节码和映射文件;
采用简化的字节码对待处理字节码文件中的第二字节码进行替换,得到优化后的字节码文件;
其中,采用映射文件能够将简化的字节码还原为第二字节码。
在一种实施方式中,优化任务包括调试信息优化任务;处理单元502还用于,遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,具体用于:
获取优化配置信息,该优化配置信息包括待优化的调试信息的标识;
根据待优化的调试信息的标识确定待处理字节码文件中的第三字节码,第三字节码是用于表示待优化的调试信息的字节码;
处理单元502还用于,对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件,具体用于:
删除第三字节码,得到优化后的字节码文件。
在一种实施方式中,优化任务包括全局变量优化任务;处理单元502还用于,遍历待 处理字节码文件以收集与N个优化任务分别对应的字节码,具体用于:
从待处理字节码文件中筛选出第四字节码,第四字节码是用于表示初始值为预设值的全局变量的初始值的字节码。
在一种实施方式中,处理单元502还用于,对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件,具体用于:
删除第四字节码,得到优化后的字节码文件。
在一种实施方式中,优化任务包括访问方法优化任务;处理单元502还用于,遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,具体用于:
读取待处理字节码文件中的第五字节码,第五字节码是用于表示目标访问方法的字节码,目标访问方法是目标应用程序中的任一访问方法;
根据目标访问方法和数据结构中各个类的继承关系确定待优化信息,待优化信息包括与目标访问方法对应的访问成员和访问成员的调用方法。
在一种实施方式中,处理单元502还用于,对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件,具体用于:
修改访问成员的可见性及访问成员的调用方法;
在待处理字节码文件中根据修改更新访问成员的调用方法对应的字节码,并删除第五字节码,得到优化后的字节码文件。
在一种实施方式中,处理单元502还用于:
若优化后的字节码文件满足编码规范,则对优化后的字节码文件进行第二编码转换处理,得到更新后的类文件;
对更新后的类文件进行编码处理,得到更新后的归档文件。
根据本申请的一个实施例,图2和图3所示的应用程序的处理方法所涉及的部分步骤可由图5所示的应用程序的处理装置中的各个单元来执行。例如,图2中所示的步骤201可由图5所示的获取单元501执行,步骤202和步骤203可由图5所示的处理单元502执行。图3中所示的步骤304,步骤307和步骤311可由图5所示的获取单元501执行,步骤301-步骤303,步骤305,步骤306,步骤308-步骤310和步骤312-步骤322可由图5所示的处理单元502执行。图5所示的应用程序的处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个 单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,应用程序的处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算装置上运行能够执行如图2和图3中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图5中所示的应用程序的处理装置,以及来实现本申请实施例的应用程序的处理方法。计算机程序可以记载于例如计算机可读记录介质上,并通过计算机可读记录介质装载于上述计算装置中,并在其中运行。
基于同一发明构思,本申请实施例中提供的应用程序的处理装置解决问题的原理与有益效果与本申请方法实施例中应用程序的处理方法解决问题的原理和有益效果相似,可以参见方法的实施的原理和有益效果,为简洁描述,在这里不再赘述。
请参阅图6,图6示出了本申请一个示例性实施例提供的一种应用程序的处理设备的结构示意图,该应用程序的处理设备可以是终端设备或服务器;该应用程序的处理设备至少包括处理器601、通信接口602和存储器603。其中,处理器601、通信接口602和存储器603可通过总线或其他方式连接,本申请实施例以通过总线连接为例。其中,处理器601(或称中央处理器(Central Processing Unit,CPU))是应用程序的处理设备的计算核心以及控制核心,其可以解析终端设备内的各类指令以及处理终端设备的各类数据,例如:CPU可以用于解析用户向终端设备所发送的开关机指令,并控制终端设备进行开关机操作;再如:CPU可以在终端设备内部结构之间传输各类交互数据,等等。通信接口602可以包括标准的有线接口、无线接口(如WI-FI、移动通信接口等),受处理器601的控制可以用于收发数据;通信接口602还可以用于终端设备内部数据的传输以及交互。存储器603(Memory)是终端设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的存储器603既可以包括终端设备的内置存储器,当然也可以包括终端设备所支持的扩展存储器。存储器603提供存储空间,该存储空间存储了终端设备的操作系统,可包括但不限于:Android系统、iOS系统、Windows Phone系统等等,本申请对此并不作限定。
在一个实施例中,该应用程序的处理设备可以是指终端设备或者服务器。在此情况下,处理器601通过运行存储器603中的可执行程序代码,执行如下操作:
通过通信接口602从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归档文件用于构建或更新所述目标应用程序的安装包;
遍历待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;以及用于对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
作为一种实施方式,处理器601从目标应用程序的归档文件中获取待处理字节码文件的具体实施方式为:
对目标应用程序的归档文件进行解码处理,得到该目标应用程序的类文件;
对类文件进行第一编码转换处理,得到待处理字节码文件。
作为一种实施方式,优化任务包括系统注解优化任务,处理器601遍历待处理字节码文件以收集与N个优化任务对应的字节码的具体实施方式为:
遍历待处理字节码文件以获取第一字节码集合,该第一字节码集合中包含至少一个第一字节码,第一字节码是用于表示系统注解的字节码;
将第一字节码集合中满足保护条件的第一字节码添加至白名单中;
将所述待处理字节码文件中属于所述第一字节码集合,且不属于所述白名单的第一字节码,作为与所述系统注解优化任务对应的字节码;
其中,收集的系统注解优化任务对应的字节码是指位于第一字节码集合,且不属于白名单的第一字节码。
作为一种实施方式,设目标字节码是第一字节码集合中的任一个;处理器601通过运行存储器603中的可执行程序代码,还执行如下操作:
判断目标字节码所属的类是否对系统注解方法进行调用;
若目标字节码所属的类对系统注解方法进行调用,则判断该目标字节码所属的类是否是接口实现类,或者,根据目标应用程序的数据结构中的继承关系判断该目标字节码所属的类是否存在父类;其中,所述数据结构中包含所述目标应用程序中的各个类的继承关系;
如果目标字节码所属的类是接口实现类,或者该目标字节码所属的类存在父类,判定该目标字节码满足保护条件。
作为一种实施方式,处理器601对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件的具体实施方式为:
将待处理字节码文件中属于第一字节码集合,且不属于白名单的第一字节码进行删除,得到优化后的字节码文件。
作为一种实施方式,优化任务包括源文件格式优化任务;收集的源文件格式优化任务对应的字节码是待处理字节码文件中的第二字节码,第二字节码是用于表示源文件格式的 字节码;处理器601对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件的具体实施方式为:
根据第二字节码在待处理字节码文件中的出现频率,构建第二字节码的编码树;
按照编码树的编码规则对第二字节码进行编码,得到简化的字节码和映射文件;
采用简化的字节码对待处理字节码文件中的第二字节码进行替换,得到优化后的字节码文件;
其中,采用映射文件能够将简化的字节码还原为第二字节码。
作为一种实施方式,优化任务包括调试信息优化任务;处理器601调用遍历待处理字节码文件以收集与N个优化任务分别对应的字节码的具体实施方式为:
获取优化配置信息,该优化配置信息包括待优化的调试信息的标识;
根据待优化的调试信息的标识确定待处理字节码文件中的第三字节码,第三字节码是用于表示待优化的调试信息的字节码;
处理器601对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件的具体实施方式为:
删除第三字节码,得到优化后的字节码文件。
作为一种实施方式,优化任务包括全局变量优化任务;处理器601遍历待处理字节码文件以收集与N个优化任务分别对应的字节码的具体实施方式为:
从待处理字节码文件中筛选出第四字节码,第四字节码是用于表示初始值为预设值的全局变量的初始值的字节码。
作为一种实施方式,处理器601对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件的具体实施方式为:
删除第四字节码,得到优化后的字节码文件。
作为一种实施方式,优化任务包括访问方法优化任务;处理器601遍历待处理字节码文件以收集与N个优化任务分别对应的字节码的具体实施方式为:
读取待处理字节码文件中的第五字节码,第五字节码是用于表示目标访问方法的字节码,目标访问方法是目标应用程序中的任一访问方法;
根据目标访问方法和数据结构中各个类的继承关系确定待优化信息,待优化信息包括与目标访问方法对应的访问成员和访问成员的调用方法。
作为一种实施方式,处理器601对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件的具体实施方式为:
修改访问成员的可见性及访问成员的调用方法;
在待处理字节码文件中根据修改更新访问成员的调用方法对应的字节码,并删除第五字节码,得到优化后的字节码文件。
作为一种实施方式,处理器601通过运行存储器603中的可执行程序代码,还执行如下操作:
若优化后的字节码文件满足编码规范,则对优化后的字节码文件进行第二编码转换处理,得到更新后的类文件;
对更新后的类文件进行编码处理,得到更新后的归档文件。
基于同一发明构思,本申请实施例中提供的应用程序的处理设备解决问题的原理与有益效果与本申请方法实施例中应用程序的处理方法解决问题的原理和有益效果相似,可以参见方法的实施的原理和有益效果,为简洁描述,在这里不再赘述。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,该计算机程序适于由处理器加载并执行上述方法实施例的应用程序的处理方法。
本申请实施例还提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述应用程序的处理的方法。
需要说明的是,对于前述的各个方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某一些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例所涉及的动作和模块并不一定是本申请所必须的。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本申请实施例装置中的模块可以根据实际需要进行合并、划分和删减。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,可读存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
以上所揭露的仅为本申请一种较佳实施例而已,当然不能以此来限定本申请之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本申请权利要求所作的等同变化,仍属于申请所涵盖的范围。
Claims (15)
- 一种应用程序的处理方法,所述方法包括:从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归档文件用于构建或更新所述目标应用程序的安装包;遍历所述待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
- 如权利要求1所述的方法,所述从目标应用程序的归档文件中获取待处理字节码文件,包括:对所述目标应用程序的归档文件进行解码处理,得到所述目标应用程序的类文件;对所述类文件进行第一编码转换处理,得到所述待处理字节码文件。
- 如权利要求1所述的方法,所述优化任务包括系统注解优化任务;所述遍历所述待处理字节码文件以收集与N个优化任务对应的字节码,包括:遍历所述待处理字节码文件以获取第一字节码集合,所述第一字节码集合中包含至少一个第一字节码,所述第一字节码是用于表示系统注解的字节码;将所述第一字节码集合中满足保护条件的第一字节码添加至白名单中;将所述待处理字节码文件中属于所述第一字节码集合,且不属于所述白名单的第一字节码,作为与所述系统注解优化任务对应的字节码;其中,收集的所述系统注解优化任务对应的字节码是指位于所述第一字节码集合,且不属于所述白名单的第一字节码。
- 如权利要求3所述的方法,进一步包括:设目标字节码是所述第一字节码集合中的任一个;判断所述目标字节码所属的类是否对系统注解方法进行调用;若所述目标字节码所属的类对系统注解方法进行调用,则判断所述目标字节码所属的类是否是接口实现类,或者,根据所述目标应用程序的数据结构中的继承关系判断所述目标字节码所属的类是否存在父类;其中,所述数据结构中包含所述目标应用程序中的各个类的继承关系;如果所述目标字节码所属的类是接口实现类,或者所述目标字节码所属的类存在父类,判定所述目标字节码满足保护条件。
- 如权利要求3所述的方法,其特征在于,所述对收集的与每个优化任务对应的字 节码执行优化处理,得到优化后的字节码文件,包括:将所述待处理字节码文件中属于所述第一字节码集合,且不属于所述白名单的第一字节码进行删除,得到优化后的字节码文件。
- 如权利要求1所述的方法,所述优化任务包括源文件格式优化任务;收集的与所述源文件格式优化任务对应的字节码是所述待处理字节码文件中的第二字节码,所述第二字节码是用于表示源文件格式的字节码;所述对收集到所述优化任务对应的字节码执行优化处理,得到优化后的字节码文件,包括:根据所述第二字节码在所述待处理字节码文件中的出现频率,构建所述第二字节码的编码树;按照所述编码树的编码规则对所述第二字节码进行编码,得到简化的字节码和映射文件;采用所述简化的字节码对所述待处理字节码文件中的所述第二字节码进行替换,得到优化后的字节码文件;其中,采用所述映射文件能够将简化的字节码还原为所述第二字节码。
- 如权利要求1所述的方法,所述优化任务包括调试信息优化任务;所述遍历所述待处理字节码文件以收集与N个优化任务分别对应的字节码,包括:获取优化配置信息,所述优化配置信息包括待优化的调试信息的标识;根据所述待优化的调试信息的标识确定所述待处理字节码文件中的第三字节码,所述第三字节码是用于表示待优化的调试信息的字节码;所述对收集到所述优化任务对应的字节码执行优化处理,得到优化后的字节码文件,包括:删除所述第三字节码,得到优化后的字节码文件。
- 如权利要求1所述的方法,所述优化任务包括全局变量优化任务;所述遍历所述待处理字节码文件以收集与N个优化任务分别对应的字节码,包括:从所述待处理字节码文件中筛选出第四字节码,所述第四字节码是用于表示初始值为预设值的全局变量的初始值的字节码。
- 如权利要求8所述的方法,所述对收集到所述优化任务对应的字节码执行优化处理,得到优化后的字节码文件,包括:删除所述第四字节码,得到优化后的字节码文件。
- 如权利要求1所述的方法,所述优化任务包括访问方法优化任务;所述遍历所述待处理字节码文件以收集与N个优化任务分别对应的字节码,包括:读取所述待处理字节码文件中的第五字节码,所述第五字节码是用于表示目标访问方法的字节码,所述目标访问方法是所述目标应用程序中的任一访问方法;根据所述目标访问方法和所述数据结构中各个类的继承关系确定待优化信息,所述待优化信息包括与所述目标访问方法对应的访问成员和所述访问成员的调用方法。
- 如权利要求10所述的方法,所述对收集到所述优化任务对应的字节码执行优化处理,得到优化后的字节码文件,包括:修改所述访问成员的可见性及所述访问成员的调用方法;在待处理字节码文件中根据所述修改更新所述访问成员的调用方法对应的字节码,并删除所述第五字节码,得到优化后的字节码文件。
- 如权利要求2-11任一项所述的方法,所述方法还包括:若所述优化后的字节码文件满足编码规范,则对所述优化后的字节码文件进行第二编码转换处理,得到更新后的类文件;对所述更新后的类文件进行编码处理,得到更新后的归档文件。
- 一种应用程序的处理装置,包括:获取单元,用于从目标应用程序的归档文件中获取待处理字节码文件,其中,所述归档文件用于构建或更新所述目标应用程序的安装包;处理单元,用于遍历所述待处理字节码文件以收集与N个优化任务分别对应的字节码,N为正整数;其中,一个优化任务用于对一种类型的字节码进行优化;以及用于对收集的与每个优化任务对应的字节码执行优化处理,得到优化后的字节码文件。
- 一种应用程序的处理设备,包括:处理器,适于执行计算机程序;计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1-12任一项所述的应用程序的处理方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序适于由处理器加载并执行如权利要求1-12任一项所述的应用程序的处理方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US17/731,165 US12039353B2 (en) | 2020-07-21 | 2022-04-27 | Application processing method, apparatus, device, and medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010704842.0 | 2020-07-21 | ||
| CN202010704842.0A CN113961177B (zh) | 2020-07-21 | 2020-07-21 | 一种应用程序的处理方法、装置、设备及介质 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US17/731,165 Continuation US12039353B2 (en) | 2020-07-21 | 2022-04-27 | Application processing method, apparatus, device, and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022016991A1 true WO2022016991A1 (zh) | 2022-01-27 |
Family
ID=79459884
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/095992 Ceased WO2022016991A1 (zh) | 2020-07-21 | 2021-05-26 | 一种应用程序的处理方法、装置、设备及介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US12039353B2 (zh) |
| CN (1) | CN113961177B (zh) |
| WO (1) | WO2022016991A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116020127A (zh) * | 2022-12-23 | 2023-04-28 | 安天科技集团股份有限公司 | 一种运行游戏的方法、装置及发送游戏的方法、装置 |
| CN118897671A (zh) * | 2024-10-09 | 2024-11-05 | 思创数码科技股份有限公司 | 项目方案优化方法、系统、可读存储介质及计算机 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114968254A (zh) * | 2022-05-07 | 2022-08-30 | 北京城市网邻信息技术有限公司 | 应用工程的数据处理方法、装置、电子设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105915623A (zh) * | 2016-05-20 | 2016-08-31 | 努比亚技术有限公司 | 应用安装包处理装置及方法 |
| CN108804688A (zh) * | 2018-06-14 | 2018-11-13 | 珠海金山网络游戏科技有限公司 | 一种游戏资源引用关系的查找以及优化方法 |
| CN110147239A (zh) * | 2019-05-22 | 2019-08-20 | 苏州仙峰网络科技股份有限公司 | 游戏安装包体的多重压缩的方法、设备及存储介质 |
| US20190303847A1 (en) * | 2018-03-30 | 2019-10-03 | Flexport, Inc. | Cargo Management System and Methods of Managing Cargo |
Family Cites Families (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB0024918D0 (en) * | 2000-10-11 | 2000-11-22 | Sealedmedia Ltd | Method of providing java tamperproofing |
| US7340730B2 (en) * | 2002-03-18 | 2008-03-04 | Sun Microsystems, Inc. | On demand, network accessible, run time compile server |
| US7895580B1 (en) * | 2003-12-30 | 2011-02-22 | Sap Ag | Application tracing service employing different levels of precision for modifying bytecode |
| US20070061794A1 (en) * | 2005-09-13 | 2007-03-15 | Mausolf Jeffry R | Method and apparatus for classpath optimization in a Java runtime environment |
| US8707287B2 (en) * | 2009-12-18 | 2014-04-22 | Syddansk Universitet | Method, computer program product, and system for non-blocking dynamic update of statically typed class-based object-oriented software |
| KR101088515B1 (ko) * | 2010-01-08 | 2011-11-30 | 한국과학기술연구원 | 내장형 자바시스템을 위한 인스톨-타임 컴파일러 프로그램을 기록한 컴퓨터 판독가능한 기록매체 |
| US8695060B2 (en) * | 2011-10-10 | 2014-04-08 | Openpeak Inc. | System and method for creating secure applications |
| WO2014176587A2 (en) * | 2013-04-26 | 2014-10-30 | The Trustees Of Columbia University In The City Of New York | Systems and methods for mobile applications |
| US10789151B2 (en) * | 2018-01-08 | 2020-09-29 | Ozcode Ltd | Time travel source code debugger incorporating pivoting ability |
| CN109522020A (zh) * | 2018-09-29 | 2019-03-26 | 中国平安人寿保险股份有限公司 | 安卓系统安装包瘦身方法、装置、终端及存储介质 |
| CN109857444B (zh) * | 2019-01-03 | 2022-04-12 | 上海拉扎斯信息科技有限公司 | 应用程序的更新方法、装置、电子设备和可读存储介质 |
| CN110134400A (zh) * | 2019-04-02 | 2019-08-16 | 北京奇艺世纪科技有限公司 | 数据获取方法、装置、电子设备及计算机可读存储介质 |
| CN110609687A (zh) * | 2019-04-12 | 2019-12-24 | 北京字节跳动网络技术有限公司 | 一种编译方法、装置、电子设备和存储介质 |
| CN111176717B (zh) * | 2019-12-20 | 2023-05-16 | 广州华多网络科技有限公司 | 生成安装包的方法、装置及电子设备 |
| US10977059B1 (en) * | 2020-03-25 | 2021-04-13 | Red Hat, Inc. | Implementing object validation, web request handling, object relational mapping, or messaging via direct bytecode generation |
-
2020
- 2020-07-21 CN CN202010704842.0A patent/CN113961177B/zh active Active
-
2021
- 2021-05-26 WO PCT/CN2021/095992 patent/WO2022016991A1/zh not_active Ceased
-
2022
- 2022-04-27 US US17/731,165 patent/US12039353B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105915623A (zh) * | 2016-05-20 | 2016-08-31 | 努比亚技术有限公司 | 应用安装包处理装置及方法 |
| US20190303847A1 (en) * | 2018-03-30 | 2019-10-03 | Flexport, Inc. | Cargo Management System and Methods of Managing Cargo |
| CN108804688A (zh) * | 2018-06-14 | 2018-11-13 | 珠海金山网络游戏科技有限公司 | 一种游戏资源引用关系的查找以及优化方法 |
| CN110147239A (zh) * | 2019-05-22 | 2019-08-20 | 苏州仙峰网络科技股份有限公司 | 游戏安装包体的多重压缩的方法、设备及存储介质 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116020127A (zh) * | 2022-12-23 | 2023-04-28 | 安天科技集团股份有限公司 | 一种运行游戏的方法、装置及发送游戏的方法、装置 |
| CN118897671A (zh) * | 2024-10-09 | 2024-11-05 | 思创数码科技股份有限公司 | 项目方案优化方法、系统、可读存储介质及计算机 |
Also Published As
| Publication number | Publication date |
|---|---|
| US12039353B2 (en) | 2024-07-16 |
| CN113961177B (zh) | 2025-11-07 |
| US20220253325A1 (en) | 2022-08-11 |
| CN113961177A (zh) | 2022-01-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12039353B2 (en) | Application processing method, apparatus, device, and medium | |
| CN104391728B (zh) | 软件升级差量包获取方法和相应的升级方法以及装置 | |
| CN105160012B (zh) | 一种异构数据库的管理方法及系统 | |
| WO2009067359A1 (en) | Systems and methods for executing an application on a mobile device | |
| CN109062572B (zh) | 一种组件调用方法、装置、设备及存储介质 | |
| CN106570153A (zh) | 一种海量url的数据提取方法及系统 | |
| US20070124302A1 (en) | Mapping a Source File From a Source System To a Target System | |
| CN103577599A (zh) | 一种移动终端的本地数据存储方法及装置 | |
| CN105391985A (zh) | 一种基于嵌入式Linux的视频监控系统与方法 | |
| CN111767280A (zh) | 数据处理方法、装置及存储介质 | |
| CN112115150A (zh) | 嵌入式内存数据库的数据管理方法、终端设备及介质 | |
| TWI634421B (zh) | 用以存取資料之電子裝置及其資料存取方法 | |
| CN108459852A (zh) | 脚本处理方法及装置、存储介质、电子设备 | |
| CN110688096B (zh) | 包含插件的应用程序的构建方法、装置、介质及电子设备 | |
| KR101117165B1 (ko) | 이기종 운영체제 계층 모듈에서 동작하는 웹기반어플리케이션의 연동이 가능한 모바일 단말기용 웹 플랫폼 유닛 | |
| CN110531965A (zh) | 一种数据处理方法、程序运行方法和设备 | |
| CN108769694B (zh) | 一种基于FPGA的Alpha通道编码的方法及装置 | |
| CN114817160A (zh) | 文件解压方法、装置、电子设备及计算机可读存储介质 | |
| CN112214250A (zh) | 一种应用程序组件的加载方法和装置 | |
| CN116647447A (zh) | 一种应用程序的热更新方法、装置、智能设备及存储介质 | |
| CN110633083A (zh) | 代码文件处理方法、装置、电子设备及计算机可读介质 | |
| CN103927301A (zh) | 一种利用主题包动态翻译词条的方法及移动终端 | |
| CN120454737A (zh) | 一种基于压缩算法的附件打包与解包方法、系统、设备及介质 | |
| US12436936B1 (en) | File directory structure and naming convention for storing columnar tables | |
| CN115437615A (zh) | 一种数据上报方法、装置、计算机设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21845889 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 060623) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21845889 Country of ref document: EP Kind code of ref document: A1 |
