A method, device and computer program product for dynamically loading SO library

By obtaining and generating the download link information of the SO library, the automatic packaging and dynamic loading of the SO library is realized, which solves the problem of low efficiency of manual management of the SO library, improves development efficiency and reliability, and is suitable for large-scale applications.

CN118409814BActive Publication Date: 2024-09-17CHENGDU YUBUO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410874836.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-17
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In the existing technology, manual management of SO libraries increases workload, reduces development efficiency, and is error-prone, resulting in inefficient dynamic loading of SO libraries.

Method used

By obtaining the library information of the target SO library, generating download link information, deleting the SO library and packaging it into the application package, and dynamically loading the SO library using remote URL links, automatic packaging and loading are achieved.

Benefits of technology

It reduces the workload, improves development efficiency, ensures the reliability of SO library management, and is suitable for large-scale applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118409814B
    Figure CN118409814B
Patent Text Reader

Abstract

The present invention discloses a method, device and computer program product for dynamically loading an SO library. When packaging an SO library, the present invention first obtains library information of a target SO library, and after obtaining the target SO library, deletes the target SO library from an application package; then, download link information corresponding to the target SO library is generated according to the library information; then, the download link information is stored in a packaging directory, and all files in the packaging directory are packaged into an application package to obtain a finished application package; finally, when a local terminal runs the finished application package, a remote URL link of the target SO library can be obtained through the download link information; thus, the dynamic loading of the target SO library can be completed based on the remote URL link; thus, the present invention realizes automatic packaging and loading of the SO library, which not only reduces the workload and improves the development efficiency, but also ensures the reliability of SO library management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Android application development, and in particular relates to a dynamic loading method and device of an SO library and a computer program product. Background Art

[0002] Android applications are mainly developed based on Java, but for various reasons, some third-party software development kits (SDK) functions are implemented using C / C++ and packaged into dynamic libraries SO (hereinafter referred to as SO libraries), while Java code implements function development by calling methods in the SO libraries; however, with the iteration of products, more third-party SDKs will be added to product applications, and the corresponding SO libraries will also increase. In the long run, the SO libraries in the package will even account for more than 50% of the volume of the application installation package. The smaller the installation package size, the higher the user's download conversion rate will be. Therefore, developers hope to reduce the size of the installation package as much as possible to increase the download conversion rate.

[0003] At present, most of them are to reduce the size of the installation package while implementing the corresponding functions by loading SO libraries that are not in APK (Android application package). The usual practice is: manually delete the SO libraries from the APK, collect them and manually upload them to the remote end; at the same time, the versions also need to be manually saved locally and provided to the loading process for use; thus, the above-mentioned prior art has the following shortcomings: manually managing the relevant SO libraries not only increases the workload and reduces the development efficiency, but is also prone to errors; based on this, how to provide a dynamic loading method of SO libraries with small workload, high development efficiency and reliability has become a problem to be solved urgently. Summary of the invention

[0004] The purpose of the present invention is to provide a method, device and computer program product for dynamically loading an SO library, so as to solve the problems of heavy workload, low development efficiency and easy error in the prior art of manually managing the SO library.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, a method for dynamically loading an SO library is provided, comprising:

[0007] The project packaging end obtains library information of the target SO library, and after obtaining the library information of the target SO library, deletes the target SO library from the application package in the application packaging project;

[0008] The project packaging end generates download link information of the target SO library based on the library information of the target SO library, wherein the download link information is used to determine the remote URL link of the target SO library;

[0009] The project packaging end stores the download link information in a packaging directory corresponding to the application packaging project, and packages all files in the packaging directory into the application package, so as to obtain a finished application package after packaging is completed;

[0010] The project packaging end sends the finished application to the local end;

[0011] The local end obtains the finished application package;

[0012] The local end runs the finished application package and obtains download link information from the finished application package;

[0013] The local end obtains the remote URL link of the target SO library based on the download link information;

