CN106406923B - Method and device for processing dynamic library file - Google Patents

Method and device for processing dynamic library file Download PDF

Info

Publication number
CN106406923B
CN106406923B CN201510458871.2A CN201510458871A CN106406923B CN 106406923 B CN106406923 B CN 106406923B CN 201510458871 A CN201510458871 A CN 201510458871A CN 106406923 B CN106406923 B CN 106406923B
Authority
CN
China
Prior art keywords
file
dynamic library
module
original dynamic
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510458871.2A
Other languages
Chinese (zh)
Other versions
CN106406923A (en
Inventor
蔡振祺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510458871.2A priority Critical patent/CN106406923B/en
Publication of CN106406923A publication Critical patent/CN106406923A/en
Application granted granted Critical
Publication of CN106406923B publication Critical patent/CN106406923B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a processing method of dynamic library files, which is applied to an operating system client in electronic equipment, wherein the operating system client generates a compression package by compressing an original dynamic library file and generates an interface file and a decompression processing file aiming at the compression package, and when an application program running in the operating system client calls the original dynamic library file, the method comprises the following steps: acquiring an application program interface required when the original dynamic library file is called by loading an interface file; when the application program interface is called to judge that the original dynamic library file does not exist in the memory, the decompression processing file is used for decompressing the compressed packet to obtain the original dynamic library file. The application also discloses a corresponding device. By utilizing the technical scheme, the resource occupation of the electronic equipment can be saved.

Description

Method and device for processing dynamic library file
Technical Field
The present invention relates to the field of Information Technology (IT), and in particular, to a method and an apparatus for processing a dynamic library file.
Background
Currently, with the continuous enrichment of application functions in application programs, the installation package size of the application program becomes larger and larger. Since special functions cannot be realized by writing the upper code of the application program, some calling interface technologies are usually adopted to accomplish the mutual calling between the application layer and the lower code, for example, a Java Native Interface (JNI) mechanism for calling native C/C + + code in Java.
However, when these calling interface technologies are used, a relatively large dynamic library file or a relatively large number of dynamic library files, such as so library files, are often generated, which requires a large amount of storage space to store these dynamic library files, and when an application program calls these dynamic library files, the application program is not flexible enough, and consumes a long time, which reduces the resource utilization rate of the electronic device.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for processing a dynamic library file, which can save resource occupation of an electronic device and improve resource utilization of the electronic device.
The technical scheme of the invention is realized as follows:
the invention provides a processing method of dynamic library files, which is applied to an operating system client in electronic equipment, wherein the operating system client generates a compressed package by compressing an original dynamic library file and generates an interface file and a decompression processing file aiming at the compressed package, and when an application program running in the operating system client calls the original dynamic library file, the method comprises the following steps: acquiring an application program interface required when the original dynamic library file is called by loading an interface file; when the application program interface is called to judge that the original dynamic library file does not exist in the memory, the decompression processing file is used for decompressing the compressed packet to obtain the original dynamic library file.
The invention also provides a processing device of the dynamic library file, which is applied to an operating system client in the electronic equipment, and the device comprises: the compression module is used for generating a compression package by compressing the original dynamic library file; the generating module is used for generating an interface file and a decompression processing file aiming at the compression packet generated by the compression module; when an application running in the operating system client invokes the original dynamic library file, the apparatus further comprises: the acquisition module is used for acquiring an application program interface required when the original dynamic library file is called through the interface file generated by the loading generation module; the first judgment module is used for judging whether the original dynamic library file exists in the memory or not by calling the application program interface obtained by the acquisition module; and the decompression module is used for decompressing the compression packet generated by the compression module by using the decompression processing file generated by the generation module to obtain the original dynamic library file when the first judgment module judges that the original dynamic library file does not exist in the memory.
Compared with the prior art, the method and the device have the advantages that the original dynamic library file is compressed to generate the compressed packet, so that the resource occupation of the electronic equipment is saved; by generating the interface file aiming at the compressed packet, the program logic of the original dynamic library file is not required to be damaged; and judging the application program interface required when the original dynamic library file is called by loading the interface file, and then decompressing the compressed packet by using the decompression processing file, so that the flexibility of calling the original dynamic library file is improved, and the resource utilization rate of the electronic equipment is improved.
Drawings
FIG. 1 is a flowchart illustrating a method for processing a dynamic library file according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing a dynamic library file according to another embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for processing a dynamic library file according to another embodiment of the present invention;
FIG. 4a is a schematic diagram of a user interface for selecting a storage method of compressed packets according to an embodiment of the present invention;
FIG. 4b is a schematic diagram of a user interface displaying a decompression prompt in accordance with an embodiment of the present invention;
FIG. 4c is a schematic diagram of a user interface displaying a download prompting message according to an embodiment of the invention;
FIG. 5 is a block diagram of an embodiment of a device for processing dynamic library files;
FIG. 6 is a block diagram of a dynamic library file processing apparatus according to another embodiment of the present invention;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a flowchart illustrating a method for processing a dynamic library file according to an embodiment of the present invention. The method is applied to an operating system client in the electronic device, and referring to fig. 1, the method comprises the following steps:
step 101, the operating system client generates a compressed package by compressing the original dynamic library file, and generates an interface file and a decompression processing file for the compressed package.
In this step, the operating system may be an open operating system, such as an android system, or a closed operating system, such as an IOS system of apple. The original dynamic library file can be a so library file of an application program, and the so library file is a dynamic library file which is compiled by a c/c + + language and runs in an android system developed based on a linux language. The generated compressed package is used as an installation package of the application.
In an embodiment, the original dynamic library file may be compressed using an LZMA (Lempel-Ziv-Markov chain-Algorithm) Algorithm to generate a compressed package. The LZMA algorithm is an optimized compression algorithm that uses LZ77 with interval coding support to improve the compression algorithm and special pre-processing for binary to compress the data stream, repeat sequence size and repeat sequence position separately. Compared with the prior art that the volume space of the code is reduced by obfuscating the code (for example, java code) or the volume of the resource description file is reduced by obfuscating the resource name in the installation package to reduce the size of the compression package, the LZMA algorithm has the characteristics of high compression ratio, small decompression code amount, high speed and the like.
For example, taking a 1600 KB-sized so library as an example, in the case of using the existing compression technique, the size of the files in the so library after being packed into a compression package is 760KB, which is reduced by 840KB compared to before compression. While the use of the LZMA algorithm can compress the files in the so library to 570KB, reducing 1030KB before compression by 200KB in size compared to the compressed packets obtained with the prior art compression techniques.
Here, a plurality of original dynamic library files are compressed, so that one compressed package file can be generated, or a plurality of compressed package files can be generated, so that when an application program calls the original dynamic library files, only a required part of the dynamic library files can be called.
In one embodiment, the generated interface file may be named as jar file and stored in a library folder in memory, e.g., the interface file so _ compress. The decompression processed file may be named as a so file and stored in a subfolder of the library folder, the name of which is determined according to the type of processor used by the electronic device, e.g., a libs/x86 or libs/armeabi according to the type of Central Processing Unit (CPU), and the decompression processed file so _ compressed.
Step 102, when an application program running in the operating system client calls the original dynamic library file, obtaining an application program interface required when the original dynamic library file is called through loading an interface file.
In this step, when the application calls the original dynamic library file, the interface file is loaded by accessing the library folder to obtain the application interface. For example, accessing the libs folder, loading the so _ compress. jar file, and obtaining the application program interface, SoCompresssGetSoPath (libSoName), wherein libSoName is the name of the original so library.
And 103, when the original dynamic library file does not exist in the memory is judged by calling the application program interface, decompressing the compressed packet by using the decompression processing file to obtain the original dynamic library file.
In the step, whether an original dynamic library file to be called exists in the memory is judged by calling an application program interface, and if the original dynamic library file to be called exists in the memory, the original dynamic library file is directly called; and if the file does not exist, accessing the subfolder of the library folder to acquire the decompression processing file. For example, access libs/x86 or libs/armeabi, get so _ compressed.
In the embodiment of the invention, the operating system client compresses the original dynamic library file to generate the compression packet by using the LZMA algorithm, so that a smaller compression packet can be provided compared with the prior compression technology, and the storage resource of the electronic equipment is saved; and the interface file aiming at the compressed packet is generated, the program logic of the original dynamic library file is not required to be damaged, and the application program interface is called by loading the interface file to determine whether the original dynamic library file to be called is in the memory or not, so that the flexibility of calling the original dynamic library file is improved.
FIG. 2 is a flowchart illustrating a method for processing a dynamic library file according to another embodiment of the present invention. The method is applied to an operating system client in the electronic device, and referring to fig. 2, the method comprises the following steps:
step 201, the operating system client generates a compressed package by compressing the original dynamic library file, and generates an interface file and a decompression processing file for the compressed package.
In one embodiment, before compressing the original dynamic library file, the so library file required by the application program may be placed into a library folder, such as libs folder, and a resource folder, such as an assets folder, may be created in the peer directory for storing the compressed so library file. Before compression using the compression tool provided by the present invention, the libs folder and the assets folder are first packaged together into a file package, for example, so.
The file package so, zip is then compressed using a compression tool provided by the present invention, for example, under the name lib software. In particular, a command "java-jar-a lib so compressed. jar # file package path #", where "# file package path #" is a path of so.
The generated compressed packets can be selected to be stored locally or uploaded to a background server. For example, so _ compressed. When the compressed packet so _ compressed, zip is subjected to zip decompression, a so _ compressed file is obtained, which corresponds to the original so library file placed in the assets folder before being compressed using the LZMA algorithm. Or the compressed packet can be uploaded to a background server, so that local storage resources can be further saved. For example, the background server is a cloud server, and at this time, a command "java-jar-alibso compression. // libsocompressors/so/.
Step 202, when an application program running in the operating system client calls the original dynamic library file, obtaining an application program interface required when the original dynamic library file is called through loading an interface file.
The step description is the same as step 102, and is not repeated here.
Step 203, judging whether the original dynamic library file exists in the memory by calling an application program interface. If yes, go to step 204; otherwise, step 205 is performed.
The purpose of this step is to intercept the call of the dynamic library file using the application program interface given in the interface file, such as the above-mentioned SoCompresssGetSoPath (libSoName) interface. When an application program runs in an operating system, a project directory is automatically generated in the memory for storing required resource files, such as files folders, and whether the original dynamic library files are contained or not is judged by accessing the folders in the project directory.
Step 204, the application program calls the original dynamic library file.
In a specific application, after it is determined that the original dynamic library file exists in the memory in step 203, the application program may directly access the files folder in the item directory in the memory, obtain the original dynamic library file, and call the original dynamic library file.
Step 205, determine whether the compressed packet is decompressed.
If the original dynamic library file does not exist in the memory, whether the compressed packet is decompressed before is further judged. In an embodiment, the determination may be made by detecting whether a configuration file generated when the compressed packet is decompressed exists in the memory. If the configuration file is detected in the memory, judging that the compressed packet is decompressed, and sequentially executing step 206, step 207 and step 204; otherwise, step 208 is performed.
Step 206, determining a storage folder established for the application program in the memory.
Under the item directory established in the memory for the application program, a storage folder for storing the decompressed dynamic library file, for example,/files/so-uncompressed, is found to obtain the decompressed original dynamic library file.
And step 207, replacing the path address for calling the original dynamic library file with the path address of the storage folder.
In specific application, the path address of the calling original dynamic library file is reset and replaced by the path address of the folder/files/so-uncompressed, and the path address is used as a decompressed so library path and is transmitted to a system.
Then, step 204 is executed again, so as to complete the call to the original dynamic library file.
Step 208, detecting whether the memory contains a compressed packet.
If it is determined in step 205 that the compressed packet is never decompressed, i.e., needs to be decompressed for the first time, it is further detected whether the memory includes the required compressed packet. If yes, sequentially executing step 209, step 210, step 207 and step 204; otherwise, step 211 is executed.
And step 209, decompressing the compressed packet by using the decompression processing file to obtain an original dynamic library file.
In a specific application, after the compressed package so _ compressed file is found in the assets folder, the compressed package is decompressed by using the decompression processing file so _ compressed.
And step 210, storing the decompressed original dynamic library file in a storage folder established for the application program in the memory.
In specific application, the original so library file obtained by decompression is stored in a files/so-uncompressed folder established in the memory for the application program. Then, step 207 and step 204 are executed again, thereby completing the call to the original dynamic library file.
And step 211, downloading the compressed package from the server to the local.
If it is detected in step 208 that the memory does not contain the compressed packet, the operating system client may request the background server to obtain the compressed packet, and may select to request to obtain a part of the compressed packet file according to the called requirement, download the compressed packet from the server, and store the compressed packet locally. For example, the compressed packet so _ compressed. Then, step 209, step 210, step 207 and step 204 are executed in sequence, thereby completing the call to the original dynamic library file.
In addition, the compressed package can be downloaded asynchronously, and the downloading progress is displayed through the user interface.
In the embodiment of the invention, whether the original dynamic library file exists in the memory is judged by calling the application program interface, if not, whether the compressed packet is decompressed is judged, if the compressed packet is decompressed for the first time, whether the compressed packet exists in the memory is further detected, so that various acquisition modes of the original dynamic library file are realized, and the flexible calling mode is improved; the generated compressed packets are stored locally or uploaded to a cloud server, so that control over local storage resources can be achieved, and the resource utilization rate of the electronic equipment is improved.
FIG. 3 is a flowchart illustrating a method for processing a dynamic library file according to another embodiment of the present invention. The method is applied to an operating system client in the electronic device, and referring to fig. 3, the method comprises the following steps:
and step 301, compressing the original dynamic library file by using an LZMA algorithm to generate a compression packet.
Step 302, selecting to store the compressed packet in a local resource folder or upload the compressed packet to a cloud server.
In one embodiment, user operations are received and selection is performed according to user instructions. FIG. 4a is a diagram of a user interface 410 for selecting a storage method of compressed packets according to an embodiment of the invention. As shown in fig. 4a, the user is provided with the option of: the generated compressed packet can be stored in a local folder, and the folder in the local resource manager is browsed by clicking a button 411 and then stored; alternatively, the generated compressed packet may be uploaded to the cloud, and the button 412 may be clicked to send to the server.
In other embodiments, the operating system client may decide how to select according to the size of the local storage resource. If the local storage resources are limited and the residual space is small, the data are selected to be uploaded to the cloud end, and any local storage resources cannot be occupied.
And 303, generating an interface file and a decompression processing file aiming at the compression package, and storing the interface file and the decompression processing file in a library folder.
For example, an interface file so _ compress. jar file is placed in the libs folder, and a decompression processing file so _ compress. so file is placed in libs/x86 or libs/armeabi.
And step 304, when an application program running in the operating system client calls the original dynamic library file, acquiring an application program interface required when the original dynamic library file is called by loading the interface file.
The step description is the same as step 102, and is not repeated here.
Step 305, judging whether the original dynamic library file exists in the memory by calling an application program interface. If yes, go to step 306; otherwise, step 307 is executed.
Step 306, the application program calls the original dynamic library file.
Step 307, detecting whether the memory contains a compressed packet. If yes, executing step 308, step 309/step 310 and step 306 in sequence; otherwise, step 311 is performed.
And 308, decompressing the compressed packet by using the decompression processing file to obtain an original dynamic library file, and storing the original dynamic library file in a storage folder established for the application program in the memory.
The step description is the same as step 209 and step 210, and is not repeated here.
Step 309, replacing the path address of the calling original dynamic library file with the path address of the storage folder.
The step is the same as step 207 and will not be described herein.
And 310, when the compressed packet is decompressed, displaying decompression prompt information on a user interface.
FIG. 4b is a diagram of a user interface 420 displaying a decompression prompt according to an embodiment of the invention. As shown, when decompressing a compressed packet, the user is prompted that decompression is in progress, and the scale of the decompressed file is displayed by the shaded portion in the progress display bar 421.
And 311, downloading the compressed package from the server to the local, and displaying a downloading prompt message on a user interface.
FIG. 4c is a diagram of a user interface 430 for displaying a download prompting message according to an embodiment of the invention. As shown in the figure, when downloading the compressed package from the cloud, the user is prompted that the time required for downloading is displayed in the progress display bar 431, wherein the shaded portion displays the proportion of the downloaded file.
The embodiment of the invention also provides a processing device of the dynamic library file. Fig. 5 is a schematic diagram illustrating a processing apparatus 500 for dynamic library files according to an embodiment of the present invention, which is applied to an operating system client in an electronic device, and includes:
a compression module 510, configured to generate a compressed package by compressing an original dynamic library file;
a generating module 520, configured to generate an interface file and a decompression processing file for the compressed packet generated by the compressing module 510:
when an application running in the operating system client invokes the original dynamic library file, the apparatus 500 further comprises:
an obtaining module 530, configured to obtain, through the interface file generated by the loading generating module 520, an application program interface required when the original dynamic library file is called;
a first determining module 540, configured to determine whether an original dynamic library file exists in the memory by calling the application program interface obtained by the obtaining module 530; and a process for the preparation of a coating,
the decompressing module 550 is configured to decompress the compressed packet generated by the compressing module 510 by using the decompressing processing file generated by the generating module 520 to obtain the original dynamic library file when the first determining module 540 determines that the original dynamic library file does not exist in the memory.
FIG. 6 is a block diagram of an apparatus 600 for processing a dynamic library file according to another embodiment of the present invention. On the basis of the apparatus 500 shown in fig. 5, the apparatus 600 further comprises:
a second determining module 560, configured to determine whether the compressed packet is decompressed when the first determining module 540 determines that the original dynamic library file does not exist in the memory;
the detecting module 570, configured to detect whether the memory includes the compressed packet when the second determining module 560 determines that the compressed packet is not decompressed;
correspondingly, the decompressing module 550 is configured to, when the detecting module 570 detects that the memory includes the compressed packet, decompress the compressed packet by using the decompressing processing file generated by the generating module 520 to obtain the original dynamic library file.
In an embodiment, the apparatus 600 further comprises:
a sending module 580, configured to upload the compression packet generated by the compression module 510 to the server;
the receiving module 590 is configured to download the compressed packet to the local from the server when the detecting module 570 detects that the memory does not contain the compressed packet;
accordingly, the decompressing module is configured to decompress the compressed packet received by the receiving module 590 by using the decompressing processing file generated by the generating module 520 to obtain the original dynamic library file.
In an embodiment, the apparatus 600 further comprises:
the storage module 610 is configured to store the original dynamic library file obtained by decompression by the decompression module 550 in a storage folder established for the application program in the memory;
and a replacing module 620, configured to replace the path address for calling the original dynamic library file with the path address of the storage folder stored in the storage module.
In an embodiment, the apparatus 600 further comprises:
a determining module 630, configured to determine a storage folder established in the memory for the application program when the second determining module 560 determines that the compressed packet is decompressed;
and a replacing module 620, configured to replace the path address for calling the original dynamic library file with the path address of the storage folder determined by the determining module.
In an embodiment, the second determining module 560 is configured to detect whether a configuration file generated when a compressed packet is decompressed exists in the memory.
In one embodiment, the interface file is stored in a library folder in the memory, and the decompression processing file is stored in a subfolder of the library folder;
accordingly, an obtaining module 530, configured to access the library folder to load the interface file;
a decompression module 550 for accessing the subfolders of the library folder by reading the type of processor used by the electronic device to obtain the decompressed files.
In the above device embodiment, the specific method for each module and unit to implement its own function is described in the method embodiment, and is not described herein again.
Fig. 7 is a diagram illustrating a hardware structure of an electronic device 700 according to an embodiment of the invention. The electronic device may include: processor 710, memory 720, port 730, and bus 740. The processor 710 and the memory 720 are interconnected by a bus 740. Processor 710 may receive and transmit data through port 730. Wherein the content of the first and second substances,
processor 710 is operable to execute modules of machine-readable instructions stored by memory 720.
Memory 720 stores modules of machine-readable instructions executable by processor 710. The instruction modules executable by the processor 710 include: a compression module 721, a generation module 722, an acquisition module 723, a first determination module 724, and a decompression module 725. Wherein the content of the first and second substances,
the compression module 721, when executed by the processor 710, may be: generating a compressed package by compressing an original dynamic library file;
the generation module 722 when executed by the processor 710 may be: generating an interface file and a decompression processing file for the compressed packet generated by the compression module 721;
when an application running in the operating system client invokes the original dynamic library file, the obtaining module 723 when executed by the processor 710 may be: acquiring an application program interface required when the original dynamic library file is called through the interface file generated by the loading generation module 722;
the first determining module 724, when executed by the processor 710, may be: whether an original dynamic library file exists in the memory is judged by calling an application program interface obtained by the obtaining module 723;
the decompression module 725, when executed by the processor 710, may be: when the first determining module 724 determines that the original dynamic library file does not exist in the memory, the decompression processing file generated by the generating module 722 is used to decompress the compressed packet generated by the compressing module 721 to obtain the original dynamic library file.
In one embodiment, the memory 720 stores modules of instructions executable by the processor 710 that further include: a second decision block 726 and a detection block 727. Wherein the content of the first and second substances,
the second determining module 726 may be executed by the processor 710 to: when the first determining module 724 determines that the original dynamic library file does not exist in the memory, it determines whether the compressed packet is decompressed;
the detection module 727 when executed by the processor 710 may be: when the second determining module 726 determines that the compressed packet is not decompressed, it detects whether the memory includes the compressed packet;
accordingly, the decompression module 725, when executed by the processor 710, may be: when the detection module 727 detects that the memory contains a compressed packet, the decompression processing file generated by the generation module 722 is used to decompress the compressed packet to obtain an original dynamic library file.
In one embodiment, the memory 720 stores modules of instructions executable by the processor 710 that further include: a transmitting module 728 and a receiving module 729. Wherein the content of the first and second substances,
the sending module 728, when executed by the processor 710, may be to: uploading the compressed packet generated by the compression module 721 to the server;
the receiving module 729, when executed by the processor 710, may be: when the detection module 727 detects that the memory does not contain the compressed packet, downloading the compressed packet to the local from the server;
accordingly, the decompression module 725, when executed by the processor 710, may be: the compressed packet received by the receiving module 729 is decompressed using the decompression processing file generated by the generating module 722 to obtain the original dynamic library file.
In one embodiment, the memory 720 stores modules of instructions executable by the processor 710 that further include: a storage module 810 and a replacement module 820. Wherein the content of the first and second substances,
the storage module 810, when executed by the processor 710, may be: storing the original dynamic library file obtained by decompression by the decompression module 725 in a storage folder established for the application program in the memory;
the replacement module 820 when executed by the processor 710 may be: and replacing the path address for calling the original dynamic library file with the path address of the storage folder stored in the storage module.
In one embodiment, the memory 720 stores modules of instructions executable by the processor 710 that further include: a determination module 830 and a replacement module 820. Wherein the content of the first and second substances,
the determining module 830 when executed by the processor 710 may be: when the second determining module 726 determines that the compressed packet is decompressed, determining a storage folder established in the memory for the application program;
the replacement module 820 when executed by the processor 710 may be: and replacing the path address for calling the original dynamic library file with the path address of the storage folder stored in the storage module.
It can be seen that the instructions stored in the memory 720, when executed by the processor 710, can implement various functions of the compression module, the generation module, the obtaining module, the first judgment module, the decompression module, the second judgment module, the detection module, the sending module, the receiving module, the storage module, the replacement module and the determination module in the foregoing embodiments.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
In addition, each of the embodiments of the present invention can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like.
The invention also discloses a storage medium in which a data processing program is stored, which data processing program is adapted to carry out any one of the embodiments of the above-described method of the invention.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (18)

1. A processing method of a dynamic library file is applied to an operating system client in an electronic device, and the method comprises the following steps:
generating a plurality of compressed package files by compressing an original dynamic library file, and generating interface files and decompression processing files aiming at the plurality of compressed package files;
uploading the plurality of compressed package files to a server;
when an application program running in the operating system client calls the original dynamic library file, executing the following processing:
acquiring an application program interface required when the original dynamic library file is called by loading the interface file;
when the application program interface is called to judge that the original dynamic library file does not exist in the internal memory, and the plurality of compressed packet files are not decompressed and the plurality of compressed packet files are not contained in the internal memory, requesting the server to obtain a part of compressed packet files in the plurality of compressed packet files according to the requirement of calling the original dynamic library file, decompressing the part of compressed packet files by using the decompression processing file to obtain the required original dynamic library file.
2. The method of claim 1, further comprising:
and when the fact that the internal memory contains the plurality of compressed packet files is detected, decompressing the plurality of compressed packet files by using the decompression processing file to obtain the original dynamic library file.
3. The method of claim 1, wherein the decompression processed file is named a.
4. The method of any of claims 1 to 3, further comprising:
determining a storage folder established in the memory for the application program;
and storing the original dynamic library file obtained by decompression in the storage folder, and replacing the path address for calling the original dynamic library file with the path address of the storage folder.
5. The method of claim 1, further comprising:
and when judging that the plurality of compressed packet files are decompressed, determining a storage folder established in the memory for the application program, and replacing the path address for calling the original dynamic library file with the path address of the storage folder.
6. The method of any of claims 2, 3, or 5, further comprising:
and detecting whether the configuration file generated when the plurality of compressed packet files are decompressed exists in the memory to judge whether the plurality of compressed packet files are decompressed.
7. The method of claim 1, wherein the interface file is stored in a library folder in memory, the decompression processing file being stored in a subfolder of the library folder;
the obtaining of the application program interface required when the original dynamic library file is called by loading the interface file includes:
accessing the library folder to load the interface file;
the decompressing the partially compressed packet file using the decompression processing file comprises:
accessing subfolders of the library folder to obtain the decompression processing file by reading a type of a processor used by the electronic device.
8. The method of any of claims 1, 2, 3, 5, or 7, wherein the generating a plurality of compressed package files by compressing an original dynamic library file comprises:
the original dynamic library file is compressed using the LZMA algorithm.
9. The method of any of claims 1, 2, 3, 5, or 7, further comprising:
when the compressed package file is decompressed, the decompression prompt information is displayed on the user interface.
10. An apparatus for processing a dynamic library file, applied to an operating system client in an electronic device, the apparatus comprising:
the compression module is used for generating a plurality of compressed package files by compressing the original dynamic library files;
a generating module, configured to generate interface files and decompression processing files for the plurality of compressed packet files generated by the compressing module;
the sending module is used for uploading the plurality of compressed package files generated by the compression module to a server;
when an application running in the operating system client invokes the original dynamic library file, the apparatus further comprises:
the acquisition module is used for acquiring an application program interface required when the original dynamic library file is called by loading the interface file generated by the generation module;
the first judgment module is used for judging whether the original dynamic library file exists in the memory or not by calling the application program interface obtained by the acquisition module; and a process for the preparation of a coating,
the second judging module is used for judging whether the plurality of compressed packet files are decompressed or not when the first judging module judges that the original dynamic library file does not exist in the memory;
the detection module is used for detecting whether the memory contains the plurality of compressed packet files or not when the second judgment module judges that the plurality of compressed packet files are not decompressed;
and the decompression module is used for requesting the server to obtain a part of the plurality of compressed packet files according to the requirement of calling the original dynamic library file when the detection module detects that the memory does not contain the plurality of compressed packet files, and decompressing the part of the compressed packet files by using the decompression processing file generated by the generation module so as to obtain the required original dynamic library file.
11. The apparatus of claim 10, further comprising:
the decompression module is configured to decompress the plurality of compressed packet files by using the decompression processing file generated by the generation module when the detection module detects that the memory includes the plurality of compressed packet files, so as to obtain the original dynamic library file.
12. The apparatus of claim 10, wherein the decompression processed file is named as a.so file.
13. The apparatus of any of claims 10 to 12, further comprising:
the storage module is used for determining a storage folder established in the memory for the application program; storing the original dynamic library file obtained by decompression of the decompression module in the storage folder;
and the replacing module is used for replacing the path address for calling the original dynamic library file with the path address of the storage folder stored in the storage module.
14. The apparatus of claim 10, further comprising:
a determining module, configured to determine a storage folder established in the memory for the application program when the second determining module determines that the plurality of compressed packet files are decompressed;
and the replacing module is used for replacing the path address for calling the original dynamic library file with the path address of the storage folder determined by the determining module.
15. The apparatus according to any one of claims 11, 12, or 14, wherein the second determining module is configured to detect whether a configuration file generated when the plurality of compressed packet files are decompressed exists in a memory, so as to determine whether the plurality of compressed packet files are decompressed.
16. The apparatus according to claim 10, wherein the interface file is stored in a library folder in the memory, and the decompression processing file is stored in a subfolder of the library folder;
the acquisition module is used for accessing the library folder to load the interface file;
the decompression module is used for accessing the subfolders of the library folder to acquire the decompression processing file by reading the type of the processor used by the electronic equipment.
17. An electronic device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, implement the method of any of claims 1-9.
18. A computer-readable storage medium having computer-readable instructions stored thereon which, when executed by at least one processor, implement the method of any one of claims 1 to 9.
CN201510458871.2A 2015-07-30 2015-07-30 Method and device for processing dynamic library file Active CN106406923B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510458871.2A CN106406923B (en) 2015-07-30 2015-07-30 Method and device for processing dynamic library file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510458871.2A CN106406923B (en) 2015-07-30 2015-07-30 Method and device for processing dynamic library file

Publications (2)

Publication Number Publication Date
CN106406923A CN106406923A (en) 2017-02-15
CN106406923B true CN106406923B (en) 2020-09-04

Family

ID=58008996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510458871.2A Active CN106406923B (en) 2015-07-30 2015-07-30 Method and device for processing dynamic library file

Country Status (1)

Country Link
CN (1) CN106406923B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714642B (en) * 2018-12-29 2022-03-08 深圳Tcl数字技术有限公司 Method for reusing Linux application in intelligent system, intelligent television and storage medium
CN110414217B (en) * 2019-07-31 2023-03-24 广东小天才科技有限公司 Safe operation method and device of application program, electronic equipment and storage medium
CN110633253A (en) * 2019-08-20 2019-12-31 贵州省广播电视信息网络股份有限公司 Method and system for decompressing compression packet and generating project file
CN111008178B (en) * 2019-11-05 2024-04-30 北京字节跳动网络技术有限公司 Data processing method, device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398807A (en) * 2008-10-21 2009-04-01 北京无线恒远科技有限公司 Method and device for decompressing mobile terminal zip file
CN101763269A (en) * 2010-01-27 2010-06-30 中兴通讯股份有限公司 Method for making software installation package
CN102231117A (en) * 2011-07-08 2011-11-02 盛乐信息技术(上海)有限公司 Software installment method and system for embedded platform
CN103955375A (en) * 2014-05-21 2014-07-30 北京安兔兔科技有限公司 Generation method for application installation file and starting method and device for application
CN104484174A (en) * 2014-12-12 2015-04-01 北京国双科技有限公司 Processing method and processing device for compressed file with RAR (Roshal A Rchive) format

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5970245A (en) * 1997-01-03 1999-10-19 Ncr Corporation Method for debugging shared procedures contained in dynamic link library files
CN102314365A (en) * 2011-09-08 2012-01-11 北京新媒传信科技有限公司 Method and tool for making installation package
CN104156225B (en) * 2013-05-14 2018-07-06 腾讯科技(深圳)有限公司 A kind of method for down loading of installation kit, system and server
US9128793B2 (en) * 2013-05-14 2015-09-08 Tencent Technology (Shenzhen) Company Limited Method, system and server for downloading installation package
CN103577225B (en) * 2013-10-22 2016-11-23 北京奇虎科技有限公司 A kind of software installation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398807A (en) * 2008-10-21 2009-04-01 北京无线恒远科技有限公司 Method and device for decompressing mobile terminal zip file
CN101763269A (en) * 2010-01-27 2010-06-30 中兴通讯股份有限公司 Method for making software installation package
CN102231117A (en) * 2011-07-08 2011-11-02 盛乐信息技术(上海)有限公司 Software installment method and system for embedded platform
CN103955375A (en) * 2014-05-21 2014-07-30 北京安兔兔科技有限公司 Generation method for application installation file and starting method and device for application
CN104484174A (en) * 2014-12-12 2015-04-01 北京国双科技有限公司 Processing method and processing device for compressed file with RAR (Roshal A Rchive) format

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JarFile读取jar内文件实例;rchm8519;《https://blog.csdn.net/rchm8519/article/details/39557499》;20140925;1-6 *

Also Published As

Publication number Publication date
CN106406923A (en) 2017-02-15

Similar Documents

Publication Publication Date Title
CN108037961B (en) Application program configuration method, device, server and storage medium
CN106406923B (en) Method and device for processing dynamic library file
WO2015074467A1 (en) Data update method, apparatus, and system and storage medium
US11240290B2 (en) Application download method and apparatus, application sending method and apparatus, and system
US20130238574A1 (en) Cloud system and file compression and transmission method in a cloud system
CN102135892A (en) Application program running method, device and system
CN105138376A (en) Mixed model application, webpage resource upgrading method thereof, mobile terminal and system
TW201440475A (en) Streaming ZIP
CN105446975A (en) File packing method and device
CN106325896B (en) Shared function library file processing method and device for installation package
CN112149035A (en) Website static resource processing method and device
CN106897052B (en) APK file compression method and device
CN111562929A (en) Method, device and equipment for generating patch file and storage medium
CN112115056B (en) Project deployment method and device, server and storage medium
KR102141749B1 (en) APP program execution method and device
CN111177600B (en) Built-in webpage loading method and device based on mobile application
CN108459861B (en) Software installation method and system
CN113703877B (en) Method and device for generating image based on image generation plug-in and readable storage medium
CN102360381A (en) Device and method for performing lossless compression on embedded program
CN113127860B (en) Executable file detection method, device, terminal and storage medium
CN110502251B (en) Application installation method and device
CA2759461C (en) Platform specific payload management
CN112988686A (en) Plug-in processing method, device, equipment and storage medium
CN114327667B (en) Dynamic resource loading method and system
CN115495026B (en) Method, device and equipment for optimizing memory processing and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant