A compiling processing method and device, a storage medium and an electronic device
By separating the code repository management of independent plugins from the host code, and combining the verification and merging of plugin manifest information data, the problems of high code coupling and difficult version management in plugin-based compilation are solved, achieving higher compatibility and reusability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-12-11
- Publication Date
- 2026-07-28
AI Technical Summary
In existing technologies, the plug-in compilation method places the host code and plug-in code in the same code repository, resulting in high code coupling, difficulty in version management, and security issues.
By placing the code of independent plugins and the host code in different code repositories, and by verifying and merging the plugin manifest information data, plugin-based compilation is achieved, generating program runtime files.
It reduces the coupling of the code repository, improves the compatibility and reusability of plugins, simplifies version management, and ensures the smooth compilation and diversity of plugins.
Smart Images

Figure CN117573138B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a compilation processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] Plug-in compilation is a method for application development that allows application modules to be developed and compiled separately as plug-ins, and dynamically loaded into the host application at runtime.
[0003] Currently, plug-in compilation uses the method of placing the code of the plug-in and the host in the same code repository, and performing joint compilation and integration in the same code repository for application-related plug-in development. Plug-in compilation brings greater flexibility and scalability to application development, making it easier to organize and manage the functional modules of the application. Summary of the Invention
[0004] This application provides a compilation processing method, apparatus, storage medium, and electronic device, the technical solutions of which are as follows:
[0005] In a first aspect, embodiments of this application provide a compilation processing method, the method comprising:
[0006] Identify at least one dependent plugin for the host, obtain at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host;
[0007] The plugin manifest information data of the dependent plugins is validated and merged to obtain the target plugin manifest information data;
[0008] Based on the target plugin manifest information, the dependent plugins are compiled and integrated to obtain the program executable file for the host.
[0009] Secondly, embodiments of this application provide a compilation processing apparatus, the apparatus comprising:
[0010] The data acquisition module is used to identify at least one dependent plugin for the host, acquire at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host.
[0011] The data processing module is used to perform verification and merging processing on the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data;
[0012] The file integration module is used to compile and integrate the dependent plugins based on the target plugin manifest information data to obtain the program runtime file for the host.
[0013] Thirdly, embodiments of this application provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.
[0014] Fourthly, embodiments of this application provide an electronic device that may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the above-described method steps.
[0015] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following:
[0016] In one or more embodiments of this specification, an electronic device can identify at least one dependent plugin for a host, obtain at least one plugin manifest information data for the dependent plugin, and ensure that at least one independent plugin code among the dependent plugins does not belong to the same code repository as the host code. The plugin manifest information data of the dependent plugins is verified and merged to obtain target plugin manifest information data. Then, the target plugin manifest information data is used to compile and integrate the dependent plugins to obtain a program executable file for the host. Compared to the original method of compiling and processing the host code and all plugin code in the same code repository, setting independent plugins reduces the code coupling of the shared repository, facilitates plugin code version and host code version management. In the case of setting independent plugins, the introduction of verification, merging, and compilation integration of the plugin manifest information of all dependent plugins ensures smooth plugin compilation, reduces conflicts during compilation, and improves the compatibility of independent plugins. That is, during plugin compilation, the limitations of the host's dependent plugin source can be overcome, and suitable non-shared repository plugins can be selected for integration, improving the diversity and convenience of plugin compilation. Furthermore, for independent plugins, multiple hosts can depend on them simultaneously, ensuring successful plugin compilation and improving plugin reusability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a compilation process method provided in an embodiment of this application;
[0019] Figure 2 This is a flowchart illustrating a compilation process method provided in an embodiment of this application;
[0020] Figure 3 This is a schematic diagram of an independent plug-in processing method provided in an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of a shared warehouse plugin processing method provided in an embodiment of this application;
[0022] Figure 5 This is a flowchart illustrating another embodiment of a compilation processing method provided in this application.
[0023] Figure 6 This is a schematic diagram of the structure of a compilation processing device provided in an embodiment of this application;
[0024] Figure 7 This is a schematic diagram of the structure of a data acquisition module provided in an embodiment of this application;
[0025] Figure 8 This is a schematic diagram of the structure of a data processing module provided in an embodiment of this application;
[0026] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0027] Figure 10 This is a schematic diagram of the structure of the operating system and user space provided in the embodiments of this application;
[0028] Figure 11 yes Figure 10 Architecture diagram of the Android operating system in China;
[0029] Figure 12 yes Figure 10 Architecture diagram of the iOS operating system. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0032] In related technologies, storing host code and plugin code in the same code repository presents several challenges. Firstly, it leads to high code coupling: the host and plugin code may cross-reference each other, increasing coupling and maintenance costs. Secondly, it makes version management difficult: updating either the host or plugin requires updating the entire repository, not just a part. Thirdly, it raises security concerns: plugin code in the same repository might access sensitive information in the host code, potentially causing security vulnerabilities.
[0033] Therefore, it is evident that the compilation processing methods in the related technologies have certain limitations. By executing the compilation processing methods mentioned in one or more embodiments of this specification, the aforementioned limitations can be at least resolved or even completely improved.
[0034] The present application will now be described in detail with reference to specific embodiments.
[0035] In one embodiment, such as Figure 1As shown, a compilation processing method is proposed, which can be implemented using a computer program and run on a compiler processing device based on the von Neumann architecture. This computer program can be integrated into applications or run as a standalone utility application. The compiler processing device can be an electronic device, including but not limited to: personal computers, tablets, handheld devices, in-vehicle devices, wearable devices, computing devices, or other processing devices connected to a wireless modem. Terminal devices can be called by different names in different networks, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user equipment, cellular phone, cordless phone, electronic device in 5G networks or future evolved networks, etc.
[0036] Specifically, the compilation process includes:
[0037] S102: Determine at least one dependent plugin for the host, obtain at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host.
[0038] In plug-in-based compilation scenarios, program functional modules are typically developed and compiled separately as dependent plugins, and dynamically loaded into the host at runtime. The host can be a program or platform, and can depend on one or more "plugins" to provide specific functions or services. For example, the host can be an application or library, and can depend on plugins to provide additional functionality. Dependent plugins can be code modules that integrate with the host to extend its functionality or provide additional services.
[0039] In this specification, based on actual programming development needs, one or more dependency plugins are set for the host to determine the dependency plugins for the host. It should be noted that in order to avoid or improve the aforementioned limitations caused by the plugin code and the host code belonging to the same code repository, in this specification, there is at least one independent plugin among the dependency plugins for the host, and the independent plugin code of the independent plugin does not belong to the same code repository as the host code; optionally, a shared repository plugin can be configured among the dependency plugins for the host, and the shared repository plugin code belongs to the same code repository as the host code.
[0040] In this specification, the code of the independent plugins in the dependency plugins belongs to different code repositories from the host code. The independent plugins can be reused by one or more hosts. In other words, a plugin can be configured with multiple hosts as needed and serve as a dependency plugin for multiple hosts.
[0041] In this specification, since the independent plugins in the dependent plugins and the host code belong to different code repositories, the plug-in compilation process for the same code repository in related technologies cannot be adapted to the scenario where "the independent plugins and the host code belong to different code repositories". Based on this, the compilation processing method involved in this specification can be executed to realize the plug-in compilation process in the scenario where "the independent plugins and the host code belong to different code repositories". Executing the compilation processing method involved in this specification can support the separate compilation of the host and dependent plugins, and can also support the host to introduce shared repository plugins while independent plugins exist, and realize the plug-in compilation process.
[0042] In this specification, after identifying one or more dependent plugins for the current plugin compilation processing object-host, the electronic device can obtain plugin manifest information data of the dependent plugins, such as obtaining plugin manifest information data of the independent plugins;
[0043] The plugin manifest data includes manifest information and plugin information that depends on the plugins (such as plugin name, version, etc.).
[0044] For example, taking the Android system as an example, you can obtain the AndroidManifest.xml and plugin-info.json of all the host's dependent plugins. AndroidManifest.xml contains the manifest information, and plugin-info.json contains the plugin information of the dependent plugins.
[0045] S104: Perform verification and merging processing on the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data;
[0046] Specifically, for the current plugin compilation processing object—the host—which is configured with one or more dependent plugins, during the plugin compilation process, there may be one or more independent plugins among the dependent plugins that do not belong to the same code repository as the host, or, if independent plugins exist, there may be shared repository plugins that belong to the same code repository as the host. This specification proposes a compatible plugin compilation method. This method involves verifying and merging the plugin manifest information data of all dependent plugins. The verification process may include one or more checks such as package ID conflict verification, resource file asset conflict verification, and host and plugin version verification. Then, the manifest information in the manifest information of all dependent plugins is merged and integrated to complete the merging process, resulting in the target plugin manifest information data. The target plugin manifest information data may include the host's comprehensive manifest information and the comprehensive plugin information of the dependent plugins.
[0047] S106: Based on the target plugin manifest information data, the dependent plugins are compiled and integrated to obtain the program runtime file for the host.
[0048] Specifically, after verifying and merging the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data, the dependent plugins are compiled based on the target plugin manifest information data to obtain the compilation result. Based on the compilation result, all dependent plugins can be loaded in the host to generate the program runtime file. The program runtime file can be the host's dependent plugin application package (referred to as plugin apk), the host application package (referred to as host apk), or an application package that integrates the host and "all or some dependent plugins", etc.
[0049] APK is an application package file format used by electronic devices, referring to the installation package of an app on an electronic device, used for distributing and installing applications and middleware. For an application's code to run on a device, it must first be compiled and then packaged into a file that can be recognized and run by the electronic device's system. This file format that can be recognized and run by the system is called "APK". The app corresponding to that APK file can be installed by directly transferring the installation package, i.e., the complete APK file, to the system emulator or electronic device system for execution.
[0050] Typically, a complete executable file for an application, after compilation, may include multiple files, such as Manifest.xml, Dex, ELF, res, and signature files, and may also include folders such as assets and META-INF.
[0051] The Manifest.xml file is the application's global configuration file, containing various information such as the application's package name, data permissions, interface permissions, version information, installation parameters, etc. In addition, it can declare each component of the application and its attributes, declare the permissions and processes requested by the application, declare the display mode, and so on.
[0052] In Android, Dex is the type of executable file, a file format that can be recognized, loaded, and executed. A DEX file is an executable file on the system. When executed, a Dex file can be used to implement the functionality of an application. Applications are typically developed in Java, which is compiled into binary bytecode using Android development tools. This bytecode is packaged into classes.dex files, which are interpreted and executed by the platform's Dalvik virtual machine. To call system functions, the system provides a runtime environment (Framework). Applications call system functions by calling libraries within the Framework.
[0053] ELF stands for Executable and Linkable Format, a file format for executable files and shared libraries in operating systems. The system also supports applications running directly via JNI or native executables. In this case, the application executes binary machine code that runs directly on the CPU, without needing virtual machine interpretation, and can directly call operating system libraries such as libc, WebKit, SQLite, and OpenGL / ES to access various system functions. If the application needs to run via JNI or a native executable, the code to be executed needs to be compiled into an ELF file format. In some implementations, APK files include .so files, where .so is short for SharedObject, and .so files are also a type of ELF file.
[0054] The res file contains the application's resource files, such as image assets and layout files.
[0055] The assets folder contains static files, such as documentation or font files.
[0056] The signature file can be a signing certificate file used by the application developer to sign the application. The signature file can be used for security verification, such as checking whether the file has been tampered with. The signature file can be stored in the META-INF folder, which may include the calculated hash values of each file in the installation package, the installation package's signature file, etc.
[0057] In one or more embodiments of this specification, an electronic device can identify at least one dependent plugin for a host, obtain at least one plugin manifest information data for the dependent plugin, and ensure that at least one independent plugin code among the dependent plugins does not belong to the same code repository as the host code. The plugin manifest information data of the dependent plugins is verified and merged to obtain target plugin manifest information data. Then, the target plugin manifest information data is used to compile and integrate the dependent plugins to obtain a program executable file for the host. Compared to the original method of compiling and processing the host code and all plugin code in the same code repository, setting independent plugins reduces the code coupling of the shared repository, facilitates plugin code version and host code version management. In the case of setting independent plugins, the introduction of verification, merging, and compilation integration of the plugin manifest information of all dependent plugins ensures smooth plugin compilation, reduces conflicts during compilation, and improves the compatibility of independent plugins. That is, during plugin compilation, the limitations of the host's dependent plugin source can be overcome, and suitable non-shared repository plugins can be selected for integration, improving the diversity and convenience of plugin compilation. Furthermore, for independent plugins, multiple hosts can depend on them simultaneously, ensuring successful plugin compilation and improving plugin reusability.
[0058] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the compilation processing method proposed in this application. Specifically:
[0059] S202: Obtain a standalone plugin for the host;
[0060] In one or more embodiments of this specification, one or more functional modules are developed based on program development requirements. These modules are developed independently as plugins, and one or more independent plugins are configured on the host according to pre-set configuration information. These independent plugins are dynamically loaded into the host at runtime. The host can be a program or platform, and can rely on one or more "independent plugins" to provide specific functions or services. For example, the host can be an application or library, and can rely on independent plugins to provide additional functionality. Independent plugins can be code modules that integrate with the host to extend its functionality or provide additional services.
[0061] In one or more embodiments of this specification, in order to avoid or improve the aforementioned limitations caused by the plugin code of the plugin and the host code of the host both belonging to the same code repository, this specification sets at least one independent plugin for the host's dependent plugins based on actual programming development needs. The independent plugin code of the independent plugin does not belong to the same code repository as the host's host code.
[0062] S204: Compile the independent plugin to obtain an independent plugin program executable file, and use a preset compilation service to set the plugin manifest information data of the independent plugin to obtain the first plugin manifest information data, and upload the first plugin manifest information data to the cloud server;
[0063] A default compilation service can be a compilation plugin, compiler, or compilation module used for compilation processing. The specific form of the default compilation service is not limited here and can be set based on the actual application environment.
[0064] Optionally, a first preset compilation service can be set for the independent plugin, and the plugin manifest information data can be set for the independent plugin using the first preset compilation service to obtain the first plugin manifest information data, and then the first plugin manifest information data can be uploaded to the cloud server; or, the first preset compilation service can be used to compile the independent plugin to obtain the independent plugin APK, and then the first plugin manifest information data can be uploaded to the cloud server after compilation.
[0065] like Figure 3 As shown, Figure 3 This is a schematic diagram of independent plugin processing provided in this manual. The processing of independent plugins using the first preset compilation service can be referenced as follows:
[0066] 1. Pre-define plugin configuration information to compile independent plugin programs into independent plugin executable files (i.e., independent plugin APKs). Provide a configuration file (e.g., plugin-config.json) for plugin developers according to the plugin configuration information, in which packageID and other relevant information can be specified. Read this configuration information to obtain the packageID of the independent plugin.
[0067] 2. Collect resource file asset information during compilation of independent plugins: Specifically, during compilation, the resource file directory of the plugin project is traversed to collect all file and directory information, obtain resource file asset information, and generate manifest.xml information.
[0068] 3. Integrate plugin information. For example, you can obtain plugin name, version and other information from build.gradle or other configuration files to use as plugin information for independent plugins.
[0069] The plugin information of the independent plugins is combined with the manifest information Manifest.xml collected in the previous step and integrated into a plugin description object, which is also the first plugin manifest information data.
[0070] 4. Upload the first plugin list information data to the cloud server.
[0071] S206: Obtain the independent plugins and shared repository plugins for the host;
[0072] In this specification, based on actual programming development needs, one or more dependency plugins are set for the host to determine the dependency plugins for the host. It should be noted that in order to avoid or improve the aforementioned limitations caused by the plugin code and the host code belonging to the same code repository, in this specification, there is at least one independent plugin among the dependency plugins for the host. The independent plugin code of the independent plugin does not belong to the same code repository as the host code. Furthermore, a shared repository plugin can be configured among the dependency plugins for the host. The shared repository plugin code belongs to the same code repository as the host code.
[0073] S208: Compile the independent plugin to obtain an independent plugin program runtime file and compile the shared repository plugin to obtain a shared repository plugin program runtime file. Use a preset compilation service to set the plugin manifest information data for the independent plugin to obtain first plugin manifest information data and set the plugin manifest information data for the shared repository plugin to obtain second plugin manifest information data. Upload the first plugin manifest information data to the cloud server and store the second plugin manifest information data based on the cloud server and / or local storage space.
[0074] The steps “compiling the independent plugin to obtain the independent plugin program executable file” and “using the preset compilation service to set the plugin manifest information data of the independent plugin to obtain the first plugin manifest information data” can be referred to the aforementioned method steps, and will not be repeated here.
[0075] Optionally, a second preset compilation service can be set for independent plugins. The second preset compilation service is used to set the plugin manifest information data for the shared repository plugin to obtain the second plugin manifest information data, and then the second plugin manifest information data is saved to the cloud server and / or local storage space; or, the second preset compilation service is used to compile the shared repository plugin to obtain the shared repository plugin apk, and then the second plugin manifest information data is saved to the cloud server and / or local storage space after compilation is completed.
[0076] like Figure 4 As shown, Figure 4 This is a schematic diagram of a shared repository plugin processing method provided in this manual. The following method can be used as a reference for processing shared repository plugins using the second preset compilation service:
[0077] 1. Compile the shared repository plugin using the second preset compilation service to generate the shared repository plugin apk. Modify the manifest component of the shared repository plugin and add process according to the plugin configuration information. Read the manifest information of the shared repository plugin Manifest.xml. Based on the plugin configuration information, determine the corresponding target components and add the process attribute to the corresponding target components to complete the modification of the shared repository plugin's manifest information according to the plugin configuration information.
[0078] 2. Integrate plugin information and save the plugin information of the shared repository plugin. For example, you can obtain the plugin name, version and other information from build.gradle or other configuration files to use as the plugin information of the shared repository plugin.
[0079] The plugin information of the shared warehouse plugin is combined with the list information Manifest.xml collected in the previous step and integrated into a plugin description object, which is also the second plugin list information data.
[0080] S210: Using a preset compilation service, perform the step of determining at least one dependent plugin for the host;
[0081] Optionally, a third preset compilation service can be set for the host, and the steps of determining at least one dependent plugin for the host as described in one or more embodiments of this specification can be started using the third preset compilation service, that is, compiling the host.
[0082] For example, S102-S106 can be executed using the third preset compilation service, and S302-S314 can be executed using the third preset compilation service.
[0083] Optionally, the first preset compilation service, the second preset compilation service, and the third preset compilation service can be the same preset compilation service or different preset compilation services.
[0084] In one or more embodiments of this specification, compared to the original method of compiling the host code and all plugin code in the same code repository, the above-described method reduces the code coupling of the shared repository by setting up independent plugins, which facilitates the management of plugin code versions and host code versions. In the case of setting up independent plugins, the introduction of plugin manifest information verification, merging and compilation integration for all dependent plugins can ensure smooth plugin compilation, reduce conflicts during compilation, and improve the compatibility of independent plugins. That is, during plugin compilation, the limitation of the host's dependent plugin sources can be broken, and appropriate non-shared repository plugins can be selected for integration, which improves the diversity and convenience of plugin compilation. Moreover, for independent plugins, multiple hosts can depend on them simultaneously and ensure successful plugin compilation, thereby improving the reusability of plugins.
[0085] Please see Figure 5 , Figure 5 This is a flowchart illustrating another embodiment of the compilation processing method proposed in this application. Specifically:
[0086] S302: Obtain at least one dependent plugin for the host, and determine the plugin type of the dependent plugin;
[0087] According to some embodiments, the plugin type that depends on the plugin may include independent plugin type and shared repository plugin type.
[0088] During the compilation process of the host application, at least one dependent plugin for the host is obtained. The plugin type of each dependent plugin is determined as either an independent plugin or a shared repository plugin. In this specification, at least one dependent plugin for the host is an independent plugin. Depending on actual development needs, a shared repository plugin may or may not exist. Based on this, at least one plugin manifest information for the dependent plugin can be obtained from the cloud server based on its plugin type. That is, at least the first plugin manifest information for the independent plugin can be obtained from the cloud server.
[0089] Optionally, when there is a shared storage plugin for the dependent plugin, the second plugin list information data of the pre-shared storage plugin can be stored on the cloud server or in the current storage space. Based on this, the mapping relationship of the plugin list information data of the actual shared storage plugin can be used to determine whether to obtain at least one second plugin list information data for the shared storage plugin from the cloud server or the local storage space.
[0090] S304: If the plugin type is an independent plugin type, then obtain at least one first plugin list information data for the independent plugin from the cloud server;
[0091] S306: If the plugin type is a shared repository plugin type, then obtain at least one second plugin manifest information data for the shared repository plugin from the cloud server or local storage space, wherein the shared repository plugin code of the shared repository plugin and the host code of the host belong to the same code repository.
[0092] S308: Perform compilation verification based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result;
[0093] Compilation verification based on the first and second plugin manifest information data can be understood as performing data verification on the host's dependent plugins during the host's compilation process to avoid data conflicts in subsequent compilation. The specification proposes a compatible plugin compilation method that verifies the manifest information data of all host-dependent plugins. The verification process may include one or more of the following: package ID conflict verification, resource file asset conflict verification, host and plugin version verification, etc. After completing the compilation verification, the compilation verification result can be obtained.
[0094] In one feasible implementation, the compilation verification based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result can be performed in the following manner:
[0095] Optionally, identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data; based on the identifier data, identifier duplication checks are performed on the independent plugin, the shared repository plugin, and the host to obtain the identifier duplication check result; and / or,
[0096] Optionally, resource name data is obtained based on the first plugin manifest information data and the second plugin manifest information data; resource name conflict verification is performed on the independent plugin, the shared repository plugin, and the host based on the resource name data to obtain resource conflict verification results; and / or,
[0097] Optionally, based on the second plugin manifest information data, the plugin version and host version are determined, and the library plugin version of the shared repository plugin and the host is verified based on the plugin version and the host version to obtain the version verification result.
[0098] For example, identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data. Based on the identifier data, identifier duplication checks are performed on the independent plugin, the shared repository plugin, and the host to obtain the identifier duplication check results, as shown below:
[0099] Identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data. The identifier data refers to the first identifier data of the independent plugin, the second identifier data of the shared repository plugin, and the third identifier data of the host.
[0100] Identifier duplication check: This checks whether the first, second, and third identifier data have the same identifier packageID. The purpose of identifier duplication check is to verify that each dependent plugin needs to have a different packageID from the "host and other plugins". Furthermore, if the first, second, and third identifier data are all different, a successful identifier duplication check result is generated. If at least two of the first, second, and third identifier data are the same, a failed identifier duplication check result is generated.
[0101] Because of the existence of independent plugins, which are isolated from the host code, the packageID of the independent plugin must be different from the packageID of the "host and other plugins" to avoid subsequent compilation failures due to duplicate packageIDs.
[0102] Optionally, if the identifier duplication check result is a check failure type, then the compilation process is stopped; this can be understood as stopping compilation when the identifier is duplicated and outputting a plugin check failure; if the identifier duplication check result is a check success type, then the next check is performed until all checks are completed, and the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed.
[0103] For example, resource name data is obtained based on the first plugin manifest information data and the second plugin manifest information data. Resource name conflict checks are then performed on the independent plugin, the shared repository plugin, and the host based on the resource name data to obtain the resource conflict check result. The following method can be used as a reference:
[0104] Resource name data is obtained from the first plugin list information data and the second plugin list information data. The resource name data refers to the first resource name data of the independent plugin, the second resource name data of the shared repository plugin, and the third resource name data of the host.
[0105] Resource name duplication check: This checks whether the first, second, and third resource name data have the same resource name packageID. The purpose of the resource name duplication check is to verify that each dependent plugin needs to have a different packageID from the "host and other plugins". Furthermore, if the first, second, and third resource name data are all different, a successful resource name duplication check result is generated. If at least two of the resource name data in the first, second, and third resource name data are the same, a failed resource name duplication check result is generated.
[0106] Because of the existence of independent plugins, which are isolated from the host code, the asset names of the independent plugin's resource files must be different from those of the "host and other plugins" resource files to avoid subsequent asset file conflicts that could lead to compilation failures.
[0107] Optionally, if the result of the duplicate resource name check is a check failure, then the compilation process is stopped; this can be understood as stopping compilation when the resource name is duplicated and outputting a plugin check failure; if the result of the duplicate resource name check is a check success, then the next check is performed until all checks are completed, and then the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed.
[0108] The asset folder stores the raw resource files required by the application, which are packaged into the APK during compilation. Multiple files with the same name in the asset folder can cause conflicts.
[0109] In application development, an asset refers to the application's raw resource files, which are typically stored in the application's assets folder. These resource files can be non-compiled files such as images, audio, video, and fonts, and can be read and used during application runtime.
[0110] For example, based on the second plugin manifest information data, the plugin version and the host version are determined, and the library plugin version of the shared repository plugin and the host is verified based on the plugin version and the host version to obtain the version verification result.
[0111] Plugin version verification: Verify whether the plugin (code repository) version is less than or equal to the host (code repository) version. If the plugin (code repository) version is less than or equal to the host (code repository) version, generate a version verification result of success. If the plugin (code repository) version is greater than the host (code repository) version, generate a version verification result of failure.
[0112] Furthermore, if the version verification result is a successful verification, the next verification step continues until all verifications are completed. Then, the step of merging the first and second plugin manifest information data to obtain the target plugin manifest information data is executed. If the version verification result is a failed verification, compilation is stopped; this can be understood as stopping compilation upon version verification failure and outputting "plugin verification failed."
[0113] In one feasible implementation, if at least one of the identifier duplication check result, the resource conflict check result, and the version check result is a check failure type, then the compilation process is stopped; if all of the identifier duplication check result, the resource conflict check result, and the version check result are check success types, then the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed, or, S310 can be started.
[0114] S310: Based on the compilation verification results, perform manifest configuration update processing on the first plugin manifest information data of the independent plugin to obtain the processed first plugin manifest information data.
[0115] In one feasible implementation, if at least one of the identifier duplication check result, the resource conflict check result, and the version check result is a check failure type, then the compilation process is stopped; if all of the identifier duplication check result, the resource conflict check result, and the version check result are check success types, then the process of updating the first plugin manifest information data of the independent plugin is performed to obtain the processed first plugin manifest information data.
[0116] For example, the manifest configuration update process is performed on the first plugin manifest information data of the independent plugin to obtain the processed first plugin manifest information data. Specifically, the processing process information (hereinafter referred to as process information) for the independent plugin in the plugin manifest information manifest of the first plugin manifest information data can be modified or added according to the configuration information to generate new first plugin manifest information data.
[0117] In one feasible implementation, the electronic device performs the manifest configuration update process on the first plug-in manifest information data of the independent plug-in to obtain the processed first plug-in manifest information data, which may be:
[0118] The electronic device obtains the independent plugin manifest information of the independent plugin from the first plugin manifest information data, determines the processing information for the independent plugin, and performs manifest configuration update processing on the independent plugin manifest based on the processing information to obtain the processed first plugin manifest information data.
[0119] Among them, the processing information (process information): abbreviated as "processing steps" or "processing procedures", refers to the steps of performing specific operations or processing on the plugin or host. The specific processing information is stored in the configuration information during the plugin development stage, that is, it is pre-set.
[0120] S312: Perform data merging processing on the first plugin list information data and the second plugin list information data to obtain the target plugin list information data.
[0121] For example, taking a plugin dependency including independent plugins and shared repository plugins, and the plugin manifest information data including the first plugin manifest information data of the independent plugins and the second plugin manifest information data of the shared repository plugins as an example; in this case, after the aforementioned verification is passed, the first plugin manifest information data and the second plugin manifest information data can be merged to obtain the target plugin manifest information data; typically, this can be done by merging the first manifest information in the first plugin manifest information data and the second manifest information in the second plugin manifest information data to obtain the target manifest information, and by integrating the plugin information of all dependent plugins, that is, merging the first plugin information in the first plugin manifest information data and the second plugin information in the second plugin manifest information data to obtain the target plugin information, thus generating the target plugin manifest information data containing the target manifest information and the target plugin information.
[0122] S314: Based on the target plugin manifest information data, the dependent plugins are compiled and integrated to obtain the program runtime file for the host.
[0123] According to some embodiments, after verifying and merging the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data, the dependent plugins are compiled based on the target plugin manifest information data to obtain the compilation result. Based on the compilation result, all dependent plugins can be loaded in the host to generate a program runtime file. The program runtime file can be the host's dependent plugin application package (referred to as plugin apk), the host application package (referred to as host apk), or an application package that integrates the host and "all or part of the dependent plugins", etc.
[0124] For example, in a specific implementation scenario, the electronic device may perform the following steps:
[0125] S502: Obtain the standalone plugins and shared repository plugins for the host;
[0126] S504: Compile the independent plugin to obtain an independent plugin program runtime file and compile the shared repository plugin to obtain a shared repository plugin program runtime file. Use a preset compilation service to set the plugin manifest information data for the independent plugin to obtain first plugin manifest information data and set the plugin manifest information data for the shared repository plugin to obtain second plugin manifest information data. Upload the first plugin manifest information data to the cloud server and store the second plugin manifest information data based on local storage space.
[0127] S506: Obtain at least one dependent plugin for the host, the dependent plugins include independent plugins and shared repository plugins, and determine that the plugin type of the dependent plugin is an independent plugin type and a shared repository plugin type;
[0128] S508: If the plugin type is an independent plugin type, then at least one first plugin manifest information data for the independent plugin is obtained from the cloud server; if the plugin type is a shared repository plugin type, then at least one second plugin manifest information data for the shared repository plugin is obtained from the local storage space; the shared repository plugin code of the shared repository plugin and the host code of the host belong to the same code repository.
[0129] S510: Obtain identifier data from the first plugin manifest information data and the second plugin manifest information data, and perform identifier duplication verification on the independent plugin, the shared repository plugin and the host based on the identifier data to obtain the identifier duplication verification result;
[0130] S510-2: If the identifier duplication check result is a successful check, then execute S512;
[0131] S510-4: If the identifier duplication check result is a check failure, then stop the compilation process;
[0132] S512: Based on the first plugin list information data and the second plugin list information data, obtain resource name data, and perform resource name conflict verification on the independent plugin, the shared repository plugin and the host based on the resource name data to obtain the resource conflict verification result;
[0133] S512-2: If the resource conflict verification result is a successful verification type, then execute S514;
[0134] S512-4: If the resource conflict check result is a check failure, then stop the compilation process;
[0135] S514: Perform list configuration update processing on the first plug-in list information data of the independent plug-in to obtain the processed first plug-in list information data.
[0136] S516: Determine the plugin version and host version based on the second plugin list information data, and perform library plugin version verification on the shared repository plugin and the host based on the plugin version and the host version to obtain the version verification result;
[0137] S516-2: If the version verification result is a successful verification type, then execute S518;
[0138] S516-4: If the version verification result is a verification failure, then stop the compilation process;
[0139] S518: Perform data merging processing on the first plugin list information data and the second plugin list information data to obtain the target plugin list information data;
[0140] S520: Based on the target plugin manifest information data, the dependent plugins are compiled and integrated to obtain the program runtime file for the host.
[0141] In one or more embodiments of this specification, compared to the original method of compiling the host code and all plugin code in the same code repository, the above-described method reduces the code coupling of the shared repository by setting up independent plugins, which facilitates the management of plugin code versions and host code versions. In the case of setting up independent plugins, the introduction of plugin manifest information verification, merging and compilation integration for all dependent plugins can ensure smooth plugin compilation, reduce conflicts during compilation, and improve the compatibility of independent plugins. That is, during plugin compilation, the limitation of the host's dependent plugin sources can be broken, and appropriate non-shared repository plugins can be selected for integration, which improves the diversity and convenience of plugin compilation. Moreover, for independent plugins, multiple hosts can depend on them simultaneously and ensure successful plugin compilation, thereby improving the reusability of plugins.
[0142] The following will combine Figure 6 This application provides a detailed description of the compilation processing apparatus provided in its embodiments. It should be noted that... Figure 6 The compiler shown is used to execute this application. Figures 1-5 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figures 1-5 The example shown.
[0143] Please see Figure 6 This diagram illustrates the structure of a compilation processing apparatus according to an embodiment of this application. The compilation processing apparatus 1 can be implemented as all or part of a user terminal through software, hardware, or a combination of both. According to some embodiments, the compilation processing apparatus 1 includes a data acquisition module 11, a data processing module 12, and a file integration module 13, specifically used for:
[0144] The data acquisition module 11 is used to determine at least one dependent plugin for the host, and to acquire at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host.
[0145] Data processing module 12 is used to perform verification and merging processing on the plugin list information data of the dependent plugins to obtain target plugin list information data;
[0146] The file integration module 13 is used to compile and integrate the dependent plugins based on the target plugin manifest information data to obtain the program runtime file for the host.
[0147] Optional, such as Figure 7 As shown, the data acquisition module 11 includes:
[0148] The plugin acquisition unit 111 is used to acquire at least one dependent plugin for the host and determine the plugin type of the dependent plugin.
[0149] The data acquisition unit 112 is used to acquire at least one plugin list information data for the dependent plugin from the cloud server based on the plugin type of the dependent plugin.
[0150] Optionally, the data acquisition unit 112 is used for:
[0151] If the plugin type is an independent plugin type, then at least one first plugin manifest information data for the independent plugin is obtained from the cloud server;
[0152] If the plugin type is a shared repository plugin type, then at least one second plugin manifest information data for the shared repository plugin is obtained from the cloud server or local storage space, wherein the shared repository plugin code of the shared repository plugin and the host code of the host belong to the same code repository.
[0153] Optionally, the dependent plugins include independent plugins and shared repository plugins, and the plugin manifest information data includes first plugin manifest information data for the independent plugins and second plugin manifest information data for the shared repository plugins, such as... Figure 8 As shown, the data processing module 12 includes:
[0154] The compilation verification unit 121 is used to perform compilation verification based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result.
[0155] The configuration update unit 122 is used to perform manifest configuration update processing on the first plugin manifest information data of the independent plugin based on the compilation verification result, so as to obtain the processed first plugin manifest information data.
[0156] The data merging unit 123 is used to perform data merging processing on the first plugin list information data and the second plugin list information data to obtain the target plugin list information data.
[0157] Optionally, the compilation verification unit 121 is used for:
[0158] Identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data. Based on the identifier data, identifier duplication checks are performed on the independent plugin, the shared repository plugin, and the host to obtain the identifier duplication check result; and / or,
[0159] Resource name data is obtained based on the first plugin manifest information data and the second plugin manifest information data. Resource name conflict checks are then performed on the independent plugin, the shared repository plugin, and the host based on the resource name data to obtain the resource conflict check result; and / or,
[0160] Based on the second plugin manifest information data, the plugin version and host version are determined. Based on the plugin version and the host version, the library plugin version of the shared repository plugin and the host is verified to obtain the version verification result.
[0161] Optionally, the compilation verification unit 121 is used for:
[0162] If at least one of the identifier duplication check result, the resource conflict check result, and the version check result is a check failure type, then the compilation process is stopped.
[0163] If the identifier duplication check result, the resource conflict check result, and the version check result are all of the type of successful check, then the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed.
[0164] Optionally, configuration update unit 122 is used for:
[0165] Based on the first plugin list information data, obtain the independent plugin list of the independent plugin, and determine the processing information for the independent plugin;
[0166] Based on the processing information, the list of independent plugins is updated to obtain the processed first plugin list information data.
[0167] Optionally, the device 1 is further configured to:
[0168] Obtain a standalone plugin for the host, compile the standalone plugin to obtain a standalone plugin program executable file, and use a preset compilation service to set the plugin manifest information data of the standalone plugin to obtain first plugin manifest information data, and upload the first plugin manifest information data to a cloud server; or,
[0169] Obtain independent plugins and shared repository plugins for the host, compile the independent plugins to obtain independent plugin program executable files and compile the shared repository plugins to obtain shared repository plugin program executable files, and use a preset compilation service to set plugin manifest information data for the independent plugins to obtain first plugin manifest information data and set plugin manifest information data for the shared repository plugins to obtain second plugin manifest information data, upload the first plugin manifest information data to a cloud server, and store the second plugin manifest information data based on the cloud server and / or local storage space;
[0170] The process involves determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and compiling and integrating the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host, including:
[0171] The steps involve using a preset compilation service to execute the process of determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and performing compilation and integration processing on the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host.
[0172] It should be noted that the compilation processing apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when executing the compilation processing method. In practical applications, the above 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. In addition, the compilation processing apparatus and the compilation processing method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.
[0173] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0174] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figures 1-5 The compilation process described in the illustrated embodiment can be found in the following documentation for a detailed execution process. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0175] This application also provides a computer program product storing at least one instruction, which is loaded and executed by the processor as described above. Figures 1-5 The compilation process described in the illustrated embodiment can be found in the following documentation for a detailed execution process. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0176] Please refer to Figure 9 This diagram illustrates a structural block diagram of an electronic device provided in an exemplary embodiment of this application. The electronic device in this application may include one or more components such as a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected via the bus 150.
[0177] Processor 110 may include one or more processing cores. Processor 110 connects to various parts of the electronic device using various interfaces and lines, and performs various functions and processes data of electronic device 100 by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). Processor 110 may integrate one or more of the following: central processing unit (CPU), graphics processing unit (GPU), and modem. The CPU mainly handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem is used for wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately through a communication chip.
[0178] The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 may include a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described below, etc. The operating system may be the Android system, including systems deeply developed based on the Android system, the iOS system developed by Apple Inc., including systems deeply developed based on the iOS system, or other systems. The data storage area may also store data created by the electronic device during use, such as phonebook data, audio and video data, chat log data, etc.
[0179] See Figure 10 As shown, the memory 120 can be divided into operating system space and user space. The operating system runs in the operating system space, while native and third-party applications run in the user space. To ensure that different third-party applications can achieve good running performance, the operating system allocates corresponding system resources for each application. However, different application scenarios within the same third-party application have different requirements for system resources. For example, in local resource loading scenarios, third-party applications have high requirements for disk read speed; in animation rendering scenarios, third-party applications have high requirements for GPU performance. Since the operating system and third-party applications are independent of each other, the operating system often cannot promptly perceive the current application scenario of a third-party application, resulting in the operating system's inability to adapt system resources accordingly to the specific application scenario of the third-party application.
[0180] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating system. This would allow the operating system to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.
[0181] Taking the Android operating system as an example, the programs and data stored in memory 120 are as follows: Figure 11As shown, the memory 120 can store the Linux kernel layer 320, the system runtime library layer 340, the application framework layer 360, and the application layer 380. The Linux kernel layer 320, system runtime library layer 340, and application framework layer 360 belong to the operating system space, while the application layer 380 belongs to the user space. The Linux kernel layer 320 provides low-level drivers for various hardware components of the electronic device, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, and power management. The system runtime library layer 340 provides support for key features of the Android system through several C / C++ libraries. For example, the SQLite library provides database support, the OpenGL / ES library provides 3D graphics support, and the Webkit library provides browser kernel support. The system runtime library layer 340 also provides the Android runtime library, which mainly provides core libraries that allow developers to write Android applications using the Java language. The Application Framework Layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. At least one application runs in the Application Layer 380. These applications can be native applications that come with the operating system, such as contacts, SMS, clock, and camera apps; or third-party applications developed by third-party developers, such as games, instant messaging, and photo editing apps.
[0182] Taking the operating system as an example (iOS), the programs and data stored in memory 120 are as follows: Figure 12As shown, the iOS system includes: Core OS layer 420, Core Services layer 440, Media layer 460, and Cocoa Touch layer 480. Core OS layer 420 includes the operating system kernel, drivers, and low-level program frameworks. These low-level program frameworks provide hardware-level functionality for use by the program frameworks located in Core Services layer 440. Core Services layer 440 provides system services and / or program frameworks required by applications, such as Foundation framework, account framework, advertising framework, data storage framework, network connectivity framework, geolocation framework, motion framework, etc. Media layer 460 provides applications with audiovisual interfaces, such as interfaces related to graphics and images, audio technology, video technology, and AirPlay (wireless playback of audio and video transmission technologies). Cocoa Touch layer 480 provides various commonly used interface-related frameworks for application development and is responsible for user touch interaction on electronic devices. Examples include local notification services, remote push services, advertising frameworks, game tool frameworks, message user interface (UI) frameworks, UIKit frameworks, map frameworks, and so on.
[0183] exist Figure 12 The framework shown includes, but is not limited to, the base framework in the core service layer 440 and the UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, offering the most basic system services to all applications, and is independent of the UI. The UIKit framework, on the other hand, provides a basic UI class library for creating touch-based user interfaces. iOS applications can use the UIKit framework to provide their UI, thus providing the application's infrastructure for building user interfaces, drawing, handling user interaction events, responding to gestures, and so on.
[0184] The methods and principles for implementing data communication between third-party applications and the operating system in the iOS system can be referenced from the Android system, and will not be elaborated here.
[0185] The input device 130 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 140 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined into a touch screen, which is used to receive touch operations from the user using a finger, stylus, or any suitable object on or near it, and to display the user interface of various applications. The touch screen is usually located on the front panel of the electronic device. The touch screen can be designed as a full-screen, curved screen, or irregularly shaped screen. The touch screen can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; this embodiment of the application does not limit this.
[0186] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.
[0187] In the embodiments of this application, the executing entity for each step can be the electronic device described above. Optionally, the executing entity for each step is the operating system of the electronic device. The operating system can be Android, iOS, or other operating systems; this embodiment of the application does not limit this.
[0188] The electronic device in this embodiment may also be equipped with a display device, which can be various devices capable of display functions, such as: cathode ray tube display (CR), light-emitting diode display (LED), electronic ink screen, liquid crystal display (LCD), plasma display panel (PDP), etc. Users can use the display device on the electronic device 101 to view displayed text, images, videos, and other information. The electronic device may be a smartphone, tablet computer, gaming device, AR (Augmented Reality) device, automobile, data storage device, audio playback device, video playback device, laptop, desktop computing device, wearable device such as electronic watch, electronic glasses, electronic helmet, electronic bracelet, electronic necklace, electronic clothing, etc.
[0189] exist Figure 9 In the illustrated electronic device, which can be a terminal, the processor 110 can be used to call the application stored in the memory 120 and specifically perform the following operations:
[0190] Identify at least one dependent plugin for the host, obtain at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host;
[0191] The plugin manifest information data of the dependent plugins is validated and merged to obtain the target plugin manifest information data;
[0192] Based on the target plugin manifest information, the dependent plugins are compiled and integrated to obtain the program executable file for the host.
[0193] In one embodiment, the processor 110, when executing the process of determining at least one dependent plugin for the host and obtaining at least one plugin manifest information data for the dependent plugin, performs the following steps:
[0194] Obtain at least one dependent plugin for the host, and determine the plugin type of the dependent plugin;
[0195] Based on the plugin type of the dependent plugin, at least one plugin manifest information data for the dependent plugin is obtained from the cloud server.
[0196] In one embodiment, when the processor 110 executes the plugin type based on the dependent plugin, it obtains at least one plugin manifest information data for the dependent plugin from the cloud server and performs the following steps:
[0197] If the plugin type is an independent plugin type, then at least one first plugin manifest information data for the independent plugin is obtained from the cloud server;
[0198] If the plugin type is a shared repository plugin type, then at least one second plugin manifest information data for the shared repository plugin is obtained from the cloud server or local storage space, wherein the shared repository plugin code of the shared repository plugin and the host code of the host belong to the same code repository.
[0199] In one embodiment, the dependent plugins include independent plugins and shared repository plugins. The plugin manifest information data includes first plugin manifest information data for the independent plugins and second plugin manifest information data for the shared repository plugins. The processor 110 performs the following steps after executing the verification and merging process of the plugin manifest information data of the dependent plugins to obtain target plugin manifest information data:
[0200] Compilation verification is performed based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result;
[0201] Based on the compilation verification results, the first plugin manifest information data of the independent plugin is updated with manifest configuration to obtain the processed first plugin manifest information data.
[0202] The first plugin list information data and the second plugin list information data are merged to obtain the target plugin list information data.
[0203] In one embodiment, the processor 110 performs the following steps after executing the compilation verification based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result:
[0204] Identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data. Based on the identifier data, identifier duplication checks are performed on the independent plugin, the shared repository plugin, and the host to obtain the identifier duplication check result; and / or,
[0205] Resource name data is obtained based on the first plugin manifest information data and the second plugin manifest information data. Resource name conflict checks are then performed on the independent plugin, the shared repository plugin, and the host based on the resource name data to obtain the resource conflict check result; and / or,
[0206] Based on the second plugin manifest information data, the plugin version and host version are determined. Based on the plugin version and the host version, the library plugin version of the shared repository plugin and the host is verified to obtain the version verification result.
[0207] In one embodiment, the processor 110 performs the manifest configuration update process on the first plugin manifest information data of the independent plugin based on the compilation verification result, and obtains the processed first plugin manifest information data, and then performs the following steps:
[0208] If at least one of the identifier duplication check result, the resource conflict check result, and the version check result is a check failure type, then the compilation process is stopped.
[0209] If the identifier duplication check result, the resource conflict check result, and the version check result are all of the type of successful check, then the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed.
[0210] In one embodiment, the processor 110, after performing the manifest configuration update processing on the first plugin manifest information data of the independent plugin to obtain the processed first plugin manifest information data, performs the following steps:
[0211] Based on the first plugin list information data, obtain the independent plugin list of the independent plugin, and determine the processing information for the independent plugin;
[0212] Based on the processing information, the list of independent plugins is updated to obtain the processed first plugin list information data.
[0213] In one embodiment, before executing the process of determining at least one dependent plugin for the host, the processor 110 further performs the following steps:
[0214] Obtain a standalone plugin for the host, compile the standalone plugin to obtain a standalone plugin program executable file, and use a preset compilation service to set the plugin manifest information data of the standalone plugin to obtain first plugin manifest information data, and upload the first plugin manifest information data to a cloud server; or,
[0215] Obtain independent plugins and shared repository plugins for the host, compile the independent plugins to obtain independent plugin program executable files and compile the shared repository plugins to obtain shared repository plugin program executable files, and use a preset compilation service to set plugin manifest information data for the independent plugins to obtain first plugin manifest information data and set plugin manifest information data for the shared repository plugins to obtain second plugin manifest information data, upload the first plugin manifest information data to a cloud server, and store the second plugin manifest information data based on the cloud server and / or local storage space;
[0216] The process involves determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and compiling and integrating the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host, including:
[0217] The steps involve using a preset compilation service to execute the process of determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and performing compilation and integration processing on the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host.
[0218] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.
[0219] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A compilation processing method, characterized in that, The method includes: Identify at least one dependent plugin for the host, obtain at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host; The plugin manifest information data of the dependent plugins is validated and merged to obtain the target plugin manifest information data; Based on the target plugin manifest information, the dependent plugins are compiled and integrated to obtain the program executable file for the host. The dependent plugins include independent plugins and shared storage plugins. The plugin list information data includes first plugin list information data for the independent plugins and second plugin list information data for the shared storage plugins. The process of verifying and merging the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data includes: Compilation verification is performed based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result. Based on the compilation verification result, the manifest configuration of the first plugin manifest information data of the independent plugin is updated to obtain the processed first plugin manifest information data. The first plugin manifest information data and the second plugin manifest information data are merged to obtain the target plugin manifest information data.
2. The method according to claim 1, characterized in that, The step of determining at least one dependent plugin for the host and obtaining at least one plugin manifest information data for the dependent plugin includes: Obtain at least one dependent plugin for the host, and determine the plugin type of the dependent plugin; Based on the plugin type of the dependent plugin, at least one plugin manifest information data for the dependent plugin is obtained from the cloud server.
3. The method according to claim 2, characterized in that, The step of obtaining at least one plugin manifest information data for the dependent plugin from the cloud server based on the plugin type of the dependent plugin includes: If the plugin type is an independent plugin type, then at least one first plugin manifest information data for the independent plugin is obtained from the cloud server; If the plugin type is a shared repository plugin type, then at least one second plugin manifest information data for the shared repository plugin is obtained from the cloud server or local storage space, wherein the shared repository plugin code of the shared repository plugin and the host code of the host belong to the same code repository.
4. The method according to claim 1, characterized in that, The compilation verification based on the first plugin manifest information data and the second plugin manifest information data, to obtain the compilation verification result, includes: Identifier data is obtained from the first plugin manifest information data and the second plugin manifest information data. Based on the identifier data, identifier duplication checks are performed on the independent plugin, the shared repository plugin, and the host to obtain the identifier duplication check result; and / or, Resource name data is obtained based on the first plugin manifest information data and the second plugin manifest information data. Resource name conflict checks are then performed on the independent plugin, the shared repository plugin, and the host based on the resource name data to obtain the resource conflict check result; and / or, Based on the second plugin manifest information data, the plugin version and host version are determined. Based on the plugin version and the host version, the library plugin version of the shared repository plugin and the host is verified to obtain the version verification result.
5. The method according to claim 4, characterized in that, The process of updating the manifest information data of the independent plugin based on the compilation verification results to obtain the processed first plugin manifest information data includes: If at least one of the identifier duplication check result, the resource conflict check result, and the version check result is a check failure type, then the compilation process is stopped. If the identifier duplication check result, the resource conflict check result, and the version check result are all of the type of successful check, then the step of merging the first plugin manifest information data and the second plugin manifest information data to obtain the target plugin manifest information data is executed.
6. The method according to claim 1, characterized in that, The process of updating the first plugin manifest information data of the independent plugin to obtain the processed first plugin manifest information data includes: Based on the first plugin list information data, obtain the independent plugin list of the independent plugin, and determine the processing information for the independent plugin; Based on the processing information, the list of independent plugins is updated to obtain the processed first plugin list information data.
7. The method according to any one of claims 1-6, characterized in that, Before determining at least one dependent plugin for the host, the method further includes: Obtain a standalone plugin for the host, compile the standalone plugin to obtain a standalone plugin program executable file, and use a preset compilation service to set the plugin manifest information data of the standalone plugin to obtain first plugin manifest information data, and upload the first plugin manifest information data to a cloud server; or, Obtain independent plugins and shared repository plugins for the host, compile the independent plugins to obtain independent plugin program executable files and compile the shared repository plugins to obtain shared repository plugin program executable files, and use a preset compilation service to set plugin manifest information data for the independent plugins to obtain first plugin manifest information data and set plugin manifest information data for the shared repository plugins to obtain second plugin manifest information data, upload the first plugin manifest information data to a cloud server, and store the second plugin manifest information data based on the cloud server and / or local storage space; The process involves determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and compiling and integrating the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host, including: The steps involve using a preset compilation service to execute the process of determining at least one dependent plugin for the host, obtaining at least one plugin manifest information data for the dependent plugin, performing verification and merging processing on the plugin manifest information data of the dependent plugin to obtain target plugin manifest information data, and performing compilation and integration processing on the dependent plugin based on the target plugin manifest information data to obtain a program executable file for the host.
8. A compilation processing apparatus, characterized in that, The device includes: The data acquisition module is used to identify at least one dependent plugin for the host, and to acquire at least one plugin manifest information data for the dependent plugin, wherein at least one independent plugin code in the dependent plugin does not belong to the same code repository as the host code of the host. The data processing module is used to perform verification and merging processing on the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data; The file integration module is used to compile and integrate the dependent plugins based on the target plugin manifest information data to obtain the program runtime file for the host. The dependent plugins include independent plugins and shared storage plugins. The plugin list information data includes first plugin list information data for the independent plugins and second plugin list information data for the shared storage plugins. The process of verifying and merging the plugin manifest information data of the dependent plugins to obtain the target plugin manifest information data includes: Compilation verification is performed based on the first plugin manifest information data and the second plugin manifest information data to obtain the compilation verification result. Based on the compilation verification result, the manifest configuration of the first plugin manifest information data of the independent plugin is updated to obtain the processed first plugin manifest information data. The first plugin manifest information data and the second plugin manifest information data are merged to obtain the target plugin manifest information data.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as method steps as claimed in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 7.