Program compiling method and device, equipment and storage medium

By independently compiling the plug-in and host, merging manifest files and integrating plug-in information, the problem of plug-in cannot be decoupled from the host is solved, and the independent development and sharing of plug-in is realized.

CN119440533AActive Publication Date: 2025-02-14GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310943378.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-14
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

In the prior art, plug-ins and hosts cannot be independently developed and compiled, resulting in the inability to decouple between plug-ins and hosts, and plug-ins cannot be applied by other hosts.

Method used

Through the compilation method, generate independent packages for the host and plug-in, obtain the manifest file and plug-in information of the target plug-in, verify whether the host and plug-in conflict, merge the manifest file and integrate the plug-in information into the host package.

Benefits of technology

It realizes independent development and compilation of plug-ins and hosts, decoupling of plug-ins from hosts, and plug-ins can be applied by any host, realizing plug-ins sharing and functional reuse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440533A_ABST
    Figure CN119440533A_ABST
Patent Text Reader

Abstract

The invention provides a program compiling method and device, equipment and a storage medium, and relates to the field of computers. The method comprises the steps that a host is compiled, a host program package is generated, and the host program package comprises a list file of the host; obtaining a list file and plug-in information of a target plug-in, wherein the target plug-in is a plug-in of a program package obtained after compiling; according to the plug-in information, verifying the host and the target plug-in according to a preset condition, and determining whether the host and the target plug-in conflict or not; if the host plug-in and the target plug-in do not conflict, merging the list files of the host plug-in and the target plug-in to generate a total list file, and replacing the list file in the host program package with the total list file; and integrating the plug-in information into the host program package. According to the method, the plug-in and the host can be independently developed and compiled, so that the plug-in and the host are decoupled, and the plug-in can be applied by any host.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a program compiling method, apparatus, device and storage medium. Background Art

[0002] Before deploying an application, you need to compile the application into an executable file and package it.

[0003] Currently, for applications based on plug-in frameworks, the compilation solution is to write the plug-in and the host in the same repository, and perform joint compilation to generate the host and plug-in apk at the same time, and perform manifest merging and plug-in information integration at the same time. The host and plug-in need to be compiled in the same repository. As a result, the host and plug-in cannot be developed based on independent repositories, the plug-in cannot be decoupled from the host, and the plug-in cannot be used by other hosts. Summary of the invention

[0004] The present application provides a program compilation method, apparatus, device and storage medium, which can realize independent development and compilation of plug-ins and hosts, decouple plug-ins and hosts, and enable plug-ins to be used by any host.

[0005] In a first aspect, the present application provides a program compilation method, the method comprising: compiling a host to generate a host program package, the host program package including a host manifest file; obtaining a manifest file and plugin information of a target plug-in, the target plug-in being a plug-in of the program package obtained after compilation; based on the plugin information, checking the host and target plug-ins according to preset conditions to determine whether the host and target plug-ins conflict, and when the plugin information meets the preset conditions, there is no conflict between the host and target plug-ins; if there is no conflict between the host and target plug-ins, merging the manifest files of the host and target plug-ins to generate a total manifest file, and replacing the manifest file in the host program package with the total manifest file; integrating the plugin information into the host program package.

[0006] In a second aspect, the present application provides a program compilation device, which includes: an acquisition module, used to obtain a manifest file and plug-in information of a target plug-in, the target plug-in being a plug-in that is compiled to obtain a program package; a compilation module, used to compile a host and generate a host program package, the host program package including a manifest file of the host; based on the plug-in information, checking the host and target plug-ins according to preset conditions to determine whether the host and target plug-ins conflict, and when the plug-in information meets the preset conditions, there is no conflict between the host and target plug-ins; if there is no conflict between the host and target plug-ins, merging the manifest files of the host and target plug-ins to generate a total manifest file, and replacing the manifest file in the host program package with the total manifest file; integrating the plug-in information into the host program package.

