SDK generation and self-upgrade method, device, readable medium and equipment

文档序号:7167 发布日期:2021-09-17 浏览:75次 中文

1. A method for generating an SDK, the method comprising:

compiling to obtain a host SDK, and acquiring a host dependency file and a host mapping file of the host SDK;

according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as that of the host dependency file from the public dependency relationship;

compiling to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependence file, the host mapping file, the de-duplication dependence file and the public mapping file;

and generating a target SDK according to the host SDK, the public plug-in and the functional plug-in.

2. The method according to claim 1, wherein the compiling a public plug-in dependent on the host SDK according to the host dependent file and the host mapping file, and obtaining a deduplication dependent file and a public mapping file of the public plug-in comprises:

determining codes and resources depended by the public plug-in according to the public dependency relationship;

according to the codes and resources of the public plug-in and the codes and resources depended by the public plug-in, compiling and checking;

removing codes and resources matched with the host dependency file from the codes and resources depended by the public plug-in to obtain public duplicate removal codes and public duplicate removal resources;

in the public dependency relationship, removing the dependency relationship which is the same as the host dependency file to obtain the deduplication dependency file;

determining an obfuscation rule of the host SDK according to the host mapping file;

compiling the codes and resources of the public plug-in, the public duplicate removal codes and the public duplicate removal resources, and performing increment confusion by using a confusion rule of the host SDK to obtain the public plug-in and the public mapping file.

3. The method of claim 1, wherein compiling a functional plug-in dependent on the hosted SDK and the common plug-in from the hosted dependency file, the hosted mapping file, the de-duplication dependency file, and the common mapping file comprises:

determining codes and resources depended by the functional plug-in according to the functional dependency relationship;

according to the codes and resources of the functional plug-ins and the codes and resources depended by the functional plug-ins, compiling and checking;

removing codes and resources matched with the host dependency file and the deduplication dependency file from the codes and resources depended by the functional plug-in to obtain functional deduplication codes and functional deduplication resources;

determining confusion rules of the host SDK and the public plug-in according to the host mapping file and the public mapping file;

compiling the codes and resources of the functional plug-ins, the function duplication removing codes and the function duplication removing resources, and performing increment confusion by using confusion rules of the host SDK and the confusion rules of the public plug-ins to obtain the functional plug-ins.

4. The method of claim 3, wherein compiling the code of the feature plug-in, the resource, the feature deduplication code, and the feature deduplication resource comprises:

when a compiling task for compiling the resources of the functional plug-in and the functional duplicate removal resources is executed, a path of a resource file included by the public plug-in is specified, and a package name of the compiling task is modified to the package name of the public plug-in;

modifying the package name recorded in the resource file generated by the compiling task into the package name of the functional plug-in;

compiling the code of the functional plug-in and the function duplication removal code to obtain the functional plug-in.

5. The method of claim 4, wherein compiling the code of the feature plug-in, the resource, the feature deduplication code, and the feature deduplication resource occurs before compiling the code of the feature plug-in and the feature deduplication code, further comprising:

merging a first R file included by the public plug-in and a second R file generated by the compiling task to obtain a third R file;

the compiling the code of the functional plug-in and the functional deduplication code comprises:

and compiling the codes of the functional plug-ins and the functional duplicate removal codes according to the third R file.

6. A self-upgrade method of an SDK, characterized by being applied to the target SDK generated by the generation method of an SDK according to any one of claims 1 to 5;

the method comprises the following steps:

compiling to obtain the updated functional plug-in according to the host dependency file, the host mapping file, the de-duplication dependency file, the public mapping file and the updated code and resource of the functional plug-in;

and sending the updated functional plug-in to the target SDK so as to update the target SDK.

7. The method of claim 6, wherein the functional plug-in includes identification information for identifying a version number of the public plug-in relied upon;

the method further comprises the following steps:

compiling to obtain the updated public plug-in according to the host dependency file, the host mapping file and the updated code and resource of the public plug-in;

when an update instruction is detected, the updated public plug-in is sent to the target SDK to update the target SDK, and the update instruction is triggered when the public plug-in loaded by the target SDK needs to be updated according to the identification information of the functional plug-in and the version number of the public plug-in loaded by the target SDK under the condition that an application program loads the functional plug-in through the target SDK.

8. An apparatus for generating an SDK, the apparatus comprising:

the first compiling module is used for compiling to obtain a host SDK and obtaining a host dependency file and a host mapping file of the host SDK;

the second compiling module is used for compiling to obtain a public plug-in depending on the host SDK according to the host dependency file and the host mapping file, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as the host dependency file from the public dependency relationship;

a third compiling module, configured to compile to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependency file, the host mapping file, the deduplication dependency file, and the public mapping file;

and the generating module is used for generating the target SDK according to the host SDK, the public plug-in and the functional plug-in.

9. A self-elevating apparatus of an SDK, applied to the target SDK generated by the SDK generation method according to any one of claims 1 to 5;

the device comprises:

the first updating module is used for compiling the updated functional plug-in according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file and the codes and resources of the updated functional plug-in;

and the sending module is used for sending the updated functional plug-in to the target SDK so as to update the target SDK.

10. A computer-readable medium, on which a computer program is stored, which program, when being executed by processing means, is adapted to carry out the steps of the method of any one of claims 1 to 5 or 6 to 7.

11. An electronic device, comprising:

a storage device having a computer program stored thereon;

processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1 to 5, or 6 to 7.

Background

With the continuous development of electronic information technology, various Application programs (english: Application, abbreviation: APP) appear in the Application market to meet the diversified demands of users. In the Development process of android system application Software, in order to reduce the repeated workload, the functions provided by the SDK are used by introducing an SDK (english: Software Development Kit, chinese: Software Development Kit).

For the update scenario of the SDK, the SDK is usually developed in a plug-in manner in order to reduce the traffic consumed by the update. The SDK is divided into a host SDK and a plug-in two-layer structure, so that the update of the SDK can be realized in a plug-in updating mode. However, the SDK often includes a plurality of plug-ins, and if the plurality of plug-ins depend on each other, all the plug-ins need to be updated at one time, and the volume of all the plug-ins is large, and the consumed flow rate is high. If there is no dependency between multiple plug-ins and the plug-ins are completely isolated, then the multiple plug-ins will contain a large amount of repeated codes or resources (such as a third-party library, etc.), increasing the volume of each plug-in, and at the same time, there is a risk of class conversion exception, which increases additional development workload.

