Code Compilation Method, Apparatus, Electronic Device, and Readable Storage Medium

By pre-compiling non-change code modules, and reusing these files at compile time, the slow compilation speed caused by the large number of code modules in the client program code is solved, and development efficiency is improved.

CN117648088BActive Publication Date: 2025-06-17BEIJING DUYOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311579146.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-06-17
Estimated Expiration
2043-11-23

AI Technical Summary

Technical Problem

There are many code modules in the client program code, which leads to slow compilation speed and affects development efficiency.

Method used

AAR files are generated by pre-compiling non-change code modules, and upon receiving a compilation request, the current user's non-change code module group is determined, and the compilation results of the code project are determined based on these AAR files to avoid duplicate compilation.

Benefits of technology

Reduces compilation time and improves code development efficiency. By reusing precompiled AAR files, repeated duplicate compilation of unchanged modules is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117648088B_ABST
    Figure CN117648088B_ABST
Patent Text Reader

Abstract

The present disclosure provides a code compilation method, apparatus, electronic device, and readable storage medium, which relate to the field of computers, and particularly to technical fields such as application development and code project management. The specific implementation solution is as follows: in response to receiving a compilation request for a code project, determine a non-changed code module group corresponding to the current user, where the non-changed code module group includes at least one non-changed code module, and the non-changed code module is pre-compiled to obtain an Android Archive (AAR) file; determine the compilation result of the code project based on the AAR file of the non-changed code module. In this solution, the non-changed code module with a relatively low possibility of change currently is pre-compiled, and the current compilation process is implemented by using the AAR file obtained by pre-compiling the non-changed code module, so as to avoid repeated compilation of the non-changed code module, reduce the compilation time, and improve the code development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and in particular to technical fields such as application development and code project management. Specifically, the present disclosure relates to a code compilation method, apparatus, electronic device, and readable storage medium. Background Art

[0002] With the rapid development of computer technologies, the functions implemented by client programs are increasing, which results in a large number of code modules included in the client program code.

[0003] The large number of code modules in the client program code makes the code compilation speed slow during the development of the client program code. Summary of the Invention

[0004] The present disclosure provides a code compilation method, apparatus, electronic device, and readable storage medium to solve at least one of the above defects.

[0005] According to a first aspect of the present disclosure, a code compilation method is provided. The method includes:

[0006] In response to receiving a compilation request for a code project, determining a non-change code module group corresponding to the current user, the non-change code module group including at least one non-change code module, and the non-change code module being pre-compiled to obtain an Android Archive (AAR) file;

[0007] Determining the compilation result of the code project based on the AAR file of the non-change code module.

[0008] According to a second aspect of the present disclosure, a code compilation apparatus is provided. The apparatus includes:

[0009] A pre-compilation result determination module, configured to determine a non-change code module group corresponding to the current user in response to receiving a compilation request for a code project, the non-change code module group including at least one non-change code module, and the non-change code module being pre-compiled to obtain an AAR file;

[0010] A compilation processing module, configured to determine the compilation result of the code project based on the AAR file of the non-change code module.

[0011] According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes:

[0012] At least one processor; and

[0013] A memory communicatively connected to the at least one processor; wherein,

[0014] The memory stores instructions that can be executed by the at least one processor described above. When the instructions are executed by the at least one processor, the at least one processor is enabled to execute the above code compilation method.

[0015] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the above code compilation method.

[0016] According to a fifth aspect of the present disclosure, there is provided a computer program product including a computer program that implements the above code compilation method when executed by a processor.

[0017] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. Description of the Drawings

[0018] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0019] Figure 1 is a schematic flowchart of a code compilation method provided by an embodiment of the present disclosure;

[0020] Figure 2 is a schematic flowchart of an alternative implementation of the code compilation method provided by an embodiment of the present disclosure.

[0021] Figure 3 is a schematic structural diagram of the code for implementing the code compilation method provided by an embodiment of the present disclosure.

[0022] Figure 4 is a schematic structural diagram of a code compilation device provided by an embodiment of the present disclosure;

[0023] Figure 5 is a block diagram of an electronic device for implementing the code compilation method of an embodiment of the present disclosure. Detailed Embodiments

[0024] The following describes exemplary embodiments of the present disclosure in conjunction with the drawings. Various details of the embodiments of the present disclosure are included to assist understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] First, several terms related to this application are introduced and explained:

[0026] An Android Archive (AAR) file is a binary archive file of an Android library project. It is the product of compiling a code module and can be used to package an Android application package (APK).

[0027] Code compilation is the process of generating an APK from Android code, which can be understood as the process of converting code into an installation package.

[0028] Dependency refers to the relationship that a code module needs to depend on other code modules to work. When code modules with a dependency relationship are compiled, the dependent code module needs to be compiled first to provide the compilation result for use by the code module that depends on it during compilation.

[0029] There are a large number of code modules in the client program code, which makes the overall compilation of the client program code time-consuming and affects the code development efficiency.

[0030] The code modules in the client program code generally involve multiple business directions. Developers in a single business direction generally only involve changes to some code modules during code development, and the changed code is generally related to the business direction to which it belongs. In the related art, when compiling code, all code modules need to be compiled as a whole, resulting in a long compilation time.

[0031] If it is possible to avoid repeated compilation of unchanged modules and only compile the code modules that actually change, then it is possible to avoid compiling all code modules as a whole, reduce the compilation time, and improve the code development efficiency.

[0032] The code compilation method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present disclosure aim to solve at least one of the above technical problems in the prior art.

[0033] Figure 1 The flowchart of a code compilation method provided by an embodiment of the present disclosure is shown, as Figure 1 shown in, this method mainly may include:

[0034] Step S110: In response to receiving a compilation request for a code project, determine a group of non-changed code modules corresponding to the current user. The group of non-changed code modules includes at least one non-changed code module, and the non-changed code module is pre-compiled to obtain an AAR file;