[0007] In a third aspect, the present application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect.

[0008] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed, implements the method provided in the first aspect.

[0009] The present application provides a program compilation method, device, equipment and storage medium, which can independently compile the plug-in after the plug-in development is completed to obtain the plug-in program package. Therefore, when the host is compiled, after the host is compiled to obtain the host program package, the host can obtain the corresponding target plug-in plug-in information and manifest file according to actual needs, and then after the plug-in is verified according to the plug-in information, merge the host and plug-in manifest files, and integrate the plug-in information and the merged manifest file into the host program package, so as to obtain a host program that can call the target plug-in. The host and plug-in in the plug-in framework are developed and independently compiled, the coupling relationship between the host and the plug-in is released, and the plug-in can be independently developed. Different hosts can select the corresponding plug-in for application according to needs, realize plug-in sharing, and no longer need to repeatedly develop plug-ins with the same functions for different program projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of a program compilation method provided in an embodiment of the present application;

[0011] Figure 2 It is a flowchart of a plug-in compilation method provided in an embodiment of the present application;

[0012] Figure 3 It is a flowchart of a host compilation method provided in an embodiment of the present application;

[0013] Figure 4 It is a schematic diagram of the composition of a program compiling device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0014] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0015] Before deploying an application, you need to compile the application into an executable file and package it.

[0016] Currently, for applications based on plug-in frameworks, the compilation solution is to write the plug-in and the host in the same repository, and perform joint compilation to generate the host and plug-in apk at the same time, and perform manifest merging and plug-in information integration at the same time. The host and plug-in are required to be compiled in the same repository. As a result, the host and plug-in cannot be developed separately based on independent repositories, the plug-in cannot be decoupled from the host, and the plug-in cannot be used by other hosts.

[0017] In this regard, the present application provides a program compilation method. An independently developed plug-in can be compiled in advance to obtain a plug-in program package. Thus, after developing a host program, the host is compiled to obtain a host program package, and the corresponding target plug-in can be selected according to the needs of the host. Then, when it is determined that the plug-in does not conflict with the host according to the plug-in information of the target plug-in, the host's manifest file and the plug-in's manifest file are merged, and finally, the merged manifest file and the plug-in information of the target plug-in are integrated into the host program package, thereby obtaining a host program that can call the target plug-in.

[0018] In this way, the plug-in and the host can be independently developed and compiled, so that the plug-in and the host are decoupled, and the plug-in can be used by any host.

[0019] The program compilation method provided in the embodiment of the present application will be described below with reference to the accompanying drawings.

[0020] In the embodiment of the present application, the above program compiling method can be applied to an electronic device capable of program compiling, such as a server, a PC, etc. The embodiment of the present application does not impose any special restrictions on the specific device form of the electronic device.

[0021] Figure 1 A flowchart of a program compilation method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method may include the following S101-S105.

[0022] S101, compile the host and generate a host program package.

[0023] The host program package includes the host manifest file.

[0024] When compiling the host, the program compilation method in the related technology can be adopted to implement it, and there is no limitation here.

[0025] The host package is the package (Android Application Package, APK) obtained after the host is compiled. The specific composition of the package can usually include static resource files (assets), library files (lib), signature files (META-INF), compiled resource files (res), manifest files (manifest files), core code files (classes.dex) and resource mapping files (resources.arsc), etc.

[0026] S102: Obtain the manifest file and plug-in information of the target plug-in.

[0027] The target plug-in is a plug-in that is compiled to obtain a program package. That is, after the plug-in is developed, it can be independently compiled to obtain the plug-in program package.

[0028] Therefore, the manifest file of the target plug-in can be directly obtained according to the program package of the target plug-in, and the plug-in information can be obtained according to the manifest file or each file information in the program package.