[0014] The local end uses the remote URL link to download the target SO library from the remote server, and after downloading, completes the dynamic loading of the target SO library.

[0015] Based on the above disclosed content, when packaging the SO library, the present invention first obtains the library information of the target SO library, and after obtaining the target SO library, deletes the target SO library from the application package to achieve the purpose of reducing the package size; then, the present invention generates the download link information corresponding to the target SO library according to the library information of the target SO library; then, the aforementioned download link information is stored in the packaging directory, and all the files in the packaging directory are packaged into the application package to obtain the finished application package; finally, when the local end runs the finished application package, the remote URL link of the target SO library can be obtained through the internal download link information; in this way, the dynamic loading of the target SO library can be completed based on the remote URL link; thus, the present invention realizes the automatic packaging and loading of the SO library without manual management. Compared with the traditional technology, it not only reduces the workload and improves the development efficiency, but also ensures the reliability of SO library management; therefore, it is very suitable for large-scale application and promotion.

[0016] In a possible design, the library information of the target SO library includes: the library name of the target SO library and the corresponding CPU architecture;

[0017] Wherein, based on the library information of the target SO library, generating the download link information of the target SO library includes:

[0018] The project packaging end obtains verification information of the target SO library, wherein the verification information is summary information of the target SO library;

[0019] The project packaging end generates the remote URL link using the library name, the CPU architecture and the verification information;

[0020] The project packaging end generates the download link information according to the library information of the target SO library and the remote URL link, wherein the download link information adopts a key-value pair data storage structure, and the key in the key-value pair data storage structure is the library name and CPU architecture of the target SO library, and the value is the remote URL link.

[0021] In one possible design, after generating the remote URL link, the method further includes:

[0022] The project packaging end sends link query information to the remote server, so that after receiving the link query information, the remote server performs a link query based on the link query information to obtain a link query result of the target SO library, and sends the link query result of the target SO library to the project packaging end, wherein the link query result is empty or non-empty;

[0023] The project packaging end receives the link query result, and when the link query result is empty, sends the remote URL link to the remote server to make the remote URL link legal.

[0024] In one possible design, after generating the download link information of the target SO library, the method further includes:

[0025] The project packaging end generates a Json file based on the download link information;

[0026] Accordingly, storing the download link information in the packaging directory corresponding to the application packaging project includes:

[0027] The project packaging end stores the Json file in the packaging directory, so that after all the files in the packaging directory are packaged into the application package, the finished application package is obtained.

[0028] In one possible design, before deleting the target SO library from the application package in the application packaging project, the method further includes:

[0029] The project packaging end constructs the configuration task of the target SO library;

[0030] The project packaging end injects the configuration task of the target SO library into the merge native library task in the application packaging project, so as to delete the target SO library from the application package in the application packaging project based on the configuration task, and generate download link information of the target SO library;

[0031] Accordingly, before storing the download link information in the packaging directory corresponding to the application packaging project, the method further includes:

[0032] The project packaging end constructs a packaging task for the target SO library;

[0033] The project packaging end injects the packaging task of the target SO library into the merged native library task in the application packaging project, so as to store the download link information in the packaging directory corresponding to the application packaging project based on the packaging task, and package all files in the packaging directory into the application package.

[0034] In a possible design, the download link information adopts a key-value pair data storage structure, wherein the key in the key-value pair data storage structure is the library name and CPU architecture of the target SO library, the value is a remote URL link, and the remote URL link contains verification information of the target SO library;

[0035] Wherein, based on the download link information, obtaining the remote URL link of the target SO library includes:

[0036] The local end uses the library name and CPU architecture of the target SO library in the download link information as a search index, and based on the search index, searches for the remote URL link of the target SO library in the finished application package;

[0037] Correspondingly, the local end obtains the remote URL link of the target SO library based on the download link information, which includes:

[0038] The local end obtains the locally downloaded target SO library and generates local verification information of the locally downloaded target SO library;

[0039] The local end determines whether the local verification information is the same as the verification information of the target SO library;