[0035] Step S120: Determine the compilation result of the code project based on the AAR file of the group of non-changed code modules.

[0036] Among them, the code project can be the general term for the program code corresponding to the application currently being developed. The code project consists of multiple code modules. The code module can be obtained by encapsulating the code that implements a specific function.

[0037] The non-change code group is a module group composed of at least one non-change code module. The non-change code module is a code module that has been pre-analyzed and that the current user generally will not perform change operations on. The non-change code module is pre-compiled into an AAR file and can be persistently stored for reuse during compilation.

[0038] As an example, the AAR file of the non-change code module can be obtained from the historical compilation results obtained from the historical compilation process, or the non-change code module can be pre-compiled when compilation processing is required to obtain the AAR file of the non-change code module.

[0039] Determining the compilation result of the code project based on the non-change code module group can effectively reuse the AAR file of the non-change code module, avoid repeated compilation of the non-change code module, and reduce the number of code modules to be compiled during the compilation process.

[0040] In the embodiments of the present disclosure, after obtaining the editing result of the code project, the APK corresponding to the code project can be assembled based on the editing result.

[0041] The method provided in the embodiments of the present disclosure determines the non-change code module group corresponding to the current user by responding to a compilation request for the code project. The non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file; the compilation result of the code project is determined based on the non-change code module group. In this solution, the non-change code module with a relatively low possibility of change currently is pre-compiled, and the current compilation process is implemented by using the AAR file obtained by pre-compiling the non-change code module, avoiding repeated compilation of the non-change code module, reducing the compilation time, and improving the code development efficiency.

[0042] In the embodiments of the present disclosure, after analyzing the non-change code modules that the user generally will not perform change operations on, all non-change code modules are uniformly managed in the form of a non-change code module group, and the corresponding relationship between the non-change code module group and the user is established, so that when a certain user performs code development, the non-change code module group corresponding to the user can be quickly determined, that is, all the non-change code modules of the user are quickly determined, thereby facilitating the implementation of the subsequent compilation process based on the non-change code module group.

[0043] In the embodiments of the present disclosure, while managing non-change code modules in the form of a non-change code module group, the ARR files of all non-change code modules within the non-change code module group can also be uniformly managed. For example, the ARR files of all non-change code modules are packaged to obtain a total ARR file package, which corresponds to the non-change code module group, facilitating the acquisition of the ARR files of all non-change code modules in the form of directly obtaining the ARR file package, rather than separately obtaining the corresponding ARR files for non-change code modules.

[0044] As an example, the change code module group can be stored in a configuration file in the form of a module identifier list, and the corresponding relationship between the configuration file and the user is established. When the current user needs to perform a code compilation operation, the configuration file corresponding to the current user can be determined based on the corresponding relationship between the configuration file and the user, and the configuration file corresponding to the current user is parsed to obtain the non-change code module group corresponding to the current user.

[0045] As an example, the configuration file can also associatively store the file path of the AAR file of the change code module group with the module identifier of the change code module group, so as to obtain the AAR file of the change code module group based on the file path.

[0046] In an alternative manner of the present disclosure, determining the compilation result of a code project based on the AAR file of a non-change code module includes:

[0047] Determine the current change code module in the code project;

[0048] Determine the consistency between the current unchanged code modules in the code project except the current change code module and the non-change code modules in the non-change code module group;

[0049] Based on the consistency between the current unchanged code modules and the non-change code modules in the non-change code module group, determine the compilation result of the code project.

[0050] Among them, the current change code module is a code module that has changed in the current development process. The current change code module needs to be recompiled. The current unchanged code module is a code module other than the current change code module among all the code modules of the code project.

[0051] In the embodiments of the present disclosure, the non-change code module group is determined by a pre-analysis method. Before performing a compilation operation, the non-change code module group can be compared with the current unchanged code modules to determine whether they are consistent.

[0052] When the current unchanged code module is consistent with the unchanged code modules within the group of unchanged code modules, it indicates that the changes made by the current user to the code module are consistent with the pre-analyzed ones, that is, no changes have been made to the unchanged code modules. At this time, all the code modules that have actually not changed in the current development process (i.e., the current changed code modules) belong to the group of unchanged code modules, and these code modules that have actually not changed have been pre-compiled to obtain AAR files, so that these AAR files can be reused for the compilation process to improve the compilation speed.

[0053] When the current unchanged code module is inconsistent with the unchanged code modules within the group of unchanged code modules, it indicates that the current user has not changed the code module according to the pre-analyzed situation. At this time, the code modules that have actually not changed in the current development process (i.e., the current changed code modules) are inconsistent with the unchanged code modules, so the AAR files of the unchanged code modules cannot be directly reused.

[0054] In an optional manner of the present disclosure, based on the consistency between the current unchanged code module and the unchanged code modules within the group of unchanged code modules, the compilation result of the code project is determined, including:

[0055] In response to the current unchanged code module being consistent with the unchanged code modules within the group of unchanged code modules, based on the AAR files of the unchanged code modules, the compilation result of the code project is generated.

[0056] In the embodiments of the present disclosure, when the current unchanged code module is consistent with the unchanged code modules within the group of unchanged code modules, all the code modules that have actually not changed have been pre-compiled to obtain AAR files, so that these pre-compiled AAR files can be obtained. By reusing the pre-compiled AAR files, the compilation speed is improved and the development efficiency is enhanced.

[0057] In an optional manner of the present disclosure, based on the AAR files of the unchanged code modules, the compilation result of the code project is generated, including:

[0058] Obtain the compilation order of each code module in the code project;

[0059] Based on the compilation order, corresponding processing is performed on each code module respectively to obtain the compilation result of the code project;