[0029] For example, the plug-in information may include at least one of the package identifier (package id) of the plug-in package, the file name (assets file name) of the static resource file contained in the plug-in package, the dependency library information of the dependency library used by the plug-in, the signature information when the plug-in is compiled, etc. Among them, the dependency library information may include a dependency library identifier for marking the dependency library and a version identifier for indicating the version of the dependency library.

[0030] Optionally, in the embodiment of the present application, various developed plug-ins can be independently compiled in advance to obtain program packages corresponding to each plug-in, so that when compiling the host, the plug-in that needs to be applied by the host among the compiled plug-ins can be used as the target plug-in according to the host's requirements.

[0031] For example, in order to facilitate the host to obtain the manifest file and plug-in information of the target plug-in during compilation, after compiling the plug-in, the plug-in information can be obtained according to the manifest file and each file information of the plug-in, and then the plug-in information and the manifest file of the plug-in are stored. Therefore, when the host compiles later, the manifest file and plug-in information corresponding to the target plug-in can be directly obtained from the storage location.

[0032] For example, the plug-in information includes the package identifier (package id) of the plug-in package, the file name (assets file name) of the static resource file contained in the plug-in package, the dependency library information of the dependency library used by the plug-in, and the signature information when the plug-in is compiled. Figure 2 As shown, after the plug-in is compiled, the following S201-S206 may be executed.

[0033] S201. Obtain the package identifier (package id) of the plug-in's program package (apk). S202. Obtain the signature information of the plug-in. S203. Obtain the dependency library information of the dependency library used by the plug-in. S204. Obtain the file name (assets file name) of the static resource file in the plug-in's program package. S205. Integrate and generate the plug-in information based on the package identifier, signature information, dependency library information, and file name of the static resource file. S206. Upload the plug-in information and the plug-in manifest file to the cloud (such as a cloud server). This allows the host to directly obtain the manifest file and plug-in information of the target plug-in information from the cloud when compiling later.

[0034] Accordingly, during the plug-in compilation process, the manifest file and plug-in information are uploaded to the cloud. When compiling the host later, based on the needs of the host, after determining the target plug-in, the link of the target plug-in's manifest file and plug-in information in the cloud can be pre-configured, so that when compiling the host, the manifest file and plug-in information of the target plug-in can be downloaded from the cloud according to the link.

[0035] As an example, the above process of obtaining the plug-in manifest file and plug-in information and uploading them to the cloud after compiling the plug-in can be implemented by setting a compile plug-in module in the compiler, which is not limited here.

[0036] S103: Check the host and target plug-ins according to the plug-in information and preset conditions to determine whether the host and target plug-ins conflict with each other.

[0037] The preset condition may be a condition for determining that there is no conflict between the host and the target plug-in, that is, when the plug-in information meets the preset condition, there is no conflict between the host and the target plug-in.

[0038] When there is no conflict between the host and target plug-ins, subsequent compilation operations can be performed to avoid the problem that the host program finally compiled cannot run normally due to the conflict between the host and target plug-ins when running and calling the target plug-in.

[0039] For example, for different plug-in information, the preset conditions for determining whether the host and target plug-ins conflict may be different. The preset conditions may be set according to the conditions required when the host and the plug-in are running.

[0040] For example, the plug-in information may be the package identifier of the target plug-in's package. Accordingly, the preset condition may be that the package identifier of the target plug-in's package is different from the package identifier of the host package. That is, when the package identifier of the target plug-in's package is different from the package identifier of the host package, it can be determined that there is no conflict between the target plug-in and the host. At this point, subsequent compilation operations on the host can avoid the problem of host and plug-in operation conflicts caused by the same package identifiers of the host and target plug-in packages. Among them, in order to ensure that the package identifier of the target plug-in's package is different from the package identifier of the host package, the package identifier of the plug-in's package can be regenerated according to preset rules when the plug-in is independently compiled, and the package identifier of the plug-in can be replaced.