Disclosure of Invention

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

In a first aspect, the present disclosure provides a method for generating an SDK, the method including:

compiling to obtain a host SDK, and acquiring a host dependency file and a host mapping file of the host SDK;

according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as that of the host dependency file from the public dependency relationship;

compiling to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependence file, the host mapping file, the de-duplication dependence file and the public mapping file;

and generating a target SDK according to the host SDK, the public plug-in and the functional plug-in.

In a second aspect, the present disclosure provides a self-upgrade method for an SDK, applied to the target SDK generated by the SDK generation method according to the first aspect of the present disclosure;

the method comprises the following steps:

compiling to obtain the updated functional plug-in according to the host dependency file, the host mapping file, the de-duplication dependency file, the public mapping file and the updated code and resource of the functional plug-in;

and sending the updated functional plug-in to the target SDK so as to update the target SDK.

In a third aspect, the present disclosure provides an apparatus for generating an SDK, the apparatus comprising:

the first compiling module is used for compiling to obtain a host SDK and obtaining a host dependency file and a host mapping file of the host SDK;

the second compiling module is used for compiling to obtain a public plug-in depending on the host SDK according to the host dependency file and the host mapping file, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as the host dependency file from the public dependency relationship;

a third compiling module, configured to compile to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependency file, the host mapping file, the deduplication dependency file, and the public mapping file;

and the generating module is used for generating the target SDK according to the host SDK, the public plug-in and the functional plug-in.

In a fourth aspect, the present disclosure provides a self-upgrade apparatus for an SDK, applied to the target SDK generated by the method for generating an SDK according to the first aspect of the present disclosure;

the device comprises:

the first updating module is used for compiling the updated functional plug-in according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file and the codes and resources of the updated functional plug-in;

and the sending module is used for sending the updated functional plug-in to the target SDK so as to update the target SDK.

In a fifth aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the first aspect of the present disclosure.

In a sixth aspect, the present disclosure provides an electronic device comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to implement the steps of the method of the first aspect of the present disclosure.

In a seventh aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing apparatus, performs the steps of the method of the second aspect of the present disclosure.

In an eighth aspect, the present disclosure provides an electronic device comprising:

a storage device having a computer program stored thereon;

processing means for executing the computer program in the storage means to implement the steps of the method of the second aspect of the present disclosure.

According to the technical scheme, the host SDK is obtained through compiling, and the host dependency file and the host mapping file of the host SDK are obtained. And then, according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and simultaneously obtaining a deduplication dependency file and a public mapping file of the public plug-in, wherein the deduplication dependency file is obtained by removing the dependency relation which is the same as that of the host dependency file in the public dependency relation. And compiling to obtain the functional plug-in depending on the host SDK and the public plug-in according to the host dependent file, the host mapping file, the de-duplication dependent file and the public mapping file. And finally, generating the target SDK according to the host SDK, the public plug-in and the functional plug-in. According to the method and the device, the target SDK can be automatically split into the host SDK, the public plug-in and the functional plug-in to be compiled respectively, the size of the functional plug-in can be effectively reduced on the premise that extra development workload is not increased, and the structure of the target SDK is optimized.

Additional features and advantages of the disclosure will be set forth in the detailed description which follows.

Drawings

The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:

FIG. 1 is a flow diagram illustrating a method of generating an SDK in accordance with an exemplary embodiment;

FIG. 2 is a schematic diagram illustrating a target SDK structure according to an exemplary embodiment;

FIG. 3 is a flow diagram illustrating another method of generating an SDK in accordance with one illustrative embodiment;

FIG. 4 is a flow diagram illustrating another method of generating an SDK in accordance with one illustrative embodiment;

FIG. 5 is a flow diagram illustrating a method of self-upgrade of an SDK in accordance with an exemplary embodiment;

FIG. 6 is a flow diagram illustrating another method of self-upgrade of an SDK in accordance with an exemplary embodiment;

FIG. 7 is a block diagram illustrating an apparatus for generating an SDK in accordance with an exemplary embodiment;

FIG. 8 is a block diagram illustrating another SDK generation apparatus in accordance with an exemplary embodiment;

fig. 9 is a block diagram illustrating another apparatus for generating an SDK in accordance with an exemplary embodiment;

FIG. 10 is a block diagram illustrating a self-upgrade apparatus for an SDK in accordance with an exemplary embodiment;

FIG. 11 is a block diagram illustrating a self-upgrade apparatus for another SDK in accordance with an exemplary embodiment;

FIG. 12 is a block diagram illustrating an electronic device in accordance with an example embodiment.

Detailed Description

Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.

It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.

The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.

It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.

It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.

The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.

Fig. 1 is a flowchart illustrating a method for generating an SDK according to an exemplary embodiment, where the method includes:

step 101, compiling to obtain a host SDK, and obtaining a host dependency file and a host mapping file of the host SDK.

For example, the application scenario of the embodiment of the present disclosure may be a generation scenario of a target SDK, and the target SDK may be in the form of, for example, an aar file. The target SDK includes a host SDK, a common plug-in (which may be denoted as common plug-in), and a plurality of function plug-ins (which may be denoted as feature plug-in). The host SDK can be in the form of aar files, and the common plug-ins and the function plug-ins can be in the form of apk files. The host SDK may be understood as being capable of providing an external API (Application Programming Interface, chinese) to the outside, and the Application may use the function provided by the target SDK through the external API. The common plug-in may be understood to provide an internal API for the host SDK, and the functional plug-in specifically implements the functions provided by the target SDK. And the host SDK loads the functional plug-in through the internal API so as to call the function realized by the functional plug-in. The structure of the host SDK, the common plug-in, and the functional plug-in the target SDK may be as shown in fig. 2.