[0060] Among them, based on the compilation order, corresponding processing is performed on each code module respectively, including:

[0061] Determine the target code module to be compiled currently based on the compilation order;

[0062] In response to the target code module being the current changed code module, perform compilation processing on the current changed code module to obtain the AAR file of the current changed code module;

[0063] In response to the target code module being a non-changed code module, obtain the AAR file of the pre-compiled non-changed code module.

[0064] In the embodiments of the present disclosure, each code module will have a certain compilation order during compilation, and this compilation order is generally determined based on the dependency relationship. Processing each code module accordingly in accordance with this compilation order and directly processing all the code modules in the code project can obtain the compilation result of the code project.

[0065] The currently to-be-compiled code module can be denoted as the target code module. If the target code module is the currently changed code module, that is, the currently to-be-compiled module is the code module that has changed during the current development process, then the currently changed code module can be recompiled to obtain the AAR file of the currently changed code module.

[0066] If the target code module is a non-changed code module, that is, the currently to-be-compiled module is the code module that has not changed during the current development process, then the ARR file of the non-changed code module can be directly obtained as the compilation result, that is, the reuse of the pre-compiled ARR file is realized, and there is no need to recompile the non-changed code module, effectively improving the compilation speed.

[0067] In the embodiments of the present disclosure, by reusing the ARR file of the non-changed code module, the repeated compilation of the currently unchanged module is avoided, and only the code modules that actually have changes are compiled, avoiding the overall compilation of all code modules, reducing the compilation time, and improving the code development efficiency.

[0068] In an alternative embodiment of the present disclosure, the compilation order is determined based on the dependency relationship between the code modules in the code project. The dependency relationship includes the default file path of the AAR file of the non-changed module in the code project, and the AAR file of the non-changed code module is stored outside the code project. The method further includes:

[0069] Modify the default file path in the dependency relationship to the actual file path of the AAR file of the non-changed code module, and the actual file path is used to obtain the AAR file of the non-changed code module.

[0070] In the embodiments of the present disclosure, if there is a dependency relationship between code modules, one code module needs to depend on the compilation results of several other code modules during compilation. Therefore, the dependent code modules need to be compiled first. By analyzing the dependency relationship between the code modules in the code project, the compilation order of each code module can be determined.

[0071] In the embodiments of the present disclosure, the dependency relationship generally includes the file path of the compilation result of the dependent module. By default, the compilation result of the non-changed module is stored within the code project, and the dependency relationship includes the default file path of the AAR file of the non-changed module within the code project.

[0072] In the embodiments of the present disclosure, since the AAR file of the non-changed module is persistently stored outside the code project, it is necessary to modify the default file path in the dependency relationship to the actual file path of the AAR file of the non-changed code module.

[0073] In an alternative embodiment of the present disclosure, the AAR file of the non-changed code module is stored in the Maven repository.

[0074] Maven is a tool software for code project management. In Maven, a Maven repository can be provided either in the cloud or locally. The AAR file of the non-changed code module can be stored in the Maven repository, facilitating the management and invocation of the AAR file.

[0075] In an alternative embodiment of the present disclosure, the non-changed code module group corresponding to the current user and the actual file path of the AAR file of the non-changed code module are both stored in the configuration file corresponding to the current user.

[0076] In the embodiments of the present disclosure, a configuration file corresponding to the user can be provided. The configuration file stores the module identifier list of the non-changed code modules within the non-changed code module group, as well as the file path of the AAR file of the changed code module group.

[0077] The corresponding configuration file can be obtained based on the identity information of the current user, and the configuration file can be parsed to obtain the module identifier list of the changed code module and the AAR file of the changed code module.

[0078] As an example, the changed code module group can be stored in the configuration file in the form of a module identifier list, and the corresponding relationship between the configuration file and the user is established. When the current user needs to perform a code compilation operation, the configuration file corresponding to the current user can be determined based on the corresponding relationship between the configuration file and the user, and the configuration file corresponding to the current user can be parsed to obtain the non-changed code module group corresponding to the current user.

[0079] In an alternative embodiment of the present disclosure, determining the compilation result of the code project based on the consistency between the current unchanged code module and the non-changed code modules within the non-changed code module group includes:

[0080] In response to the current unchanged code module being inconsistent with the non-changed code modules within the non-changed code module group, perform any one of the following:

[0081] Compile all code modules within the code project to obtain the compilation result of the code project;

[0082] Based on the differences between the currently unchanged code modules and the unchanged code modules within the group of unchanged code modules, update the unchanged code modules within the group of unchanged code modules, and update the AAR file corresponding to the group of unchanged code modules. Based on the updated group of unchanged code modules and the AAR file corresponding to the updated unchanged code modules, determine the compilation result of the code project.

[0083] In the embodiments of the present disclosure, when the currently unchanged code modules are inconsistent with the unchanged code modules within the group of unchanged code modules, it indicates that the current user has not changed the code modules according to the pre-analyzed situation. At this time, the code modules that have not actually changed in the current development process (i.e., the currently changed code modules) are inconsistent with the unchanged code modules, so the AAR file of the unchanged code modules cannot be directly reused. Therefore, during the compilation process, all code modules within the code project can be directly compiled to obtain the compilation result of the code project.

[0084] In the embodiments of the present disclosure, it is also possible to update the unchanged code modules within the group of unchanged code modules and update the AAR file corresponding to the group of unchanged code modules based on the differences between the currently unchanged code modules and the unchanged code modules within the group of unchanged code modules. Among them, updating the unchanged code modules within the group of unchanged code modules means updating the currently unchanged code modules to the unchanged code modules within the group of unchanged code modules.

[0085] Updating the AAR file corresponding to the group of unchanged code modules means adding or deleting the AAR file of the pre-compiled unchanged code modules, so that the AAR file corresponding to the group of unchanged code modules is updated to the AAR file corresponding to the currently unchanged code modules.