[0041] For another example, the plug-in information may be the file name of a static resource file in the program package of the target plug-in. Accordingly, the preset condition may be that the file name of the static resource file in the program package of the target plug-in and the file name of the static resource file in the program package of the host are not repeated. That is, when the file name of the static resource file in the program package of the target plug-in and the file name of the static resource file in the program package of the host are not repeated, it can be determined that there is no conflict between the target plug-in and the host. At this point, subsequent compilation operations on the host can avoid the host program obtained after compilation, when calling the target plug-in to run, because the target plug-in has a static resource file with a static resource file name that is repeated with the host, which causes the plug-in to fail to correctly obtain the required resources and cause an operation abnormality.

[0042] For another example, the plug-in information may be the dependency library information of the target plug-in, that is, the dependency library identifier and version identifier of the dependency library used by the target plug-in. Accordingly, the preset condition may be that the dependency library used by both the target plug-in and the host has the same version in the target plug-in and the host. That is, after obtaining the dependency library information of the target plug-in, the dependency library used by both the target plug-in and the host may be determined according to the dependency library identifier of the target plug-in. Then, according to the version identifier of the dependency library of the target plug-in, it is determined whether the dependency libraries used by both the target plug-in and the host have the same version in the target plug-in and the host, respectively. When it is determined to be the same, it can be determined that there is no conflict between the target plug-in and the host. At this point, the subsequent compilation operation on the host can avoid the host program obtained after compilation. When the target plug-in is called to run, the target plug-in causes an abnormal dependency library call to occur due to a different version of a dependency library used by both the target and the host (there are two versions). Among them, a method for determining whether the versions of the dependency libraries used by both the target plug-in and the host are the same in the target plug-in and the host can be to compare the dependency library identifiers and corresponding version identifiers of the target plug-in with the dependency libraries of the host respectively, so that when the dependency libraries with the same dependency library identifiers but inconsistent version identifiers are obtained, it can be determined that the versions of the dependency libraries used by both the target plug-in and the host are different in the target plug-in and the host. Otherwise, they are the same.

[0043] For another example, the plug-in information may be the signature information of the target plug-in. That is, the signature information generated by the target plug-in during compilation. Accordingly, the preset condition may be that the signature information of the target plug-in is consistent with the signature information of the host. That is, when it is determined that the signature information of the target plug-in is consistent with the signature information of the host, it can be determined that the target plug-in and the host do not conflict. Thus, it can be determined that the target plug-in is a safe plug-in certified by the developer. This avoids the situation in which the target plug-in associated with the host is a non-certified plug-in during subsequent host compilation, thereby improving the security of the final plug-in framework program. It can also avoid the developed target plug-in being used by an unrecognized third-party host.

[0044] Optionally, in actual application, the above different plug-in information can be combined to check whether there is a conflict between the target plug-in and the host. Therefore, when the preset conditions corresponding to each plug-in information are met, it is determined that there is no conflict between the target plug-in and the host. Therefore, the host program package compiled subsequently can be more stable when it is run.

[0045] As an example, based on S103, when there is a conflict between the host and target plug-ins, the compilation may be stopped.

[0046] When there is a conflict between the host and the target plug-in, continuing to compile the host will result in an exception when loading the target plug-in. Therefore, when it is determined that there is a conflict between the host and the target plug-in, stopping the compilation can avoid invalid compilation of the host.

[0047] S104: If there is no conflict between the host and target plug-ins, merge the manifest files of the host and target plug-ins to generate a master manifest file, and replace the manifest file in the host program package with the master manifest file.