[0040] If not, the local end downloads the target SO library based on the found remote URL link.

[0041] In the second aspect, a dynamic loading device for an SO library is provided, taking the device as a project packaging end as an example, including:

[0042] A configuration unit, configured to obtain library information of a target SO library, and after obtaining the library information of the target SO library, delete the target SO library from the application package in the application packaging project;

[0043] A link information generating unit, configured to generate download link information of the target SO library based on the library information of the target SO library, wherein the download link information is used to determine a remote URL link of the target SO library;

[0044] The packaging unit is used to store the download link information in a packaging directory corresponding to the application packaging project, and to package all files in the packaging directory into the application package, so as to obtain a finished application package after the packaging is completed, so that when the local end runs the finished application package, the remote URL link of the target SO library is obtained based on the download link information in the finished application package, and the dynamic loading of the target SO library is completed based on the remote URL link.

[0045] In a third aspect, a dynamic loading device for an SO library is provided, taking the device as a local end as an example, including:

[0046] An acquisition unit, used to acquire a finished application package, wherein the finished application package includes download link information of a target SO library, and the download link information is used to determine a remote URL link of the target SO library;

[0047] An operating unit, used for operating the finished application package and obtaining download link information from the finished application package;

[0048] A loading unit, used to obtain a remote URL link of the target SO library based on the download link information;

[0049] The loading unit is also used to download the target SO library from the remote server using the remote URL link, and complete the dynamic loading of the target SO library after downloading.

[0050] In a fourth aspect, an electronic device is provided, comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the dynamic loading method of the SO library as in the first aspect or any possible design in the first aspect.

[0051] In a fifth aspect, a storage medium is provided, on which instructions are stored. When the instructions are run on a computer, a dynamic loading method of the SO library as in the first aspect or any possible design of the first aspect is executed.

[0052] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, causes the computer to execute a dynamic loading method of the SO library as in the first aspect or any possible design of the first aspect.

[0053] Beneficial effects:

[0054] (1) The present invention realizes the automatic packaging and loading of SO libraries without manual management. Compared with the traditional technology, it not only reduces the workload and improves the development efficiency, but also ensures the reliability of SO library management; therefore, it is very suitable for large-scale application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of the steps of a dynamic loading method of an SO library provided by an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of the structure of a project packaging terminal provided by an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of the structure of a local terminal provided by an embodiment of the present invention;

[0058] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0060] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.

[0061] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.

[0062] Example:

[0063] See also Figure 1 As shown, the dynamic loading method of the SO library provided in this embodiment can realize the automatic management of the SO library. In this way, the developer only needs to configure the library information of the SO library to realize the dynamic loading of the SO library, and there is no need to manually manage the version of the SO library. All operations are automated. Based on this, compared with the traditional technology, the method not only reduces the workload and improves the development efficiency, but also ensures the reliability of SO library management; therefore, it is very suitable for large-scale application and promotion; among them, for example, the method can be but not limited to running on the project packaging end and the local end side, optionally, the project packaging end can be but not limited to a personal computer or a server, and the local end can be but not limited to a personal computer (personal computer, PC), a tablet computer or a smart phone. It can be understood that the aforementioned execution subject does not constitute a limitation on the embodiments of the present application. Accordingly, the running steps of the method can be but not limited to the following steps S1 to S8.

[0064] S1. The project packaging end obtains the library information of the target SO library, and after obtaining the library information of the target SO library, deletes the target SO library from the application package in the application packaging project; in specific implementation, for example, the project packaging end can be based on but not limited to the Android Gradle plug-in (a new generation of building tools based on JVM) to implement the packaging function of the target SO library; specifically, the developer can, but not limited to, first set the Android Gradle configuration file in the project packaging end based on the library information of the target SO library (i.e., the library information of the SO library to be used); then, the project packaging end can obtain the library information of the target SO library based on the Android Gradle configuration file, and after obtaining the library information, delete the target SO library from the application package; in this way, the size of the application package can be reduced, thereby achieving the purpose of improving the download conversion rate.