[0086] After updating the unchanged code modules within the group of unchanged code modules and updating the AAR file corresponding to the group of unchanged code modules, the code project can be compiled based on the AAR file corresponding to the updated unchanged code modules. The specific process can refer to the process of generating the compilation result of the code project based on the AAR file of the unchanged code modules when the currently unchanged code modules are consistent with the unchanged code modules within the group of unchanged code modules.

[0087] In an alternative embodiment of the present disclosure, determining the group of unchanged code modules corresponding to the current user includes:

[0088] Obtain the code module change situation corresponding to the current user;

[0089] A code module whose code module change situation meets a preset condition is determined as a non-changed code module within the non-changed code module group.

[0090] In an embodiment of the present disclosure, the code module change situation corresponding to the current user, that is, the code module change situation generated by the code module change operation of the current user. The code module change situation may specifically include the change frequency of the code module and / or the change time of the code module.

[0091] The commit history of the code by the current user can be obtained from the version control tool Git, so as to obtain the code module change situation.

[0092] As an example, a code module that the user has not performed a change operation on historically can be used as a non-changed code module.

[0093] In an embodiment of the present disclosure, to ensure the rationality of the non-changed code module, a preset condition can be set. The preset condition may be that the change frequency of the code module is not higher than a preset frequency threshold, and / or the change time of the code module is not earlier than a preset moment.

[0094] When the preset condition is set to that the change frequency of the code module is not higher than a preset frequency threshold, it means that the determined non-changed code module has a relatively low change frequency. When the preset condition is set to that the change time of the code module is not earlier than a preset moment, it means that the determined non-changed code module has not changed recently.

[0095] In an alternative embodiment of the present disclosure, determining the non-changed code module group corresponding to the current user includes:

[0096] Determine the user group to which the current user belongs. The user group corresponds to at least one non-changed code module group, and the non-changed code module group corresponding to the user group is determined based on the code module change situations of all users within the user group;

[0097] Based on the non-changed code module group corresponding to the user group, determine the non-changed code module group corresponding to the current user.

[0098] In an embodiment of the present disclosure, the user group can be divided according to the actual situation. For example, users in the same business direction or the same department can be divided into the same user group.

[0099] The code module change situation corresponding to the user group is the code module change situation generated by the code module change operations of all users within the user group. Determining the non-changed code module group based on the code module change operation situations of all users within the user group can improve the accuracy of the analyzed non-changed code module group.

[0100] As an example, the commit history of all users in the user group for the code can be obtained from the version control tool Git, so as to obtain the change situation of the code module corresponding to the user group.

[0101] As an example, the code modules that all users in the user group have never changed in history can be used as non-changed code modules.

[0102] In the embodiments of the present disclosure, a user group may correspond to multiple non-changed code module groups, and the number of changed code modules included in the multiple non-changed code module groups is inconsistent.

[0103] For example, multiple frequency threshold ranges are set for the change frequency of the code module, and each frequency range corresponds to a non-changed code module group, so as to divide the code modules whose change frequencies belong to different frequency threshold ranges into different non-changed code module groups.

[0104] In an optional manner of the present disclosure, determining the non-changed code module group corresponding to the current user based on the non-changed code module group corresponding to the user group includes:

[0105] Determining the change frequency value of the current user based on the change operation situation of the current user for the code module;

[0106] Based on the preset correspondence between the change frequency value and the non-changed code module group, and based on the change frequency value of the current user, determining the non-changed code module group corresponding to the current user.

[0107] In the embodiments of the present disclosure, the change frequency value is used to represent the frequency of the current user's code module changes. The change frequency value can be determined based on the change operation situation of the code module.

[0108] As an example, the change frequency of the code module can be converted into a frequency sub-weight, the time sub-weight can be determined according to the early or late change time of the code module, and the change frequency value can be obtained by performing a weighted calculation on the frequency sub-weight and the time sub-weight.

[0109] The higher the change frequency value, the higher the frequency of the current user's code module changes, and the fewer the non-changed code modules involved. Correspondingly, the lower the change frequency value, the lower the frequency of the current user's code module changes, and the more the non-changed code modules involved.

[0110] User grouping can correspond to multiple non-change code module groups, and the number of change code modules included in the multiple non-change code module groups is inconsistent. A higher change frequency value can be associated with the module that includes fewer change code modules, and a lower change frequency value can be associated with the module that includes more change code modules. Thus, the current user with a higher change frequency value can correspond to the change code module group with fewer change code modules, and the current user with a lower change frequency value can correspond to the change code module group with more change code modules.

[0111] In an alternative embodiment of the present disclosure, the above method further includes:

[0112] In response to receiving a configuration request from the current user for the AAR file of the non-change code module, update the relevant information of the AAR file of the non-change code module based on the configuration parameters carried in the configuration request. The relevant information includes at least one of the following:

[0113] The storage address of the AAR file of the non-change code module;

[0114] The version number of the AAR file of the non-change code module.

[0115] In the embodiments of the present disclosure, the user can configure the storage address of the AAR file of the non-change code module and the version number of the AAR file of the non-change code module according to actual needs. The user can select the AAR file corresponding to different non-change code module groups for compilation processing according to the version number of the AAR file of the non-change code module.

[0116] Figure 2 It is a schematic flowchart of an alternative embodiment of the code compilation method provided by the present disclosure.

[0117] As Figure 2 shown, the modules involved in this process include: Business 210, Pre-compilation Service 220, Dependency Recognition Plug-in Service 230, and Dependency Switching Plug-in Service. This process specifically includes the following steps:

[0118] Step S251: Perform pre-compilation.

[0119] This step is to enter the code compilation process provided in this case.

[0120] Step S252: Call the plug-in.