[0048] Generally, the way to merge the manifest files of the host and target plug-ins is to first create a separate manifest file to merge the manifest information of the host and target plug-ins. For example, you can create a file named "merged_manifest.xml". Then in the "merged_manifest.xml" file, copy the manifest information of the host to the file. This includes the package name, application icon, permissions, and other information of the host application. After that, in the "merged_manifest.xml" file, copy the manifest information of the target plug-in to the file. This includes the package name of the target plug-in application, the declaration of the plug-in component (Activity, Service, etc.), permissions, and other information. In addition, it is necessary to ensure that the package name and the declaration of the plug-in component of the target plug-in must be consistent with the manifest file of the host. For the conflicting parts, such as permissions or component declarations, it is necessary to merge or resolve the conflicts. Depending on the actual situation, you can choose to keep the permissions and component declarations of the host or target plug-in, or merge and adjust them appropriately. Finally, you can replace the original manifest file of the host with the merged total manifest file to ensure that the merged manifest file is used when building and packaging the application.

[0049] Of course, in some other possible implementations of the present application, some open source tools and frameworks may also be used to automatically merge manifest files, such as the Manifest Merger function of Gradle, Android AssetPackaging Tool (AAPT), etc., which are not limited here.

[0050] S105, integrating the plug-in information into the host program package.

[0051] For example, the plug-in information can be integrated into the host package by packaging the plug-in information, such as packaging it into a json file, and then putting the packaged plug-in information into the static resource folder of the host package. For example, the packaged plug-in information can be put into the root directory of the static resource folder (assets file) of the host package.

[0052] Of course, the plug-in information may be integrated into the host package in other ways, such as integrating the plug-in information into a manifest file in the host package.

[0053] Optionally, in the embodiment of the present application, the above S105 can be executed at any time after S103, and is not limited here. That is, integrating the plug-in information into the host program package can be performed in parallel with merging the manifest files of the host and target plug-ins, or before or after S104.

[0054] It should be noted that there may be multiple target plug-ins in the implementation mode of the present application. At this time, correspondingly, S103 may be executed for each target plug-in, and subsequent steps may be executed after all target plug-ins have no conflicts with the host. Furthermore, when S104 is subsequently executed, the manifest files of all target plug-ins and the manifest file of the host may be merged. Furthermore, in S105, the plug-in information of all target plug-ins is integrated into the host program package.

[0055] As a possible implementation, based on the above S101-S105, in the process of compiling the host program, after compiling the host to obtain the host program package, the following can be done: Figure 3 As shown, the following S301-S308 are executed.

[0056] S301: Obtain the manifest file and plug-in information of the target plug-in.

[0057] S302: Check whether there is any conflict in the package identifier (package ID) of the target plug-in package.

[0058] That is, check whether the package identifier of the target plug-in package is different from the package identifier of the host package. If they are different, check that there is no conflict, that is, the check result is no.

[0059] If the result of S302 is no, S303 is executed to check whether there is a conflict between the target plug-in and the host's dependent library.

[0060] That is, check whether the versions of the dependent libraries used by both the target plug-in and the host are the same. If they are the same, check whether there is no conflict, that is, the check result is no.

[0061] If the result of S303 is no, S304 is executed to check whether there are static resource files (assets files) with the same name in the target plug-in and the host.

[0062] That is, check whether the file name of the static resource file in the target plug-in package and the file name of the static resource file in the host package are not repeated. If they are not repeated, check that there is no assets file with the same name, that is, the check result is no.

[0063] If the result of S304 is no, then S305 is executed to verify whether the signature information of the target plug-in is consistent with that of the host.

[0064] If yes, then execute S306 to merge the manifest files of the host and target plug-ins.

[0065] Then, S307 is executed to integrate the plug-in information and the merged manifest file into the host program package.

[0066] When the result of S302 is yes, the result of S303 is yes, the result of S304 is yes, or the result of S305 is no, S308 is executed and the compilation is stopped.