To generate the target SDK, first, a code for compiling the host SDK needs to be determined, where the code may include a pre-written code that implements loading of the host SDK by the common plug-in, execution logic of the functional plug-in, execution logic of the external API, and the like (i.e., a code of the host SDK itself), and may further include a code that is determined according to a host dependency relationship of the host SDK itself, such as an external third-party library (e.g., a multidex library, a support library, and the like). The dependency relationship of the host SDK may be written in advance according to specific requirements. And compiling the code to obtain the host SDK. The compilation process may be understood as compiling the code into a file that can be run, i.e., the host SDK (which may be an aar file). Specifically, a corresponding compilation project can be established by using a preset compilation tool, the code is input into the compilation project, and the compilation is started. In the compiling process, a host dependency file and a host mapping file of the host SDK may also be obtained, where the host dependency file records a host dependency relationship, and the host mapping file (i.e., mapping file) records an obfuscation rule of the host SDK.

And 102, compiling to obtain the public plug-in depending on the host SDK according to the host dependency file and the host mapping file, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as that of the host dependency file from the public dependency relationship.

For example, after obtaining the hosting SDK, the public plug-in dependent on the hosting SDK can be compiled according to the hosting dependent file and the hosting mapping file. Specifically, the code and resources for compiling the plug-in may be determined first, where the code and resources may include pre-written execution logic for implementing the plug-in calling the functional plug-in, execution logic of the internal API, layout files of the presentation page, pictures, animations, character strings, colors, and other resources (i.e., the code and resources of the plug-in itself), and may further include code and/or resources determined according to the first deduplication dependency relationship. It should be noted that the codes and resources used for compiling the common plug-in may be codes and resources with low update frequency determined according to specific requirements, or may be some internal, large-volume internal base libraries. The first deduplication dependency relationship is determined according to the host dependency file and the public dependency relationship of the public plugin, and can be understood as a result of removing the dependency relationship, which is the same as the host dependency relationship recorded by the host dependency file, from the public dependency relationship, or deleting repeated parts, which are identical to the host dependency relationship recorded by the host dependency file, from the public dependency relationship, so that the first deduplication dependency relationship can be obtained. That is, the first deduplication dependency, does not duplicate, or intersect, the host dependency. The public dependency relationship is written in advance according to specific requirements, namely, the public dependency relationship reflects the dependency of the original public plug-in and other codes and resources, and developers do not need to make additional modification for splitting of the host SDK and the public plug-in when writing corresponding codes. For example, indicating in the host dependency that the host SDK depends on: a multidex library and a support library, wherein public dependencies indicate that a public plug-in depends on: a multidex library and an okhttp3 library, wherein the multidex library is repetitive, and then the first deduplication dependency is: and the okhttp3 library is adopted, so that the code and the resource determined according to the first deduplication dependency relationship do not need to be repeatedly introduced into the multidex library, and the volume of the public plug-in is reduced. That is, the code used to compile the common plug-in is not duplicated with the code used to compile the host SDK.

And compiling the codes and the resources to obtain the public plug-in depending on the host SDK. The compilation process may be understood as compiling code and resources into a file that can be run, i.e., a common plug-in (which may be an. apk file). Specifically, when the public plug-in is compiled, in order to enable the public plug-in to use the codes in the host SDK, incremental obfuscation (i.e., applymaping) can be performed on a compilation result according to an obfuscation rule of the host SDK recorded by the host mapping file on the basis of an obfuscation rule of the public plug-in itself, so that the obtained public plug-in can call the codes in the host SDK, i.e., the public plug-in depends on the host SDK, and meanwhile, the codes in the public plug-in are not overlapped with the codes in the host SDK, so that the coupling degree of the codes is reduced, the public plug-in and the host SDK can be updated respectively, and the updating success rate is improved. In the compiling process, a deduplication dependent file and a public mapping file can be obtained, wherein the deduplication dependent file records a first deduplication dependent relationship, and the public mapping file (i.e., mapping file) records an obfuscation rule of the public plug-in.

And 103, compiling to obtain the functional plug-in depending on the host SDK and the public plug-in according to the host dependence file, the host mapping file, the de-duplication dependence file and the public mapping file.

For example, after obtaining the host SDK and the plug-in, the functional plug-in dependent on the host SDK and the plug-in may be compiled from the host dependent file, the host mapped file, the deduplication dependent file, and the public mapped file. Specifically, the code and resources for compiling the functional plug-in may be determined first, where the code and resources may include execution logic that is written in advance and that implements a function that the target SDK can provide, a layout file of a presentation page, resources such as a picture, an animation, a character string, and a color (i.e., the code and resources of the functional plug-in itself), and codes and/or resources determined according to the second deduplication dependency relationship. It should be noted that the function plug-in may correspond to a function of the target SDK, and the update frequency is higher than that of the common plug-in. And determining the second deduplication dependency relationship according to the first deduplication dependency relationship recorded in the deduplication dependency file, the host dependency relationship recorded in the host dependency file and the function dependency relationship of the functional plug-in. It can be understood that in the functional dependency relationship, the same dependency relationship as the host dependency relationship recorded by the host dependency file and the first deduplication dependency relationship recorded in the deduplication dependency file is removed, or a duplicate part of the common dependency relationship, which is duplicated in the host dependency file and the deduplication dependency file, is removed, so that the second deduplication dependency relationship can be obtained. That is, the second deduplication dependency does not duplicate, or intersect, the host dependency, the first deduplication dependency. The functional dependency relationship is written in advance according to specific requirements, that is, the dependency of the original functional plug-in with other codes and resources is reflected, and developers do not need to make additional modification for splitting of the host SDK, the public plug-in and the functional plug-in when writing corresponding codes. For example, indicating in the host dependency that the host SDK depends on: a multidex library and a support library, wherein public dependencies indicate that a public plug-in depends on: the function dependency relationship indicates that the function plug-in depends on the multidex library, the okhtp 3 library and the A picture, and then the second deduplication dependency relationship is as follows: the picture A, so that codes and resources determined according to the second deduplication dependency relationship do not need to be repeatedly introduced into a multidex library and an okhttp3 library, and the size of the functional plug-in is effectively reduced. That is, the code and resources used to compile the functional plug-ins will not be duplicated with the code used to compile the host SDK, nor with the code and resources used to compile the common plug-ins.