[0121] This step is to encapsulate the specific steps in the code compilation process provided in this case into a plug-in, and complete the automatic execution of code compilation by calling the plug-in. The plug-in can integrate functions for analyzing non-change code modules and modifying dependency relationships.

[0122] Step S253: Identify identity, identify dependencies, and generate mappings.

[0123] This step is to call the logic of the non-change code module analysis plugin in the plugin. Specifically, the identity information of the user can be identified, and based on the user's identity information, the scope of the code modules on which the current user depends can be determined, that is, the scope of the code modules that the current user will perform change operations on, so as to determine the code modules that the current user generally will not perform change operations on, that is, the non-change code modules are determined. Then, a mapping relationship between the user and the non-change code modules can be established.

[0124] Step S254: Start pre-compilation according to the mapping.

[0125] Step S255: Generate the product AAR.

[0126] Steps S254 and S255 are to compile the non-change code modules, generate the AAR file of the non-change code modules, and persistently store it.

[0127] Step S256: Start the formal compilation.

[0128] This step is to start the formal compilation process during development.

[0129] Step S257: Dependency switching.

[0130] This step is to modify the default file path of the non-change module in the dependency relationship to the actual file path of the AAR file of the non-change code module, so as to realize the switch from project dependency to Maven dependency.

[0131] Step S258: Generate the final apk product.

[0132] This step is to reuse the AAR file of the non-change code module for compilation processing to obtain the compilation result, and generate the APK file based on the editing result.

[0133] Through the above process, the pre-compilation service can be used to analyze the non-change code modules corresponding to the user, and pre-compile the non-change code modules to obtain the AAR file of the non-change code modules. In the formal compilation process, the AAR file of the non-change code module generated by the pre-compilation service is reused for compilation to generate the APK file of the project, which can avoid repeated compilation of the non-change code modules, reduce the compilation time, and improve the code development efficiency.

[0134] Figure 3 It is a schematic structural diagram of the code for implementing the code compilation method provided by the present disclosure.

[0135] As shown in 3, in this case, the code structure can be divided into a business layer 32 for users, a pre-compilation layer 32 that performs pre-compilation processing, and a compilation layer 33 that performs compilation processing.

[0136] Among them, the business layer 31 includes the following modules: plugin configuration 311, product configuration 312, and instruction set 313. Among them, the plugin is obtained by encapsulating the code of specific steps in the code compilation process provided in this case. The plugin can be pre-configured with different version numbers, and the plugin configuration 311 is the version number of the plugin selected by the current user. The product configuration 312 is to configure the storage address and version number of the pre-compiled AAR file. The instruction set 313 is used to store the user's operation instructions.

[0137] The pre-compilation layer 32 includes the following modules: pre-compilation 321, compilation configuration 322, product management 323, and dependency recognition plugin 324. The pre-compilation 321 module is used to perform pre-compilation to generate an AAR file. The compilation configuration 322 module is used to read the storage address and version number of the AAR file configured by the user. The product management 323 module is used to store and manage the generated AAR file.

[0138] The dependency recognition plugin 324 includes the following modules: identity recognition 3241, dependency recognition 3242, dependency configuration 3243, and mapping generation 3244. Among them, the identity recognition 3214 module is used to recognize the user's identity. The dependency recognition 3242 module is used to determine the scope of the code modules on which the current user depends based on the user's identity information, that is, the scope of the code modules that the current user will perform change operations on, so as to determine the code modules that the current user generally will not perform change operations on, that is, the non-change code modules are determined. The dependency configuration 3243 module is used to manage the scope of the code modules on which the user depends. The mapping generation 3244 module is used to establish a mapping relationship between the user and the non-change code modules.

[0139] The compilation layer 33 includes the following modules: compilation 331, product generation 332, and dependency switching plugin 333. Among them, the compilation 331 module is to compile the currently changed module to obtain an AAR file, which is merged with the pre-compiled AAR file as the compilation result of the code project. The product generation 332 module is used to manage the generated APK file. The dependency switching plugin 333 includes the following modules: branch detection 3331 and dependency switching 3332. Among them, the dependency switching 3332 module is used to modify the default file path of the non-change module in the dependency relationship to the actual file path of the AAR file of the non-change code module, realizing the switch from project dependency to Maven dependency. The branch detection 3331 module is used to detect the dependency relationship.

[0140] Based on and Figure 1the same principle as the method shown in Figure 4 shows a schematic structural diagram of a code compilation device provided by an embodiment of the present disclosure, as Figure 4 shown, the code compilation device 40 may include:

[0141] A pre-compilation result determination module 410, configured to determine a non-change code module group corresponding to the current user in response to receiving a compilation request for a code project, the non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file;

[0142] A compilation processing module 420, configured to determine a compilation result of the code project based on the AAR file of the non-change code module.

[0143] The device provided by the embodiment of the present disclosure determines a non-change code module group corresponding to the current user in response to receiving a compilation request for a code project. The non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file; and determines a compilation result of the code project based on the non-change code module group. In this solution, non-change code modules with a relatively low probability of change are pre-compiled, and the current compilation process is implemented using the AAR files obtained by pre-compiling the non-change code modules, avoiding repeated compilation of non-change code modules, reducing compilation time, and improving code development efficiency.

[0144] Optionally, the compilation processing module is specifically configured to:

[0145] Determine the current changed code module in the code project;

[0146] Determine the consistency between the current unchanged code module in the code project except the current changed code module and the non-change code modules in the non-change code module group;

[0147] Based on the consistency between the current unchanged code module and the non-change code modules in the non-change code module group, determine a compilation result of the code project.

[0148] Optionally, when the compilation processing module determines a compilation result of the code project based on the consistency between the current unchanged code module and the non-change code modules in the non-change code module group, it is specifically configured to:

[0149] In response to the current unchanged code module being consistent with the non-change code modules in the non-change code module group, generate a compilation result of the code project based on the AAR file of the non-change code module.

[0150] Optionally, when the compilation processing module generates a compilation result of the code project based on the AAR file of the non-change code module, it is specifically configured to:

[0151] Obtain the compilation order of each code module within the code project;

[0152] Based on the compilation order, perform corresponding processing on each code module respectively to obtain the compilation result of the code project;

[0153] Among them, when the compilation processing module performs corresponding processing on each code module respectively based on the compilation order, it is specifically used for:

[0154] Determine the target code module to be compiled currently based on the compilation order;

[0155] In response to the target code module being the current changed code module, perform compilation processing on the current changed code module to obtain the AAR file of the current changed code module;

[0156] In response to the target code module being a non-changed code module, obtain the AAR file of the pre-compiled non-changed code module.

[0157] Optionally, the compilation order is determined based on the dependency relationship of each code module within the code project. The dependency relationship includes the default file path of the AAR file of the non-changed module in the code project. The AAR file of the non-changed code module is stored outside the code project. The device further includes:

[0158] Dependency relationship modification module, used to modify the default file path in the dependency relationship to the actual file path of the AAR file of the non-changed code module, and the actual file path is used to obtain the AAR file of the non-changed code module.

[0159] Optionally, the AAR file of the non-changed code module is stored in the Maven repository.

[0160] Optionally, the non-changed code module group corresponding to the current user and the actual file path of the AAR file of the non-changed code module are both stored in the configuration file corresponding to the current user.

[0161] Optionally, when the compilation processing module determines the compilation result of the code project based on the consistency between the current non-changed code module and the non-changed code modules within the non-changed code module group, it is specifically used for:

[0162] In response to the current non-changed code module being inconsistent with the non-changed code modules within the non-changed code module group, perform any one of the following:

[0163] Perform compilation processing on all code modules within the code project to obtain the compilation result of the code project;

[0164] Update the non-changed code modules within the non-changed code module group based on the differences between the currently unchanged code modules and the non-changed code modules within the non-changed code module group, and update the AAR file corresponding to the non-changed code module group. Based on the updated non-changed code module group and the AAR file corresponding to the updated non-changed code modules, determine the compilation result of the code project.

[0165] Optionally, when determining the non-changed code module group corresponding to the current user, the pre-compilation result determination module is specifically used for:

[0166] Obtain the change situation of the code modules corresponding to the current user;

[0167] Determine the code modules whose change situation of the code modules meets the preset conditions as the non-changed code modules within the non-changed code module group.

[0168] Optionally, the change situation of the code modules includes at least one of the following:

[0169] The change frequency of the code modules;

[0170] The change time of the code modules.

[0171] Optionally, when determining the non-changed code module group corresponding to the current user, the pre-compilation result determination module is specifically used for:

[0172] Determine the user group to which the current user belongs. There is at least one non-changed code module group corresponding to the user group, and the non-changed code module group corresponding to the user group is determined based on the change situation of the code modules corresponding to all users within the user group;

[0173] Based on the non-changed code module group corresponding to the user group, determine the non-changed code module group corresponding to the current user.

[0174] Optionally, when determining the non-changed code module group corresponding to the current user based on the non-changed code module group corresponding to the user group, the pre-compilation result determination module is specifically used for:

[0175] Based on the change operation situation of the current user on the code modules, determine the change frequency value of the current user;

[0176] Based on the corresponding relationship between the preset change frequency value and the non-changed code module group, and based on the change frequency value of the current user, determine the non-changed code module group corresponding to the current user.

[0177] Optionally, the above device further includes:

[0178] An AAR file configuration module, which is configured to update relevant information of the AAR file of the non-change code module based on configuration parameters carried in a configuration request in response to receiving a configuration request from the current user for the AAR file of the non-change code module. The relevant information includes at least one of the following:

[0179] The storage address of the AAR file of the non-change code module;

[0180] The version number of the AAR file of the non-change code module.

[0181] It can be understood that each of the above modules of the code compilation device in the embodiments of the present disclosure has the function of implementing the corresponding steps of the code compilation method in the embodiments shown in Figure 1 . The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The above modules can be software and / or hardware, and the above modules can be implemented separately or integrated by multiple modules. For the function descriptions of the modules of the above code compilation device, reference can be specifically made to the corresponding descriptions of the code compilation method in the embodiments shown in Figure 1 , which will not be elaborated here.

[0182] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0183] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0184] The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the code compilation method provided in the embodiments of the present disclosure.

[0185] Compared with the prior art, the electronic device determines a non-change code module group corresponding to the current user in response to receiving a compilation request for a code project. The non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file; the compilation result of the code project is determined based on the non-change code module group. In this solution, the non-change code module with a relatively low probability of change currently is pre-compiled, and the current compilation process is implemented by using the AAR file obtained by pre-compiling the non-change code module, avoiding repeated compilation of the non-change code module, reducing compilation time, and improving code development efficiency.

[0186] The readable storage medium is a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the code compilation method provided in the embodiments of the present disclosure.

[0187] Compared with the prior art, the readable storage medium, in response to receiving a compilation request for a code project, determines a non-change code module group corresponding to the current user, the non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file; determines the compilation result of the code project based on the non-change code module group. In this solution, the non-change code modules with a relatively low probability of change currently are pre-compiled, and the current compilation process is implemented by using the AAR files obtained by pre-compiling the non-change code modules, avoiding repeated compilation of the non-change code modules, reducing the compilation time, and improving the code development efficiency.

[0188] The computer program product includes a computer program which, when executed by a processor, implements the code compilation method provided in the embodiments of the present disclosure.