[0065] Further, the library information of the target SO library may include, but is not limited to, the library name of the target SO library and the corresponding CPU architecture; in this way, the download link information of the target SO library may be generated based on the aforementioned information, so that the dynamic loading of the target SO library may be subsequently completed based on the download link information.

[0066] Optionally, the process of generating the example download link information may be but is not limited to the process shown in the following step S2.

[0067] S2. The project packaging end generates download link information of the target SO library based on the library information of the target SO library, wherein the download link information is used to determine the remote URL link of the target SO library; in this embodiment, the following steps S21 to S23 may be used, for example but not limited to, to generate the aforementioned download link information.

[0068] S21. Obtain verification information of the target SO library, wherein the verification information is summary information of the target SO library; in this embodiment, the verification information is used for subsequent version verification when the target SO library is loaded; thus, the verification information is written into the download link information together, so that automatic management of the SO library version can be achieved.

[0069] After obtaining the verification information of the target SO library, the remote URL link of the target SO library can be generated in combination with the aforementioned library information, wherein the generation process can be but is not limited to the one shown in the following step S22.

[0070] S22. Using the library name, the CPU architecture and the verification information, generating the remote URL link; in specific applications, for example, but not limited to, the aforementioned library name, CPU architecture and verification information are spliced, so that after splicing, a remote URL (Uniform Resource Locator; Uniform Resource Locator) link; at the same time, in order to ensure the legitimacy of the remote URL link, after generating the remote URL link, this embodiment needs to perform the following operations: send link query information to the remote server, so that after receiving the link query information, the remote server performs a link query based on the link query information to obtain the link query result of the target SO library, and sends the link query result of the target SO library to the project packaging end (the link query result is empty or non-empty, empty means that the remote server does not have the remote URL link of the target SO library, and non-empty means that it exists); and after receiving the link query result, the project packaging end can send the remote URL link to the remote server when the link query result is empty, so as to legalize the remote URL link; in this embodiment, sending the aforementioned remote URL link to the remote server is equivalent to link authentication or filing, so as to make it legal; of course, if the link query result is non-empty, it is not necessary to send it to the remote server.

[0071] Thus, after obtaining the remote URL link of the target SO library, download link information can be generated based on it, and the process can be but not limited to the following step S23.

[0072] S23. Generate the download link information according to the library information of the target SO library and the remote URL link, wherein the download link information adopts a key-value data storage structure, and the key in the key-value data storage structure is the library name and CPU architecture of the target SO library, and the value is the remote URL link; in this embodiment, the download link information is essentially a MAP data structure (which is a data structure of Android, and its stored content is a key-value mapping), so that remote URL link storage and fast search can be implemented based on the key-value data storage structure.

[0073] In the specific implementation, for example, this embodiment adopts a custom task method to complete the functions of deleting the aforementioned target SO library, obtaining verification information, generating download link information, etc.; specifically, this embodiment first constructs a configuration task of the target SO library (which can be named but not limited to plitSoNative Task) before deleting the target SO library from the application package in the application packaging project; then, the configuration task of the target SO library is injected into the merge native library task (i.e., mergeNativeLibs Task in Android Gradle) in the application packaging project, so as to delete the target SO library from the application package in the application packaging project based on the configuration task, and generate the download link information of the target SO library; at the same time, after obtaining the download link information, this embodiment will also generate a Json file based on the download link information (i.e., convert the aforementioned download link information into a Json file), so as to complete the storage of the download link information based on the Json file later.

[0074] Therefore, through the aforementioned steps S21 to S23, the download link information of the target SO library can be generated, and then, the download link information can be packaged into the application package, so that when the subsequent application package is run, the dynamic loading of the target SO library can be realized based on the download link information inside it; wherein, the packaging process of the download link information can be but is not limited to as shown in the following step S3.