And compiling the codes and the resources to obtain the functional plug-in depending on the host SDK and the public plug-in. The compilation process may be understood as compiling code and resources into a file that is capable of running, i.e., a function plug-in (which may be an apk file). Specifically, when compiling the functional plug-in, in order to enable the functional plug-in to use the code in the host SDK and the code and the resource in the public plug-in, the compiling result may be subjected to incremental obfuscation according to the obfuscation rule of the host SDK recorded in the host mapping file and the obfuscation rule of the public plug-in recorded in the public mapping file on the basis of the obfuscation rule of the functional plug-in itself, so that the obtained functional plug-in can call the code in the host SDK and the public plug-in, and simultaneously can use the resource in the public plug-in, that is, the functional plug-in depends on the host SDK and the public plug-in, and the code included in the functional plug-in is not overlapped with the code included in the host SDK and the public plug-in, and the resource included in the functional plug-in is not overlapped with the resource included in the public plug-in, so that the coupling degree of the code is reduced, and thus the functional plug-in and the public plug-in can be respectively used, And the host SDK is updated, so that the updating success rate is further improved. Further, in the compiling process, a function mapping file (i.e. mapping file) can be obtained, wherein the confusion rule of the function plug-in itself is recorded.

It should be noted that there may be a plurality of functional plugins, and for each functional plugin, the compiling may be performed through step 103. Each function plug-in corresponds to a function of the target SDK, and correspondingly, the code and the resource of the function plug-in are only the code and the resource for realizing the function, that is, the plurality of function plug-ins are independent from each other, the code and the resource are not repeated, and the plurality of function plug-ins are not dependent on each other. For example: the target SDK provides payment functionality, login functionality, push functionality, etc., and the target SDK may then include payment functionality plug-ins, login functionality plug-ins, push functionality plug-ins, etc.

And step 104, generating a target SDK according to the host SDK, the public plug-in and the functional plug-in.

For example, the host SDK, the common plug-in and the functional plug-in (which may include a plurality of functional plug-ins) are obtained through the above three steps of compiling, and then the host SDK, the common plug-in and the functional plug-in may be integrated and packaged into the target SDK (which may be. Specifically, the common plug-in and the functional plug-in may be placed in the host SDK to serve as the target SDK, or the host SDK, the common plug-in and the functional plug-in may be repackaged to serve as the target SDK, which is not specifically limited in this disclosure. Therefore, the system can be automatically split into a host SDK, a public plug-in and a functional plug-in of which codes are not overlapped with each other for compiling respectively through respective dependency relations. Because the dependency among the host SDK, the public plug-in and the functional plug-in is dependent layer by layer, namely a plurality of functional plug-ins in the same layer are mutually independent, and codes and resources among the host SDK, the public plug-in and the functional plug-in are not repeated, the sizes of the public plug-ins and the functional plug-ins are effectively reduced, and the structure of the target SDK is optimized. For developers, codes can be written according to a normal development flow without splitting host SDKs, public plug-ins and functional plug-ins, the codes are additionally modified, and extra development workload is not increased. Furthermore, as the volumes of the public plug-ins and the functional plug-ins are reduced, the consumed flow is greatly reduced when the functional plug-ins or the public plug-ins are updated, and the updating success rate can be effectively improved.

In summary, the present disclosure first compiles to obtain the host SDK, and obtains the host dependency file and the host mapping file of the host SDK. And then, according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and simultaneously obtaining a deduplication dependency file and a public mapping file of the public plug-in, wherein the deduplication dependency file is obtained by removing the dependency relation which is the same as that of the host dependency file in the public dependency relation. And compiling to obtain the functional plug-in depending on the host SDK and the public plug-in according to the host dependent file, the host mapping file, the de-duplication dependent file and the public mapping file. And finally, generating the target SDK according to the host SDK, the public plug-in and the functional plug-in. According to the method and the device, the target SDK can be automatically split into the host SDK, the public plug-in and the functional plug-in to be compiled respectively, the size of the functional plug-in can be effectively reduced on the premise that extra development workload is not increased, and the structure of the target SDK is optimized.

Fig. 3 is a flow chart illustrating another SDK generation method according to an example embodiment, and as shown in fig. 3, step 102 may include:

and step 1021, determining codes and resources depended by the public plug-in according to the public dependency relationship.

And 1022, performing compiling check according to the codes and resources of the public plug-in and the codes and resources depended by the public plug-in.

And step 1023, removing the codes and resources matched with the host dependency file from the codes and resources depended by the public plug-in to obtain public duplicate removal codes and public duplicate removal resources.

And 1024, removing the dependency relationship which is the same as the host dependency file in the public dependency relationship to obtain a deduplication dependency file.

Step 1025 determines the obfuscation rules of the host SDK according to the host mapping file.

And step 1026, compiling the code, the resource, the public duplicate removal code and the public duplicate removal resource of the public plug-in, and performing incremental confusion by using a confusion rule of the host SDK to obtain the public plug-in and a public mapping file.

For example, during the process of compiling the plug-in, a preset compiling tool (e.g., a Gradle tool) may be used to create a corresponding compiling project, input corresponding codes and resources into the compiling project, and start compiling. Specifically, before compiling, compiling check needs to be performed, and codes and resources depended on by the public plug-in may be determined according to the public dependency relationship, so that compiling check is performed according to the codes and resources of the public plug-in and the codes and resources depended on by the public plug-in. The code and the resource depended by the public plug-in also comprise a part which is repeated with the host dependency relationship in the public dependency relationship. That is, the code and resources of the communal plug-in and the code and resources on which the communal plug-in depends, cover all the code and resources required by the communal plug-in, and thus, can be checked by compilation.

After the code and the resource are checked through compiling, the code and the resource which are matched with the host dependency file are removed from the code and the resource which are depended by the public plug-in, so that public duplicate removal codes and public duplicate removal resources are obtained. It is also understood that the common deduplication code, and the common deduplication resource, are determined using the first deduplication dependency without overlapping with code in the host SDK. Specifically, a Hook mechanism may be utilized, when the compilation project is executed to the public dependency relationship, whether the dependency relationship is repeated with the host dependency relationship is determined, if so, the code and the resource indicated by the dependency relationship are not introduced, and if not, the code and the resource indicated by the dependency relationship are introduced. Meanwhile, a deduplication dependency file can be established to record the first deduplication dependency relationship.

And then, analyzing the confusion rule of the host SDK from the host mapping file. Finally, the code, resources, public deduplication code, and public deduplication resources of the public plug-ins are compiled. When compiling, the compiling tool sets a confusion rule for the public plug-in to confuse a compiling result, and in order to enable the public plug-in to call codes in the host SDK, the confusion rule of the host SDK can be used for incremental confusion on the basis of the confusion rule of the public plug-in, so that the public plug-in is packaged to obtain the public plug-in, and the public mapping file is recorded and generated.

Fig. 4 is a flowchart illustrating another SDK generation method according to an exemplary embodiment, and as shown in fig. 4, step 103 may be implemented by:

and step 1031, determining codes and resources depended by the functional plug-in according to the functional dependency relationship.

And 1032, compiling and checking according to the codes and resources of the functional plugins and the codes and resources depended by the functional plugins.

And 1033, removing the codes and resources matched with the host dependency file and the deduplication dependency file from the codes and resources depended by the functional plug-in to obtain functional deduplication codes and functional deduplication resources.

Step 1034, according to the host mapping file and the public mapping file, determining the confusion rule of the host SDK and the confusion rule of the public plug-in.

And 1035, compiling the codes and resources of the functional plug-ins, the function duplication removing codes and the function duplication removing resources, and performing incremental confusion by using the confusion rule of the host SDK and the confusion rule of the public plug-ins to obtain the functional plug-ins.

For example, in the process of compiling the functional plug-in, a corresponding compilation project can be established by using a compilation tool (e.g., a Gradle tool), corresponding codes and resources are input into the compilation project, and compilation is started. Specifically, before compiling, compiling check needs to be performed, and codes and resources on which the functional plug-ins depend may be determined according to the functional plug-in dependency relationship, so that compiling check is performed according to the codes and resources of the functional plug-ins and the codes and resources on which the functional plug-ins depend. The code and the resource which are depended by the functional plug-in also comprise a part which is repeated with the host dependency relationship and the public dependency relationship in the functional dependency relationship. That is, the code and resource of the functional plug-in and the code and resource on which the functional plug-in depends cover all objects required by the functional plug-in, and thus can be checked by compiling.

After the compiling check is passed, the codes and resources matched with the host dependency file and the deduplication dependency file can be removed from the codes and resources depended by the functional plug-in, so as to obtain functional deduplication codes and functional deduplication resources. It can also be understood that the second deduplication dependency relationship is utilized to determine that the functional deduplication codes and the functional deduplication resources, the functional deduplication codes and the functional deduplication resources are not overlapped with the host SDK and the codes and resources included in the common plug-in. Specifically, the host dependency relationship and the public dependency relationship may be merged, and then, when the compilation project is executed to the functional dependency relationship, a Hook mechanism is used to determine whether the dependency relationship is repeated with the merged dependency relationship, if so, the code and the resource indicated by the dependency relationship are not introduced, and if not, the code and the resource indicated by the dependency relationship are introduced.

And then, analyzing the confusion rule of the host SDK from the host mapping file, analyzing the confusion rule of the public plug-in from the public mapping file, and combining the confusion rule of the host SDK and the confusion rule of the public plug-in. And finally, compiling the codes, the resources, the function duplicate removal codes and the function duplicate removal resources of the function plug-ins. When compiling, the compiling tool sets a self confusion rule for the functional plug-in to confuse a compiling result, and in order to enable the functional plug-in to call codes in the host SDK and codes and resources in the public plug-in, the combined confusion rule can be used for incremental confusion on the basis of the self confusion rule of the functional plug-in, so that the functional plug-in is packed to obtain the functional plug-in.

In one implementation, step 1035 may be implemented by:

step 1) when executing a compiling task for compiling the resources of the functional plug-in and the functional duplicate removal resources, appointing a path of a resource file included by the public plug-in, and modifying the packet name of the public plug-in by the packet name of the compiling task.