[0189] Compared with the prior art, the computer program product, in response to receiving a compilation request for a code project, determines a non-change code module group corresponding to the current user, the non-change code module group includes at least one non-change code module, and the non-change code module is pre-compiled to obtain an AAR file; determines the compilation result of the code project based on the non-change code module group. In this solution, the non-change code modules with a relatively low probability of change currently are pre-compiled, and the current compilation process is implemented by using the AAR files obtained by pre-compiling the non-change code modules, avoiding repeated compilation of the non-change code modules, reducing the compilation time, and improving the code development efficiency.

[0190] Figure 5 FIG. shows a schematic block diagram of an exemplary electronic device 50 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0191] As Figure 5As shown, the electronic device 50 includes a computing unit 510, which can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 520 or computer programs loaded from a storage unit 580 into a random access memory (RAM) 530. In the RAM 530, various programs and data required for the operation of the device 50 can also be stored. The computing unit 510, the ROM 520, and the RAM 530 are connected to each other via a bus 540. An input / output (I / O) interface 550 is also connected to the bus 540.

[0192] Multiple components in the device 50 are connected to the I / O interface 550, including: an input unit 560, such as a keyboard, a mouse, etc.; an output unit 570, such as various types of displays, speakers, etc.; a storage unit 580, such as a magnetic disk, an optical disc, etc.; and a communication unit 590, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 590 allows the device 50 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0193] The computing unit 510 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 510 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 510 executes the code compilation method provided in the embodiments of the present disclosure. For example, in some embodiments, executing the code compilation method provided in the embodiments of the present disclosure can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 580. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 50 via the ROM 520 and / or the communication unit 590. When the computer program is loaded into the RAM 530 and executed by the computing unit 510, one or more steps of the code compilation method provided in the embodiments of the present disclosure can be executed. Alternatively, in other embodiments, the computing unit 510 can be configured to execute the code compilation method provided in the embodiments of the present disclosure by any other appropriate means (e.g., by means of firmware).

[0194] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0195] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

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

[0197] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).

[0198] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0199] A computer system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client - server relationship is created by computer programs running on the respective computers and having a client - server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server combined with a blockchain.

[0200] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0201] The above - mentioned specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of this disclosure shall be included within the protection scope of this disclosure.

Claims

1. A code compilation method, comprising: In response to receiving a compilation request for a code project, determine a non-changed code module group corresponding to the current user, where the non-changed code module group includes at least one non-changed code module, and the non-changed code module is pre-compiled to obtain an Android Archive (AAR) file; Determine the compilation result of the code project based on the AAR file of the non-changed code module; Among them, the determining the compilation result of the code project based on the AAR file of the non-changed code module includes: Determine the current changed code module in the code project; Determine the consistency between the current non-changed code modules in the code project except the current changed code module and the non-changed code modules in the non-changed code module group; Determine the compilation result of the code project based on the consistency between the current non-changed code module and the non-changed code modules in the non-changed code module group.

2. The method according to claim 1, wherein, The determining the compilation result of the code project based on the consistency between the current non-changed code module and the non-changed code modules in the non-changed code module group includes: In response to the current non-changed code module being consistent with the non-changed code modules in the non-changed code module group, generate the compilation result of the code project based on the AAR file of the non-changed code module.

3. The method according to claim 2, wherein, The generating the compilation result of the code project based on the AAR file of the non-changed code module includes: Obtain the compilation order of each code module in the code project; Based on the compilation order, perform corresponding processing on each code module respectively to obtain the compilation result of the code project; Among them, the performing corresponding processing on each code module respectively based on the compilation order includes: Determine the target code module to be compiled currently based on the compilation order; In response to the target code module being the current changed code module, perform compilation processing on the current changed code module to obtain the AAR file of the current changed code module; In response to the target code module being the non-changed code module, obtain the pre-compiled AAR file of the non-changed code module.

4. The method according to claim 3, wherein, The compilation order is determined based on the dependency relationship between each code module in the code project. The dependency relationship includes the default file path of the AAR file of the non-changed code module in the code project. The AAR file of the non-changed code module is stored outside the code project. The method further includes: Modify the default file path in the dependency relationship to the actual file path of the AAR file of the non-changed code module, where the actual file path is used to obtain the AAR file of the non-changed code module.

5. The method according to claim 4, wherein, The AAR file of the non-changed code module is stored in the Maven repository.

6. The method according to claim 4 or 5, wherein, The non-changed code module group corresponding to the current user and the actual file path of the AAR file of the non-changed code module are both stored in the configuration file corresponding to the current user.

7. The method according to claim 1, wherein, The determining the compilation result of the code project based on the consistency between the current non-changed code module and the non-changed code modules in the non-changed code module group includes: In response to the current unchanged code module being inconsistent with the unchanged code modules in the unchanged code module group, perform any one of the following: Perform a compilation process on all code modules in the code project to obtain a compilation result of the code project; Based on the differences between the current unchanged code module and the unchanged code modules in the unchanged code module group, update the unchanged code modules in the unchanged code module group and update the AAR file corresponding to the unchanged code module group. Based on the updated unchanged code module group and the AAR file corresponding to the updated unchanged code module, determine the compilation result of the code project.

8. The method according to any one of claims 1 - 7, wherein, The determination of the unchanged code module group corresponding to the current user includes: Obtain the code module change situation corresponding to the current user; Determine the code modules whose code module change situations meet the preset conditions as the unchanged code modules in the unchanged code module group.

9. The method according to claim 8, wherein, The code module change situation includes at least one of the following: The change frequency of the code module; The change time of the code module.

10. The method according to any one of claims 1 - 9, wherein, The determination of the unchanged code module group corresponding to the current user includes: Determine the user group to which the current user belongs. The user group corresponds to at least one unchanged code module group, and the unchanged code module group corresponding to the user group is determined based on the code module change situations of all users in the user group; Based on the unchanged code module group corresponding to the user group, determine the unchanged code module group corresponding to the current user.