[0075] S3. The project packaging end stores the download link information in the packaging directory corresponding to the application packaging project, and packages all the files in the packaging directory into the application package, so as to obtain a finished application package after the packaging is completed; in specific applications, the packaging task of the target SO library is first constructed, and then the packaging task of the target SO library is injected into the merged native library task in the application packaging project, and then, based on the aforementioned packaging task, the download link information (i.e. the aforementioned Json file) can be stored in the packaging directory corresponding to the application packaging project, and all the files in the packaging directory are packaged into the application package.

[0076] In this embodiment, the packaging directory may be, but is not limited to:

[0077] app / build / intermediates / compressed_assets / xxx / out / assets, where xxx is buildType, which refers to the build method (i.e. packaging method) used when building the project; in this way, the packaging directory changes dynamically according to the packaging method; at the same time, the example can be but is not limited to storing all files under the packaging directory in the assets folder of the application package (which is a folder that plays a key role in Android development and is mainly used to store the original files required by the application). Of course, the aforementioned directories and storage folders are only for illustration and are not limited to the aforementioned examples.

[0078] In this way, based on the aforementioned steps S1 to S3, the packaging process of the target SO library can be completed (of course, it refers to link packaging); then, it can be sent to the installation end of the application package (i.e., the local end), so that when the application package is run on the local end, the dynamic loading of the target SO library can be realized; wherein, the dynamic loading process of the target SO library on the local end can be but is not limited to as shown in the following steps S4 to S8.

[0079] S4. The project packaging end sends the finished application to the local end.

[0080] S5. The local end obtains the finished application package; in this embodiment, after receiving the finished application package, the local end can perform local dynamic loading of the target SO library, and the process may be, but is not limited to, as shown in the following steps S6 to S8.

[0081] S6. The local end runs the finished application package and obtains the download link information from the finished application package; in the specific implementation, the download link information is obtained by parsing the finished application package, and after obtaining the download link information, the remote URL link of the target SO library can be found based on the download link information, so that the remote URL link can be used to download the target SO library later; wherein, the remote URL link search process can be but is not limited to as shown in the following step S7.

[0082] S7. The local end obtains the remote URL link of the target SO library based on the download link information; in this embodiment, it has been explained above that the download link information is essentially a key-value pair data storage structure, therefore, the download link information can be first obtained from the assets file; then, the library name and CPU architecture of the target SO library in the download link information are used as search indexes; finally, based on the search index, the remote URL link of the target SO library can be found in the finished application package; in this way, it is equivalent to using the key in the key-value pair to search for the value, so that the remote URL link of the target SO library can be quickly found; and after obtaining the remote URL link, the target SO library can be downloaded, and the process can be but not limited to as shown in the following step S8.

[0083] S8. The local end uses the remote URL link to download the target SO library from the remote server, and after downloading, completes the dynamic loading of the target SO library; in the specific implementation, it has been explained above that the remote URL link contains the verification information (i.e., summary information) of the target SO library; thus, this embodiment also needs to perform version verification before downloading, and the process is: first, obtain the locally downloaded target SO library, and generate local verification information of the locally downloaded target SO library; then, determine whether the local verification information is the same as the verification information of the target SO library (i.e., determine whether the summary information of the local SO library is the same as the summary information in the remote URL link); wherein, if the two are different, it means that the versions of the local and remote target SO libraries are inconsistent and need to be updated. At this time, the target SO library can be downloaded based on the remote URL link found; otherwise, if the two are the same, it means that the versions are consistent, and at this time, no update is required; thus, after completing the download of the target SO library, the target SO library can be loaded to implement the corresponding function.

[0084] Therefore, through the dynamic loading method of the SO library described in detail in the aforementioned steps S1 to S8, the present invention can realize the automatic management of the SO library. In this way, the developer only needs to configure the library information of the SO library to realize the dynamic loading of the SO library, and there is no need to manually manage the version of the SO library. All operations are automated. Based on this, compared with the traditional technology, the present invention not only reduces the workload and improves the development efficiency, but also ensures the reliability of SO library management; therefore, it is very suitable for large-scale application and promotion.