[0067] The present application adopts the above-mentioned implementation mode, and can independently compile the plug-in after the plug-in development is completed to obtain the plug-in program package. Therefore, when the host is compiled, after the host is compiled to obtain the host program package, the host can obtain the corresponding plug-in information and manifest file of the target plug-in according to actual needs, and then after the plug-in is verified according to the plug-in information, merge the host and plug-in manifest files, and integrate the plug-in information and the merged manifest file into the host program package, so as to obtain a host program that can call the target plug-in. The host and plug-in in the plug-in framework are developed and compiled independently, the coupling relationship between the host and the plug-in is released, and the plug-in can be developed independently. Different hosts can select the corresponding plug-in for application according to needs, realize plug-in sharing, and no longer need to repeatedly develop plug-ins with the same functions for different program projects.

[0068] Corresponding to the method in the above embodiment, the embodiment of the present application also provides a program compilation device. The device can be applied to an electronic device to implement the method in the above embodiment. The function of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0069] For example, Figure 4 As shown, the device may include: an acquisition module 401, used to acquire a manifest file and a plug-in information of a target plug-in, the target plug-in being a plug-in that is compiled to obtain a program package; a compilation module 402, used to compile a host to generate a host program package, the host program package including a manifest file of the host; based on the plug-in information, checking the host and the target plug-in according to preset conditions to determine whether the host and the target plug-in conflict, when the plug-in information meets the preset conditions, the host and the target plug-in have no conflict; if the host and the target plug-in have no conflict, merging the manifest files of the host and the target plug-in to generate a total manifest file, and replacing the manifest file in the host program package with the total manifest file; integrating the plug-in information into the host program package.

[0070] Optionally, the compiling module 402 is specifically used to package the plug-in information and put it into a static resource folder of the host program package.

[0071] Optionally, the plug-in information includes a package identifier of a program package of the target plug-in, and the preset condition includes: the package identifier of the program package of the target plug-in is different from the package identifier of the host program package.

[0072] Optionally, the plug-in information includes the file name of the static resource file in the program package of the target plug-in, and the preset condition includes: the file name of the static resource file in the program package of the target plug-in and the file name of the static resource file in the host program package are not repeated.

[0073] Optionally, the plug-in information includes the dependent library information of the target plug-in, the dependent library information includes the dependent library identifier and the version identifier, and the preset conditions include: the dependent library used by both the target plug-in and the host has the same version in the target plug-in and the host.

[0074] Optionally, the plug-in information includes signature information of the target plug-in, and the preset condition includes: the signature information of the target plug-in is consistent with the signature information of the host.

[0075] Optionally, the manifest file and the plug-in information of the target plug-in are obtained according to the program package obtained after compiling the target plug-in, and are stored in the cloud server; the acquisition module 401 is specifically used to obtain the manifest file and the plug-in information of the target plug-in from the cloud server.

[0076] Optionally, the compiling module 402 is further configured to stop compiling if there is a conflict between the host and target plug-ins.

[0077] It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; or all in the form of hardware; or some units can be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware.

[0078] For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in a memory in the form of a program, and called and executed by a certain processing element of the device. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software called by a processing element.

[0079] In one example, the unit in the above apparatus may be one or more integrated circuits configured to implement the above method, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.

[0080] For another example, when the units in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a CPU or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0081] In one implementation, the units of the above apparatus implementing the corresponding steps in the above method can be implemented in the form of a processing element scheduling program. For example, the apparatus may include a processing element and a storage element, and the processing element calls the program stored in the storage element to execute the method described in the above method embodiment. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.

[0082] In another implementation, the program for executing the above method may be in a storage element on a different chip from the processing element, i.e., an off-chip storage element. In this case, the processing element calls or loads the program from the off-chip storage element to the on-chip storage element to call and execute the method described in the above method embodiment.

[0083] For example, an embodiment of the present application may also provide a device, such as an electronic device, which may include a processor and a memory for storing instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the program compilation method implemented by the electronic device in the above embodiment. The memory may be located inside the electronic device or outside the electronic device. And the processor includes one or more.

[0084] In another implementation, the unit of the device implementing each step in the above method may be configured as one or more processing elements, which may be arranged on the corresponding electronic device, and the processing element here may be an integrated circuit, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these integrated circuits. These integrated circuits may be integrated together to form a chip.