11. According to the method of claim 10, wherein, The determination of the unchanged code module group corresponding to the current user based on the unchanged code module group corresponding to the user group includes: Based on the change operation situation of the current user on the code module, determine the change frequency value of the current user; Based on the corresponding relationship between the preset change frequency value and the unchanged code module group, and based on the change frequency value of the current user, determine the unchanged code module group corresponding to the current user.

12. The method according to any one of claims 1-11, further comprising: In response to receiving a configuration request from the current user for the AAR file of the unchanged code module, update the relevant information of the AAR file of the unchanged code module based on the configuration parameters carried in the configuration request. The relevant information includes at least one of the following: The storage address of the AAR file of the unchanged code module; The version number of the AAR file of the unchanged code module.

13. A code compilation device, comprising: A pre-compilation result determination module, configured to determine an unchanged code module group corresponding to a current user in response to receiving a compilation request for a code project. The unchanged code module group includes at least one unchanged code module, and the unchanged code module is pre-compiled to obtain an AAR file; A compilation processing module, configured to determine a compilation result of the code project based on the AAR file of the unchanged code module; Wherein, the compilation processing module is specifically configured to: Determine the current changed code module in the code project; Determine the consistency between the current unchanged code module in the code project except the current changed code module and the unchanged code modules in the unchanged code module group; Determine the compilation result of the code project based on the consistency between the current unchanged code module and the unchanged code modules within the group of unchanged code modules.

14. According to the device of claim 13, wherein, When determining the compilation result of the code project based on the consistency between the current unchanged code module and the unchanged code modules within the group of unchanged code modules, the compilation processing module is specifically configured to: In response to the current unchanged code module being consistent with the unchanged code modules within the group of unchanged code modules, generate the compilation result of the code project based on the AAR file of the unchanged code module.

15. According to the device of claim 14, wherein, When generating the compilation result of the code project based on the AAR file of the unchanged code module, the compilation processing module is specifically configured to: Obtain the compilation order of each code module within the code project; Based on the compilation order, perform corresponding processing on each of the code modules to obtain the compilation result of the code project; Wherein, when performing corresponding processing on each of the code modules based on the compilation order, the compilation processing module is specifically configured to: Determine the target code module to be compiled currently based on the compilation order; In response to the target code module being the current changed code module, perform compilation processing on the current changed code module to obtain the AAR file of the current changed code module; In response to the target code module being the unchanged code module, obtain the pre-compiled AAR file of the unchanged code module.

16. According to the device of claim 15, wherein, The compilation order is determined based on the dependency relationships of the code modules within the code project. The dependency relationships include the default file path of the AAR file of the unchanged code module in the code project. The AAR file of the unchanged code module is stored outside the code project. The apparatus further includes: A dependency relationship modification module, configured to modify the default file path in the dependency relationship to the actual file path of the AAR file of the unchanged code module, where the actual file path is used to obtain the AAR file of the unchanged code module.

17. According to the device of claim 16, wherein, The AAR file of the unchanged code module is stored in the Maven repository.

18. According to the device of claim 16 or 17, wherein, The group of unchanged code modules corresponding to the current user and the actual file path of the AAR file of the unchanged code module are both stored in the configuration file corresponding to the current user.

19. According to the device of claim 13, wherein, When determining the compilation result of the code project based on the consistency between the current unchanged code module and the unchanged code modules within the group of unchanged code modules, the compilation processing module is specifically configured to: In response to the current unchanged code module being inconsistent with the unchanged code modules within the group of unchanged code modules, perform any one of the following: Perform compilation processing on all the code modules within the code project to obtain the compilation result of the code project; Based on the differences between the current unchanged code module and the unchanged code modules within the unchanged code module group, update the unchanged code modules within the unchanged code module group, and update the AAR file corresponding to the unchanged code module group. Based on the updated unchanged code module group and the AAR file corresponding to the updated unchanged code module, determine the compilation result of the code project.

20. The device according to any one of claims 13 - 19, wherein, When determining the unchanged code module group corresponding to the current user, the pre-compilation result determination module is specifically configured to: Obtain the code module change situation corresponding to the current user; Determine the code modules whose code module change situations meet the preset conditions as the unchanged code modules within the unchanged code module group.

21. The device according to claim 20, wherein, The code module change situation includes at least one of the following: The change frequency of the code module; The change time of the code module.

22. The device according to any one of claims 13 - 21, wherein, When determining the unchanged code module group corresponding to the current user, the pre-compilation result determination module is specifically configured to: Determine the user group to which the current user belongs. The user group corresponds to at least one unchanged code module group, and the unchanged code module group corresponding to the user group is determined based on the code module change situations of all users within the user group; Based on the unchanged code module group corresponding to the user group, determine the unchanged code module group corresponding to the current user.

23. The device according to claim 22, wherein, When determining the unchanged code module group corresponding to the current user based on the unchanged code module group corresponding to the user group, the pre-compilation result determination module is specifically configured to: Based on the change operation situation of the current user with respect to the code module, determine the change frequency value of the current user; Based on the preset correspondence between the change frequency value and the unchanged code module group, and based on the change frequency value of the current user, determine the unchanged code module group corresponding to the current user.

24. The device according to any one of claims 13 - 23, further comprising: The AAR file configuration module is configured to, in response to receiving a configuration request for the AAR file of the unchanged code module of the current user, update the relevant information of the AAR file of the unchanged code module based on the configuration parameters carried in the configuration request. The relevant information includes at least one of the following: The storage address of the AAR file of the unchanged code module; The version number of the AAR file of the unchanged code module.

25. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-12.

26. A non - transitory computer - readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product, comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 - 12.

Citation Information

Patent Citations

  • Method and device for improving Android compiling efficiency, equipment, storage medium and product

    CN115756490A