[0085] like Figure 2 As shown, the second aspect of this embodiment provides a hardware device for implementing the dynamic loading method of the SO library described in the first aspect of the embodiment, wherein, taking the device as a project packaging end as an example, the device includes:

[0086] The configuration unit is used to obtain the library information of the target SO library, and after obtaining the library information of the target SO library, delete the target SO library from the application package in the application packaging project.

[0087] The link information generating unit is used to generate the download link information of the target SO library based on the library information of the target SO library, wherein the download link information is used to determine the remote URL link of the target SO library.

[0088] The packaging unit is used to store the download link information in a packaging directory corresponding to the application packaging project, and to package all files in the packaging directory into the application package, so as to obtain a finished application package after the packaging is completed, so that when the local end runs the finished application package, the remote URL link of the target SO library is obtained based on the download link information in the finished application package, and the dynamic loading of the target SO library is completed based on the remote URL link.

[0089] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.

[0090] like Figure 3 As shown, the third aspect of this embodiment provides a hardware device for implementing the dynamic loading method of the SO library described in the first aspect of the embodiment, wherein, taking the device as a local end as an example, the device includes:

[0091] The acquisition unit is used to acquire a finished application package, wherein the finished application package includes download link information of a target SO library, and the download link information is used to determine a remote URL link of the target SO library.

[0092] The running unit is used to run the finished application package and obtain download link information from the finished application package.

[0093] The loading unit is used to obtain the remote URL link of the target SO library based on the download link information.

[0094] The loading unit is also used to download the target SO library from the remote server using the remote URL link, and complete the dynamic loading of the target SO library after downloading.

[0095] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.

[0096] like Figure 4As shown, the fourth aspect of this embodiment provides an electronic device, comprising: a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the dynamic loading method of the SO library as described in the first aspect of the embodiment.

[0097] For example, the memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) and / or first in last out (FILO), etc. Specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). At the same time, the processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state.

[0098] In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. For example, the processor may not be limited to a microprocessor of the STM32F105 series, a reduced instruction set computer (RISC) microprocessor, an X86 architecture processor, or a processor with an integrated embedded neural network processor (NPU); the transceiver may be, but is not limited to, a wireless fidelity (WIFI) wireless transceiver, a Bluetooth wireless transceiver, a general packet radio service technology (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver and / or a 5G transceiver, etc. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0099] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.

[0100] The fifth aspect of this embodiment provides a storage medium storing instructions for the dynamic loading method of the SO library described in the first aspect of the embodiment, that is, the storage medium stores instructions, and when the instructions are run on a computer, the dynamic loading method of the SO library described in the first aspect of the embodiment is executed.

[0101] The storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, a CD, a hard disk, a flash memory, a USB flash drive and / or a memory stick, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0102] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.