[0085] For example, the present application also provides a chip system, which can be applied to the above electronic device. The chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the method related to the electronic device in the above method embodiment.

[0086] An embodiment of the present application also provides a computer program product, including computer instructions executed by an electronic device, such as the electronic device described above.

[0087] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0088] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0089] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0090] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0091] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, such as a program. The software product is stored in a program product, such as a computer-readable storage medium, including a number of instructions to enable a device, which can be a single-chip microcomputer, a chip, etc. or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.

[0092] For example, the embodiment of the present application may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements the program compiling method described in the above method embodiment.

[0093] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A program compiling method, characterized in that: include: Compile the host to generate a host program package, wherein the host program package includes a manifest file of the host; Obtaining a manifest file and plugin information of a target plugin, wherein the target plugin is a plugin obtained by compiling a program package; According to the plug-in information, the host and the target plug-in are checked according to preset conditions to determine whether the host and the target plug-in conflict with each other. When the plug-in information satisfies the preset conditions, there is no conflict between the host and the target plug-in. If there is no conflict between the host and the target plug-in, merge the manifest files of the host and the target plug-in to generate a master manifest file, and replace the manifest file in the host program package with the master manifest file; The plug-in information is integrated into the host program package.

2. The method according to claim 1, characterized in that The step of integrating the plug-in information into the host program package includes: The plug-in information is packaged and placed in the static resource folder of the host package.

3. The method according to claim 1 or 2, characterized in that: The plug-in information includes a package identifier of the program package of the target plug-in, and the preset condition includes: The package identifier of the target plug-in package is different from the package identifier of the host package.

4. The method according to claim 1 or 2, characterized in that: The plug-in information includes the file name of the static resource file in the program package of the target plug-in, and the preset condition includes: The file names of the static resource files in the program package of the target plug-in and the file names of the static resource files in the host program package are not repeated.

5. The method according to claim 1 or 2, characterized in that: The plug-in information includes the dependent library information of the target plug-in, the dependent library information includes the dependent library identifier and the version identifier, and the preset condition includes: The target plug-in and the host both use a dependent library, and the target plug-in and the host have the same version.

6. The method according to claim 1 or 2, characterized in that: The plug-in information includes the signature information of the target plug-in, and the preset condition includes: The signature information of the target plug-in is consistent with the signature information of the host.

7. The method according to claim 1, characterized in that The manifest file and plug-in information of the target plug-in are obtained according to the program package obtained after compiling the target plug-in, and are stored in the cloud server; The step of obtaining the manifest file and plugin information of the target plugin includes: Obtain a manifest file and plug-in information of the target plug-in from the cloud server.

8. The method according to claim 1, characterized in that The method further comprises: If there is a conflict between the host and the target plug-in, the compilation is stopped.

9. A program compiling device, characterized in that: include: An acquisition module, used to acquire a manifest file and plugin information of a target plugin, wherein the target plugin is a plugin obtained by compiling a program package; A compiling module, used for compiling the host to generate a host program package, wherein the host program package includes a manifest file of the host; According to the plug-in information, the host and the target plug-in are checked according to preset conditions to determine whether the host and the target plug-in conflict with each other. When the plug-in information satisfies the preset conditions, there is no conflict between the host and the target plug-in. If there is no conflict between the host and the target plug-in, merge the manifest files of the host and the target plug-in to generate a master manifest file, and replace the manifest file in the host program package with the master manifest file; The plug-in information is integrated into the host program package.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • A method and apparatus for Android plug-in development

    CN109542445A

  • Android application plug-in implementation method and device, equipment and storage medium

    CN111258587A

  • Non-invasive aar merging method based on Android system

    CN111459892A

  • Plug-in compiling and calling method and device, equipment and storage medium

    CN114942796A