And step 2) modifying the package name recorded in the resource file generated by the compiling task into the package name of the functional plug-in.

And 3) compiling the code of the functional plug-in and the function duplicate removal code to obtain the functional plug-in.

In the process of generating the functional plug-in by compiling, for example, the resources of the functional plug-in and the function duplication removal resources are compiled first, and then the codes of the functional plug-in and the function duplication removal codes are compiled, which can be understood as setting two compiling tasks for the resources and the codes respectively. Since the function deduplication code, and the function deduplication resources, are determined according to the second deduplication dependency, resources required to generate the function plug-in, which are included in the common plug-in, may be lacking. Thus, the path of the resource file included by the common plug-in can be specified when executing a compilation task that compiles the resource. Moreover, in order that the compiling tool can correctly find the resource file included in the public plug-in, the package name of the compiling task can be modified into the package name of the public plug-in. The resource file included in the public plug-in can be understood as an ap file generated when the public plug-in is generated. Specifically, the compiling task for compiling the resource is usually performed by AAPT2 (fully: Android Asset Packaging Tool), and the aaapt 2_ I parameter therein can be set as the path of the public plug-in, and thus, the AAPT2 can know the resource included by the public plug-in.

When the compiling task generates the resource file (namely. ap file) of the functional plug-in, the package name recorded in the resource file of the functional plug-in can be modified into the package name of the functional plug-in. In general, the package name is recorded in the arsc file in the resource file, so that the package name recorded in the arsc file in the resource file of the functional plug-in can be changed back to the package name of the functional plug-in, and the resource file in the functional plug-in can use the resource in the public plug-in through a verification mechanism of the android resource manager for the shared-library. And finally, compiling and packaging the code of the functional plug-in and the function duplicate removal code to obtain the functional plug-in.

In another implementation, before step 3), step 1035 may further include:

and 4) merging the first R file included by the public plug-in and the second R file generated by the compiling task to obtain a third R file.

Correspondingly, the implementation manner of step 3) may be:

and compiling the codes of the functional plug-ins and the functional duplicate removal codes according to the third R file.

Further, before compiling the code of the functional plug-in and the function deduplication code, the first R file included in the common plug-in and the second R file generated by the compiling task need to be merged to obtain a third R file. The first R file can be understood as R.txt generated when the public plug-in is generated, and the second R file can be understood as R.txt generated by the compiling task. The third R file, which may be understood as merging the two r.txts, generates an executable r.java file. In this way, when compiling the code of the functional plug-in and the function duplication removal code, the code of the functional plug-in and the function duplication removal code can be compiled by using the third R file, so that the resource ID in the code of the functional plug-in and the resource ID in the code of the public plug-in can be unified, and the functional plug-in can use the resource in the public plug-in.

In summary, the present disclosure first compiles to obtain the host SDK, and obtains the host dependency file and the host mapping file of the host SDK. And then, according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and simultaneously obtaining a deduplication dependency file and a public mapping file of the public plug-in, wherein the deduplication dependency file is obtained by removing the dependency relation which is the same as that of the host dependency file in the public dependency relation. And compiling to obtain the functional plug-in depending on the host SDK and the public plug-in according to the host dependent file, the host mapping file, the de-duplication dependent file and the public mapping file. And finally, generating the target SDK according to the host SDK, the public plug-in and the functional plug-in. According to the method and the device, the target SDK can be automatically split into the host SDK, the public plug-in and the functional plug-in to be compiled respectively, the size of the functional plug-in can be effectively reduced on the premise that extra development workload is not increased, and the structure of the target SDK is optimized.

Fig. 5 is a flowchart illustrating a self-upgrade method of an SDK according to an exemplary embodiment, where the method is applied to a target SDK generated according to the above generation method of the SDK, as shown in fig. 5, and may include the following steps:

step 201, compiling to obtain the updated functional plug-in according to the host dependency file, the host mapping file, the duplication elimination dependency file, the public mapping file, and the code and the resource of the updated functional plug-in.

Step 202, sending the updated functional plug-in to the target SDK to update the target SDK.

For example, after the target SDK is generated, if a certain functional plug-in included in the target SDK needs to be updated, the updated functional plug-in may be compiled according to the hosting dependency file, the hosting mapping file, the deduplication dependency file, the public mapping file, and the code and resource of the updated functional plug-in. Wherein the functional dependencies may also be updated. And then, the updated functional plug-in can be sent to the target SDK to update the target SDK, and because the volume of the functional plug-in is reduced, the consumed flow is greatly reduced when the functional plug-in is updated, and the updating success rate can be effectively improved. Specifically, the updated functional plug-in may be actively sent to the target SDK, or the target SDK may send an update request, and then the updated functional plug-in is sent to the target SDK, which is not specifically limited by the present disclosure.

Fig. 6 is a flow diagram illustrating another self-upgrade method for an SDK, according to an example embodiment, in which a functional plug-in includes identification information identifying a version number of a dependent public plug-in, as shown in fig. 6. For example, the version number of the common plug-in on which the functional plug-in currently depends may be recorded by meta data in the android manifest file included in the functional plug-in.

Correspondingly, the method may further include:

and step 203, compiling to obtain the updated public plug-in according to the host dependence file, the host mapping file and the code and the resource of the updated public plug-in.

And 204, when an update instruction is detected, sending the updated public plug-in to the target SDK to update the target SDK, wherein the update instruction is triggered when the public plug-in loaded by the target SDK needs to be updated according to the identification information of the functional plug-in and the version number of the public plug-in loaded by the target SDK under the condition that the application program loads the functional plug-in through the target SDK.

For example, after the target SDK is generated, if the plug-in needs to be updated, the updated plug-in may be compiled according to the host dependency file, the host mapping file, and the code and resource of the updated plug-in. Wherein the common dependencies may also be updated. In one implementation, the updated plug-in may be sent directly to the target SDK to update the target SDK. In another implementation, when the update instruction is detected, the updated common plug-in may be sent to the target SDK to update the target SDK. Specifically, the application program loads the functional plug-in through the target SDK, and first compares the identification information of the functional plug-in with the version number of the public plug-in currently loaded by the target SDK, where if the version number of the public plug-in depended on and identified in the identification information of the functional plug-in is higher than the version number of the public plug-in currently loaded by the target SDK, it indicates that the public plug-in currently loaded by the target SDK needs to be updated, and the application program may send an update instruction. If the version number of the dependent public plug-in identified in the identification information of the functional plug-in is lower than or equal to the version number of the public plug-in currently loaded by the target SDK, the public plug-in currently loaded by the target SDK does not need to be updated.

In summary, according to the present disclosure, on the basis that the target SDK includes the host SDK, the public plugin and the functional plugin, the updated functional plugin can be obtained by compiling according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file, and the code and resource of the updated functional plugin, so that the updated functional plugin is sent to the target SDK to update the target SDK. And obtaining the deduplication dependent file by removing the same dependency relationship with the host dependent file in the public dependency relationship. According to the method and the device, on the basis that the target SDK is automatically split into the host SDK, the public plug-in and the functional plug-in, the small-size functional plug-in can be independently updated, the flow consumed by updating is reduced, and therefore the updating success rate is improved.

Fig. 7 is a block diagram illustrating an apparatus for generating an SDK according to an exemplary embodiment, where, as shown in fig. 7, the apparatus 300 includes:

the first compiling module 301 is configured to compile to obtain the host SDK, and obtain a host dependency file and a host mapping file of the host SDK.

And a second compiling module 302, configured to compile to obtain a public plugin dependent on the host SDK according to the host dependency file and the host mapping file, and obtain a deduplication dependency file and a public mapping file of the public plugin, where the deduplication dependency file is obtained by removing a dependency relationship identical to the host dependency file from the public dependency relationship.

And a third compiling module 303, configured to compile to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependency file, the host mapping file, the deduplication dependency file, and the public mapping file.

And the generating module 304 is configured to generate the target SDK according to the host SDK, the public plug-in and the functional plug-in.

Fig. 8 is a block diagram illustrating another SDK generation apparatus according to an exemplary embodiment, and as shown in fig. 8, the second compiling module 302 may include:

the first checking submodule 3021 is configured to determine, according to the public dependency relationship, the code and the resource on which the plug-in depends. And compiling and checking according to the codes and resources of the public plug-ins and the codes and resources depended by the public plug-ins.

The first determining submodule 3022 is configured to remove, from the code and the resource on which the plug-in depends, the code and the resource that match the host dependency file to obtain a common deduplication code and a common deduplication resource. In the common dependency relationship, the same dependency relationship as the hosted dependency file is removed to obtain a deduplicated dependency file.

The second determining submodule 3023 is configured to determine an obfuscation rule of the host SDK according to the host mapping file.

The first compiling submodule 3024 is configured to compile the code, the resource, the common deduplication code, and the common deduplication resource of the common plug-in, and perform incremental obfuscation using an obfuscation rule of the host SDK to obtain the common plug-in and the common mapping file.

Fig. 9 is a block diagram illustrating another SDK generation apparatus according to an exemplary embodiment, and as shown in fig. 9, the third compiling module 303 may include:

and the second checking submodule 3031 is configured to determine, according to the function dependency relationship, a code and a resource on which the functional plug-in depends. And compiling and checking according to the codes and resources of the functional plugins and the codes and resources depended by the functional plugins.

The third determining submodule 3032 is configured to remove, from the codes and resources that the functional plug-in depends on, the codes and resources that are matched with the host dependency file and the deduplication dependency file, so as to obtain function deduplication codes and function deduplication resources.

The fourth determining submodule 3033 is configured to determine an obfuscating rule of the host SDK and an obfuscating rule of the public plugin according to the host mapping file and the public mapping file.

The second compiling submodule 3034 is configured to compile the code, the resource, the function duplication removing code, and the function duplication removing resource of the functional plug-in, and perform incremental obfuscation using an obfuscating rule of the host SDK and an obfuscating rule of the public plug-in to obtain the functional plug-in.

In one implementation, the second compiling submodule 3034 may be configured to perform the following steps:

step 1) when executing a compiling task for compiling the resources of the functional plug-in and the functional duplicate removal resources, appointing a path of a resource file included by the public plug-in, and modifying the packet name of the public plug-in by the packet name of the compiling task.

And step 2) modifying the package name recorded in the resource file generated by the compiling task into the package name of the functional plug-in.

And 3) compiling the code of the functional plug-in and the function duplicate removal code to obtain the functional plug-in.

In another implementation, the second compiling submodule 3034 may be further configured to perform the following steps:

and 4) merging the first R file included by the public plug-in and the second R file generated by the compiling task before compiling the code of the functional plug-in and the function duplicate removal code to obtain a third R file.

Correspondingly, the implementation manner of step 3) may be:

and compiling the codes of the functional plug-ins and the functional duplicate removal codes according to the third R file.

With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

In summary, the present disclosure first compiles to obtain the host SDK, and obtains the host dependency file and the host mapping file of the host SDK. And then, according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and simultaneously obtaining a deduplication dependency file and a public mapping file of the public plug-in, wherein the deduplication dependency file is obtained by removing the dependency relation which is the same as that of the host dependency file in the public dependency relation. And compiling to obtain the functional plug-in depending on the host SDK and the public plug-in according to the host dependent file, the host mapping file, the de-duplication dependent file and the public mapping file. And finally, generating the target SDK according to the host SDK, the public plug-in and the functional plug-in. According to the method and the device, the target SDK can be automatically split into the host SDK, the public plug-in and the functional plug-in to be compiled respectively, the size of the functional plug-in can be effectively reduced on the premise that extra development workload is not increased, and the structure of the target SDK is optimized.

Fig. 10 is a block diagram illustrating a self-upgrade apparatus of an SDK according to an exemplary embodiment, where as shown in fig. 10, the apparatus 400 is applied to a target SDK generated according to the above-described generation method of the SDK, and may include:

the first updating module 401 is configured to compile to obtain an updated functional plugin according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file, and the code and resource of the updated functional plugin.

A sending module 402, configured to send the updated functional plug-in to the target SDK to update the target SDK.

Fig. 11 is a block diagram illustrating another self-upgrade apparatus for an SDK according to an example embodiment, where, as shown in fig. 11, a functional plug-in includes identification information for identifying a version number of a dependent public plug-in. The apparatus 400 may further include:

and a second updating module 403, configured to compile to obtain an updated public plugin according to the host dependency file, the host mapping file, and the code and resource of the updated public plugin.

The sending module 402 is further configured to send the updated public plug-in to the target SDK to update the target SDK when the update instruction is detected, where the update instruction is triggered when the public plug-in loaded by the target SDK needs to be updated according to the identification information of the functional plug-in and the version number of the public plug-in loaded by the target SDK when the application program loads the functional plug-in through the target SDK.

With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

In summary, according to the present disclosure, on the basis that the target SDK includes the host SDK, the public plugin and the functional plugin, the updated functional plugin can be obtained by compiling according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file, and the code and resource of the updated functional plugin, so that the updated functional plugin is sent to the target SDK to update the target SDK. And obtaining the deduplication dependent file by removing the same dependency relationship with the host dependent file in the public dependency relationship. According to the method and the device, on the basis that the target SDK is automatically split into the host SDK, the public plug-in and the functional plug-in, the small-size functional plug-in can be independently updated, the flow consumed by updating is reduced, and therefore the updating success rate is improved.

Referring now to fig. 12, a schematic diagram of an electronic device (i.e., an execution subject of the SDK generation method and the self-upgrade method, which may be a terminal device or a server) 500 suitable for implementing the embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 12 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.

As shown in fig. 12, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.

Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 12 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.

In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.

It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

In some embodiments, the terminal devices, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.

The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.

The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: compiling to obtain a host SDK, and acquiring a host dependency file and a host mapping file of the host SDK; according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as that of the host dependency file from the public dependency relationship; compiling to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependence file, the host mapping file, the de-duplication dependence file and the public mapping file; and generating a target SDK according to the host SDK, the public plug-in and the functional plug-in.

Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: compiling to obtain the updated functional plug-in according to the host dependency file, the host mapping file, the de-duplication dependency file, the public mapping file and the updated code and resource of the functional plug-in; and sending the updated functional plug-in to the target SDK so as to update the target SDK.

Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a module does not in some cases constitute a limitation on the module itself, for example, a first compilation module may also be described as a "module that compiles a hosted compiled object".