[0103] A fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the dynamic loading method of the SO library as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0104] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A dynamic loading method for SO library, It is characterized in that Applied to project packaging, including: Obtaining library information of a target SO library, and after obtaining the library information of the target SO library, deleting the target SO library from the application package in the application packaging project; Based on the library information of the target SO library, generating download link information of the target SO library, wherein the download link information is used to determine the remote URL link of the target SO library; The download link information is stored in a packaging directory corresponding to the application packaging project, and all files in the packaging directory are packaged into the application package, so that after the packaging is completed, a finished application package is obtained, so that when the local end runs the finished application package, the remote URL link of the target SO library is obtained based on the download link information in the finished application package, and the dynamic loading of the target SO library is completed based on the remote URL link; The library information of the target SO library includes: the library name of the target SO library and the corresponding CPU architecture; Wherein, based on the library information of the target SO library, generating the download link information of the target SO library includes: Acquire verification information of the target SO library, wherein the verification information is summary information of the target SO library; Generate the remote URL link using the library name, the CPU architecture and the verification information; Generate the download link information according to the library information of the target SO library and the remote URL link, wherein the download link information adopts a key-value pair data storage structure, and the key in the key-value pair data storage structure is the library name and CPU architecture of the target SO library, and the value is the remote URL link; After generating the remote URL link, the method further includes: Sending link query information to a remote server, so that after receiving the link query information, the remote server performs a link query based on the link query information, obtains a link query result of the target SO library, and sends the link query result of the target SO library to the project packaging end, wherein the link query result is empty or non-empty; receiving the link query result, and when the link query result is empty, sending the remote URL link to the remote server to make the remote URL link legal; Before deleting the target SO library from the application package in the application packaging project, the method further includes: Construct the configuration task of the target SO library; Injecting the configuration task of the target SO library into the merge native library task in the application packaging project, so as to delete the target SO library from the application package in the application packaging project based on the configuration task, and generate download link information of the target SO library; Accordingly, before storing the download link information in the packaging directory corresponding to the application packaging project, the method further includes: Construct a packaging task for the target SO library; The packaging task of the target SO library is injected into the merge native library task in the application packaging project, so that the download link information is stored in the packaging directory corresponding to the application packaging project based on the packaging task, and all files in the packaging directory are packaged into the application package.

2. The method according to claim 1, It is characterized in that After generating the download link information of the target SO library, the method further includes: Generate a Json file based on the download link information; Accordingly, storing the download link information in the packaging directory corresponding to the application packaging project includes: The Json file is stored in the packaging directory, so that after all files in the packaging directory are packaged into the application package, the finished application package is obtained.

3. A dynamic loading device for SO library, It is characterized in that Applied to project packaging, including: A configuration unit, configured to obtain library information of a target SO library, and after obtaining the library information of the target SO library, delete the target SO library from the application package in the application packaging project; A link information generating unit, configured to generate download link information of the target SO library based on the library information of the target SO library, wherein the download link information is used to determine a remote URL link of the target SO library; A packaging unit, used to store the download link information in a packaging directory corresponding to the application packaging project, and to package all files in the packaging directory into the application package, so as to obtain a finished application package after the packaging is completed, so that when the local end runs the finished application package, the remote URL link of the target SO library is obtained based on the download link information in the finished application package, and the dynamic loading of the target SO library is completed based on the remote URL link; The library information of the target SO library includes: the library name of the target SO library and the corresponding CPU architecture; Wherein, based on the library information of the target SO library, generating the download link information of the target SO library includes: Acquire verification information of the target SO library, wherein the verification information is summary information of the target SO library; Generate the remote URL link using the library name, the CPU architecture and the verification information; Generate the download link information according to the library information of the target SO library and the remote URL link, wherein the download link information adopts a key-value pair data storage structure, and the key in the key-value pair data storage structure is the library name and CPU architecture of the target SO library, and the value is the remote URL link; After generating the remote URL link, also include: Sending link query information to a remote server, so that after receiving the link query information, the remote server performs a link query based on the link query information, obtains a link query result of the target SO library, and sends the link query result of the target SO library to the project packaging end, wherein the link query result is empty or non-empty; receiving the link query result, and when the link query result is empty, sending the remote URL link to the remote server to make the remote URL link legal; Before deleting the target SO library from the application package in the application packaging project, the following steps are also included: Construct the configuration task of the target SO library; Injecting the configuration task of the target SO library into the merge native library task in the application packaging project, so as to delete the target SO library from the application package in the application packaging project based on the configuration task, and generate download link information of the target SO library; Accordingly, before storing the download link information in the packaging directory corresponding to the application packaging project, the method further includes: Construct a packaging task for the target SO library; The packaging task of the target SO library is injected into the merge native library task in the application packaging project, so that the download link information is stored in the packaging directory corresponding to the application packaging project based on the packaging task, and all files in the packaging directory are packaged into the application package.

4. A computer program product comprising instructions, It is characterized in that When the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 2.