The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.

In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

Example 1 provides a method of generating an SDK, according to one or more embodiments of the present disclosure, including: compiling to obtain a host SDK, and acquiring a host dependency file and a host mapping file of the host SDK; according to the host dependency file and the host mapping file, compiling to obtain a public plug-in depending on the host SDK, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as that of the host dependency file from the public dependency relationship; compiling to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependence file, the host mapping file, the de-duplication dependence file and the public mapping file; and generating a target SDK according to the host SDK, the public plug-in and the functional plug-in.

According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, the compiling, according to the hosted dependency file and the hosted mapping file, a public plugin dependent on the hosted SDK, and obtaining a re-dependency file and a public mapping file of the public plugin include: determining codes and resources depended by the public plug-in according to the public dependency relationship; according to the codes and resources of the public plug-in and the codes and resources depended by the public plug-in, compiling and checking; removing codes and resources matched with the host dependency file from the codes and resources depended by the public plug-in to obtain public duplicate removal codes and public duplicate removal resources; in the public dependency relationship, removing the dependency relationship which is the same as the host dependency file to obtain the deduplication dependency file; determining an obfuscation rule of the host SDK according to the host mapping file; compiling the codes and resources of the public plug-in, the public duplicate removal codes and the public duplicate removal resources, and performing increment confusion by using a confusion rule of the host SDK to obtain the public plug-in and the public mapping file.

Example 3 provides the method of example 1, the compiling a functional plug-in dependent on the hosted SDK and the common plug-in according to the hosted dependency file, the hosted mapping file, the de-duplication dependency file, and the common mapping file, including: determining codes and resources depended by the functional plug-in according to the functional dependency relationship; according to the codes and resources of the functional plug-ins and the codes and resources depended by the functional plug-ins, compiling and checking; removing codes and resources matched with the host dependency file and the deduplication dependency file from the codes and resources depended by the functional plug-in to obtain functional deduplication codes and functional deduplication resources; determining confusion rules of the host SDK and the public plug-in according to the host mapping file and the public mapping file; compiling the codes and resources of the functional plug-ins, the function duplication removing codes and the function duplication removing resources, and performing increment confusion by using confusion rules of the host SDK and the confusion rules of the public plug-ins to obtain the functional plug-ins.

Example 4 provides the method of example 3, the compiling the code of the feature plug-in, the resource, the feature deduplication code, and the feature deduplication resource, comprising: when a compiling task for compiling the resources of the functional plug-in and the functional duplicate removal resources is executed, a path of a resource file included by the public plug-in is specified, and a package name of the compiling task is modified to the package name of the public plug-in; modifying the package name recorded in the resource file generated by the compiling task into the package name of the functional plug-in; compiling the code of the functional plug-in and the function duplication removal code to obtain the functional plug-in.

Example 5 provides the method of example 4, the compiling the code of the feature plug-in, the resource, the feature deduplication code, and the feature deduplication resource before the compiling the code of the feature plug-in and the feature deduplication code, further comprising: merging a first R file included by the public plug-in and a second R file generated by the compiling task to obtain a third R file; the compiling the code of the functional plug-in and the functional deduplication code comprises: and compiling the codes of the functional plug-ins and the functional duplicate removal codes according to the third R file.

Example 6 provides a self-upgrade method of an SDK applied to the target SDK generated according to the methods of examples 1-5, including: compiling to obtain the updated functional plug-in according to the host dependency file, the host mapping file, the de-duplication dependency file, the public mapping file and the updated code and resource of the functional plug-in; and sending the updated functional plug-in to the target SDK so as to update the target SDK.

Example 7 provides the method of example 6, the functional plug-in including identification information for identifying a version number of the communal plug-in on which it depends; the method further comprises the following steps: compiling to obtain the updated public plug-in according to the host dependency file, the host mapping file and the updated code and resource of the public plug-in; when an update instruction is detected, the updated public plug-in is sent to the target SDK to update the target SDK, and the update instruction is triggered when the public plug-in loaded by the target SDK needs to be updated according to the identification information of the functional plug-in and the version number of the public plug-in loaded by the target SDK under the condition that an application program loads the functional plug-in through the target SDK.

Example 8 provides an apparatus for generating an SDK, according to one or more embodiments of the present disclosure, including: the first compiling module is used for compiling to obtain a host SDK and obtaining a host dependency file and a host mapping file of the host SDK; the second compiling module is used for compiling to obtain a public plug-in depending on the host SDK according to the host dependency file and the host mapping file, and obtaining a de-duplication dependency file and a public mapping file of the public plug-in, wherein the de-duplication dependency file is obtained by removing the dependency relationship which is the same as the host dependency file from the public dependency relationship; a third compiling module, configured to compile to obtain a functional plug-in depending on the host SDK and the public plug-in according to the host dependency file, the host mapping file, the deduplication dependency file, and the public mapping file; and the generating module is used for generating the target SDK according to the host SDK, the public plug-in and the functional plug-in.

Example 9 provides, in accordance with one or more embodiments of the present disclosure, a self-upgrade apparatus for an SDK, applied to the target SDK generated according to the methods of examples 1-5, comprising: the first updating module is used for compiling the updated functional plug-in according to the host dependency file, the host mapping file, the duplication removing dependency file, the public mapping file and the codes and resources of the updated functional plug-in; and the sending module is used for sending the updated functional plug-in to the target SDK so as to update the target SDK.

Example 10 provides a computer-readable medium having stored thereon a computer program that, when executed by a processing device, implements the steps of the methods of examples 1-7, in accordance with one or more embodiments of the present disclosure.

Example 11 provides, in accordance with one or more embodiments of the present disclosure, an electronic device, comprising: a storage device having a computer program stored thereon; processing means for executing the computer program in the storage means to implement the steps of the methods of examples 1-7.

The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种受控网络环境下安全可控的敏捷软件开发方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!