Compiling method, device, equipment, storage medium and program product

By weaving the code files of the functional components to be updated into the historical compilation files of the target application through incremental compilation on platforms that do not support AOP, the problem of low development efficiency is solved and AOP functionality is supported.

CN122111438APending Publication Date: 2026-05-29ALIBABA CLOUD COMPUTING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2024-11-28
Publication Date
2026-05-29

Smart Images

  • Figure CN122111438A_ABST
    Figure CN122111438A_ABST
Patent Text Reader

Abstract

The application provides a compiling method, device, equipment, storage medium and program product, which are used for compiling a target application, the target application includes at least one function component, the function component is inserted into the target application by aspect-oriented programming (AOP) mode, and the method comprises the following steps: in response to a first compiling instruction for the target application, obtaining a first code file set corresponding to the target application and a historical compiling file; determining a to-be-updated function component in at least one first function component according to a code file of the at least one first function component in the first code file set, the to-be-updated function component being a first function component whose code file has changed compared with the last time of compiling; and weaving the code file of the to-be-updated function component in the first code file set into the historical compiling file to obtain a first target compiling file of the target application. Through the compiling method, the application supports AOP, and the efficiency of developing the application is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of application development, and more particularly to a compilation method, apparatus, device, storage medium, and program product. Background Technology

[0002] Aspect-Oriented Programming (AOP) is a technique that uses pre-compilation methods and runtime dynamic proxies to dynamically add specific functionalities to an application without modifying its source code during compilation. AOP decouples the application from specific functionalities, improving the flexibility and scalability of the application code.

[0003] On an application development platform, staff can use the platform's toolkit to develop target applications. Currently, some application development platforms do not support AOP; therefore, applications developed on such platforms will not support AOP either.

[0004] In related technologies, when compiling a target application on an application development platform that does not support AOP, the source code of the platform's tool library can be modified to change the compilation process of the target application's source code files, generating compiled files that support AOP in the target application. However, in many work scenarios, it is impossible to modify the source code of the application development platform's tool library, resulting in applications developed on platforms that do not support AOP still not supporting AOP, thus leading to low application development efficiency. Summary of the Invention

[0005] This application provides a compilation method, apparatus, device, storage medium, and program product to address the problem of low efficiency in application development.

[0006] In a first aspect, embodiments of this application provide a compilation method for compiling a target application, the target application including at least one functional component, the functional component being compiled and inserted into the target application via aspect-oriented programming (AOP), the method comprising:

[0007] In response to a first compilation instruction for the target application, a first set of code files and historical compilation files corresponding to the target application are obtained, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application;

[0008] Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated from the at least one first functional component, wherein the functional component to be updated is the first functional component whose code file has changed compared to the last compilation.

[0009] The code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file of the target application.

[0010] In one possible implementation, the code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file of the target application, including:

[0011] In the historical compilation file, the first pointcut function corresponding to the functional component to be updated and the current proxy function corresponding to the first pointcut function are determined. The first pointcut function is a function that conforms to the pointcut expression, and the current proxy function is a function generated based on the first pointcut function.

[0012] The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

[0013] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the historical compilation file includes the call relationship between the first pointcut function and the functional function to be updated, as well as the call relationship between the public function corresponding to the current proxy function and the current proxy function;

[0014] The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file, including:

[0015] A first calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first pointcut function corresponding to the function to be updated and the current proxy function, thereby obtaining the first target compiled file.

[0016] In one possible implementation, determining the functional component to be updated from among the at least one first functional component based on the code file of at least one first functional component in the first code file set includes:

[0017] Based on the code file of the at least one first functional component, determine the first pointcut function corresponding to the at least one first functional component in the historical compilation file;

[0018] For any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function;

[0019] If the historical functional component corresponding to the first cutoff function is inconsistent with the first functional component corresponding to the first cutoff function, then among the at least one first functional component, the first functional component corresponding to the first cutoff function is determined as the functional component to be updated.

[0020] In one possible implementation, the method further includes:

[0021] In response to a second compilation instruction for the target application, a first set of code files and an initial compilation file corresponding to the target application are obtained. The initial compilation file is obtained based on the sub-source code update file and the sub-historical compilation file of the target application. The sub-source code update file is the sub-source code file that has changed compared to the previous compilation. The sub-historical compilation file is the sub-compiled file obtained by compiling the sub-source code file in the previous compilation. The sub-source code file corresponding to the sub-historical compilation file has not changed compared to the previous compilation.

[0022] Based on the code file of at least one first functional component in the first set of code files, determine the functional component to be updated from the at least one first functional component;

[0023] Based on the functional component to be updated, a first update point function corresponding to the functional component to be updated is determined in the initial compilation file. The first update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0024] The code file of the functional component to be updated corresponding to the first update pointcut function is woven into the initial compilation file to obtain the second target compilation file of the target application.

[0025] In one possible implementation, the code file of the functional component to be updated corresponding to the first update pointcut function is woven into the initial compilation file to obtain a second target compilation file of the target application, including:

[0026] In the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function;

[0027] The code file of the functional component to be updated is woven between the first update point function and the first proxy function to obtain the second target compiled file.

[0028] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the initial compilation file includes the calling relationship between the public function corresponding to the first proxy function and the first proxy function;

[0029] The code file of the functional component to be updated is woven between the first update pointcut function and the first proxy function to obtain the second target compiled file, including:

[0030] A second calling relationship is established between the first update pointcut function and the function to be updated, and a third calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first update pointcut function and the first proxy function, thereby obtaining the second target compiled file.

[0031] In one possible implementation, the first update pointcut function includes business update code for performing business operations; in the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function, including:

[0032] The business update code is determined in the first update point function of the initial compilation file;

[0033] Based on the business update code, the business code in the current proxy function corresponding to the first update point function is updated to obtain the first proxy function, which includes the business update code.

[0034] In one possible implementation, the method further includes:

[0035] In response to a third compilation instruction for the target application, a second set of code files corresponding to the target application and the initial compilation file are obtained, wherein the second set of code files includes code files of each of the second functional components in at least one second functional component;

[0036] Based on the code file of at least one second functional component in the second code file set, determine the second pointcut function corresponding to at least one second functional component in the initial compilation file;

[0037] At least one second update point function is determined from the second point function corresponding to the at least one second functional component. The second update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0038] The code file of the second functional component corresponding to the second update pointcut function is woven into the initial compilation file to obtain the third target compilation file of the target application.

[0039] In one possible implementation, the code file of the second functional component corresponding to the second update pointcut function is woven into the initial compilation file to obtain a third target compilation file of the target application, including:

[0040] In the initial compilation file, the current proxy function corresponding to the second update pointcut function is updated according to the second update pointcut function to obtain the second proxy function;

[0041] The code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third target compiled file.

[0042] In one possible implementation, the second functional component includes a first functional function; the initial compilation file includes the call relationship between the first functional function and the second proxy function; the code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third compilation file, including:

[0043] A fourth calling relationship is established between the second update pointcut function and the first function, so as to weave the code file of the second function corresponding to the second update pointcut function between the second update pointcut function and the second proxy function, thereby obtaining the third target compiled file.

[0044] In one possible implementation, determining at least one second update point function in the second point function corresponding to the at least one second functional component includes:

[0045] For any second pointcut function, the historical proxy function corresponding to the second pointcut function is retrieved from the preset storage space according to the function identifier corresponding to the second pointcut function;

[0046] If the historical proxy function is inconsistent with the business code in the second pointcut function, then the second pointcut function is determined as the second update pointcut function.

[0047] In one possible implementation, the method further includes:

[0048] In response to a fourth compilation instruction for the target application, the source code file and a third code file set corresponding to the target application are obtained, wherein the third code file set includes the code file of each third functional component in at least one third functional component;

[0049] Based on the code file of at least one third functional component in the third code file set, determine the third pointcut function corresponding to the at least one third functional component in the source code file;

[0050] Generate a proxy function corresponding to the third point-point function based on the third point-point function;

[0051] The code file of the third functional component corresponding to the third pointcut function is woven between the third pointcut function and the proxy function to obtain the full compiled file of the target application.

[0052] In one possible implementation, the third functional component includes a second functional function; the code file of the third functional component corresponding to the third pointcut function is woven between the third pointcut function and the proxy function to obtain the full compiled file, including:

[0053] A fifth calling relationship is established between the third pointcut function and the second functional function, and a sixth calling relationship is established between the second functional function and the proxy function, so as to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, thereby obtaining the full compiled file.

[0054] Secondly, embodiments of this application provide a compilation method for compiling a target cloud application, wherein the target cloud application is a cloud application developed based on the cross-platform application development framework Flutter, the target cloud application includes business components and at least one functional component, and the functional component is compiled and inserted into the target cloud application using aspect-oriented programming (AOP). The method includes:

[0055] In response to a first compilation instruction for the target cloud application, a first set of code files and historical compilation files corresponding to the target cloud application are obtained, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application;

[0056] Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated from the at least one first functional component, wherein the functional component to be updated is the first functional component whose code file has changed compared to the last compilation.

[0057] The code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file corresponding to the target cloud application.

[0058] Thirdly, embodiments of this application provide a compilation apparatus for compiling a target application, the target application including business components and at least one functional component, the functional component being compiled and inserted into the target application using aspect-oriented programming (AOP). The apparatus includes: an acquisition module, a first determination module, and a weaving module, wherein...

[0059] The acquisition module is used to, in response to a first compilation instruction for the target application, acquire a first set of code files and historical compilation files corresponding to the target application, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application;

[0060] The first determining module is configured to determine, based on the code files of at least one first functional component in the first code file set, a functional component to be updated from the at least one first functional component, wherein the functional component to be updated is a first functional component whose code file has changed compared to the last compilation.

[0061] The weaving module is used to weave the code files of the functional components to be updated from the first set of code files into the historical compilation files to obtain the first target compilation file of the target application.

[0062] In one possible implementation, the weaving module is specifically used for:

[0063] In the historical compilation file, the first pointcut function corresponding to the functional component to be updated and the current proxy function corresponding to the first pointcut function are determined. The first pointcut function is a function that conforms to the pointcut expression, and the current proxy function is a function generated based on the first pointcut function.

[0064] The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

[0065] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the historical compilation file includes the call relationship between the first pointcut function and the functional function to be updated, and the call relationship between the public function corresponding to the current proxy function and the current proxy function; the weaving module is specifically used for:

[0066] A first calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first pointcut function corresponding to the function to be updated and the current proxy function, thereby obtaining the first target compiled file.

[0067] In one possible implementation, the first determining module is specifically used for:

[0068] Based on the code file of the at least one first functional component, determine the first pointcut function corresponding to the at least one first functional component in the historical compilation file;

[0069] For any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function;

[0070] If the historical functional component corresponding to the first cutoff function is inconsistent with the first functional component corresponding to the first cutoff function, then among the at least one first functional component, the first functional component corresponding to the first cutoff function is determined as the functional component to be updated.

[0071] In one possible implementation, the device further includes a second determining module.

[0072] The acquisition module is further configured to, in response to a second compilation instruction for the target application, acquire a first set of code files and an initial compilation file corresponding to the target application, wherein the initial compilation file is obtained based on the sub-source code update file and the sub-historical compilation file of the target application, wherein the sub-source code update file is the sub-source code file that has changed compared to the previous compilation, and the sub-historical compilation file is the sub-compiled file obtained by compiling the sub-source code file in the previous compilation, wherein the sub-source code file corresponding to the sub-historical compilation file has not changed compared to the previous compilation;

[0073] The first determining module is further configured to determine, based on the code files of at least one first functional component in the first code file set, the functional component to be updated among the at least one first functional component;

[0074] The second determining module is used to determine, in the initial compilation file, a first update point function corresponding to the functional component to be updated, based on the functional component to be updated. The first update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0075] The weaving module is further configured to weave the code file of the functional component to be updated corresponding to the first update pointcut function into the initial compilation file to obtain the second target compilation file of the target application.

[0076] In one possible implementation, the weaving module is specifically used for:

[0077] In the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function;

[0078] The code file of the functional component to be updated is woven between the first update point function and the first proxy function to obtain the second target compiled file.

[0079] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the initial compilation file includes the calling relationship between the public function corresponding to the first proxy function and the first proxy function; the weaving module is specifically used for:

[0080] A second calling relationship is established between the first update pointcut function and the function to be updated, and a third calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first update pointcut function and the first proxy function, thereby obtaining the second target compiled file.

[0081] In one possible implementation, the first update point function includes business update code for performing business operations; the weaving module is specifically used for:

[0082] The business update code is determined in the first update point function of the initial compilation file;

[0083] Based on the business update code, the business code in the current proxy function corresponding to the first update point function is updated to obtain the first proxy function, which includes the business update code.

[0084] In one possible implementation, the device further includes a third determining module.

[0085] The acquisition module is further configured to, in response to a third compilation instruction for the target application, acquire a second set of code files corresponding to the target application and the initial compilation file, wherein the second set of code files includes code files of each of the second functional components in at least one second functional component;

[0086] The second determining module is further configured to determine, in the initial compilation file, a second pointcut function corresponding to at least one second functional component based on the code file of at least one second functional component in the second code file set;

[0087] The third determining module is used to determine at least one second update point function among the second point function corresponding to the at least one second functional component, wherein the second update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0088] The weaving module is further configured to weave the code file of the second functional component corresponding to the second update pointcut function into the initial compilation file to obtain the third target compilation file of the target application.

[0089] In one possible implementation, the weaving module is specifically used for:

[0090] In the initial compilation file, the current proxy function corresponding to the second update pointcut function is updated according to the second update pointcut function to obtain the second proxy function;

[0091] The code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third target compiled file.

[0092] In one possible implementation, the second functional component includes a first functional function; the initial compilation file includes the calling relationship between the first functional function and the second proxy function; the weaving module is specifically used for:

[0093] A fourth calling relationship is established between the second update pointcut function and the first function, so as to weave the code file of the second function corresponding to the second update pointcut function between the second update pointcut function and the second proxy function, thereby obtaining the third target compiled file.

[0094] In one possible implementation, the third determining module is specifically used for:

[0095] For any second pointcut function, the historical proxy function corresponding to the second pointcut function is retrieved from the preset storage space according to the function identifier corresponding to the second pointcut function;

[0096] If the historical proxy function is inconsistent with the business code in the second pointcut function, then the second pointcut function is determined as the second update pointcut function.

[0097] In one possible implementation, the apparatus further includes: a generation module,

[0098] The acquisition module is further configured to, in response to a fourth compilation instruction for the target application, acquire the source code file and a third code file set corresponding to the target application, wherein the third code file set includes the code file of each third functional component in at least one third functional component;

[0099] The second determining module is further configured to determine, based on the code file of at least one third functional component in the third code file set, the third pointcut function corresponding to the at least one third functional component in the source code file;

[0100] The generation module is used to generate a proxy function corresponding to the third pointcut function based on the third pointcut function.

[0101] The weaving module is further configured to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, thereby obtaining the full compiled file of the target application.

[0102] In one possible implementation, the third functional component includes a second functional function; the weaving module is specifically used for:

[0103] A fifth calling relationship is established between the third pointcut function and the second functional function, and a sixth calling relationship is established between the second functional function and the proxy function, so as to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, thereby obtaining the full compiled file.

[0104] Fourthly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0105] The memory stores computer-executed instructions;

[0106] The processor executes computer execution instructions stored in the memory, causing the processor to perform the method described in either the first aspect or the second aspect.

[0107] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in either the first or second aspect.

[0108] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method shown in either the first or second aspect.

[0109] This application provides a compilation method, apparatus, device, storage medium, and program product. An electronic device can respond to a first compilation instruction for a target application to obtain a first set of code files and historical compilation files corresponding to the target application. The electronic device can determine the functional component to be updated from at least one first functional component based on the code files of at least one first functional component in the first set of code files, and weave the code files of the functional component to be updated from the first set of code files into the historical compilation files to obtain a first target compilation file for the target application. In the compilation method of this application, the code files of functional components can be woven into the compilation files corresponding to the target application, achieving the goal of not modifying the source code of the application development platform's tool library, enabling the first target compilation file to support AOP implementation in the target application; and by weaving the code files of the functional component to be updated into the historical compilation files of the target application, incremental compilation is achieved without recompiling the code files of the unupdated functional components, thus comprehensively improving the application development efficiency. Attached Figure Description

[0110] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0111] Figure 1 A schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application;

[0112] Figure 2 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 1 ;

[0113] Figure 3 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 2 ;

[0114] Figure 4 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 1 ;

[0115] Figure 5 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 3 ;

[0116] Figure 6 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 2 ;

[0117] Figure 7 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 4 ;

[0118] Figure 8 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 3 ;

[0119] Figure 9 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 5 ;

[0120] Figure 10 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 6 ;

[0121] Figure 11 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 7 ;

[0122] Figure 12 A schematic diagram of a compilation tool provided for an exemplary embodiment of this application;

[0123] Figure 13 A schematic diagram of the structure of a compilation apparatus provided for an exemplary embodiment of this application;

[0124] Figure 14 A schematic diagram of another compilation apparatus provided as an exemplary embodiment of this application;

[0125] Figure 15 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation

[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0127] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0128] Below, in order to facilitate understanding of the technical solution of this application, the concepts involved in this application will be explained first.

[0129] Weaving is a concept in AOP (Aspect-Oriented Programming) that refers to the process of integrating functional components with other parts of an application. This technique allows developers to add additional functionality, such as logging, transaction management, and security checks, without changing the existing code.

[0130] Below, in conjunction with Figure 1 The application scenarios of this application will be explained.

[0131] Figure 1 This is a schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application. Please refer to [link / reference]. Figure 1 The target application can have a corresponding set of initial code files and historical compiled files. The target application can be an application that does not support AOP.

[0132] The first set of code files may include code files for each of the first functional components in at least one first functional component. For example, the first set of code files may include code file 1 for the logging component and code file 2 for the permission verification component.

[0133] The electronic device can identify the functional component to be updated in at least one first functional component and weave the code file of the functional component to be updated into the historical compilation file to obtain the first target compilation file.

[0134] For example, if the component to be updated is a logging component, and the historical compiled file is compiled file 2.0, the electronic device can weave the code file 1 of the logging component into compiled file 2.0 to obtain compiled file 3.0, which is the first target compiled file. When the target application runs based on compiled file 3.0, the logging component of the target application has been updated.

[0135] In related technologies, when compiling a target application on an application development platform that does not support AOP, the source code of the platform's tool library can be modified to change the compilation process of the target application's source code files, generating compiled files that support AOP in the target application. However, in many work scenarios, it is impossible to modify the source code of the application development platform's tool library, resulting in applications developed on platforms that do not support AOP still not supporting AOP, thus leading to low application development efficiency.

[0136] To address the aforementioned technical problems, embodiments of this application provide a compilation method. In this method, an electronic device can respond to a first compilation instruction for a target application to obtain a first set of code files corresponding to the target application. If the first set of code files includes code files for functional components to be updated, the electronic device can determine the code files for the functional components to be updated from the first set of code files and weave these code files into the historical compilation files of the target application to obtain a first target compilation file. In this compilation method, the code files for functional components can be woven into the compilation files corresponding to the target application, eliminating the need to modify the source code of the application development platform's tool library, enabling the first target compilation file to support AOP implementation in the target application. Furthermore, weaving the code files for the functional components to be updated into the historical compilation files of the target application eliminates the need to recompile the code files of unupdated functional components, achieving incremental compilation and comprehensively improving application development efficiency.

[0137] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for identical or similar content, the description will not be repeated in different embodiments.

[0138] The execution subject in this application embodiment can be an electronic device or a compilation device disposed in an electronic device. The compilation device can be implemented in software or a combination of software and hardware. The compilation device can be a processor in an electronic device. For ease of understanding, the following description will use an electronic device as the execution subject.

[0139] Figure 2 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 1 Please see. Figure 2 The method may include:

[0140] S201. Respond to the first compilation instruction for the target application and obtain the first set of code files and historical compilation files corresponding to the target application.

[0141] The target application may be an application that does not support AOP. The target application may include business components and at least one functional component. Business components can be used to implement the main business logic of the target application. Functional components can be used to implement predefined functionalities; functional components can be compiled and inserted into the target application using AOP.

[0142] For example, if the target application is a shopping application, it may include an order generation component and at least one functional component. The order generation component can be used to generate orders. The at least one functional component may include a logging component and an access control component. The logging component can be used to implement logging functionality, and the access control component can be used to implement access control functionality.

[0143] The first set of code files may include code files for each of the first functional components in at least one first functional component.

[0144] For example, if at least one first functional component may include a logging component and an authorization verification component, then the first set of code files may include code files for the logging component and code files for the authorization verification component.

[0145] Historical compilation files refer to the compilation files obtained from the last compilation of the target application's corresponding files. If the last compilation was a full compilation, the historical compilation files can be the compilation files obtained from compiling the target application's source code files in the last compilation; if the last compilation was an incremental compilation, the historical compilation files can be the compilation files obtained from compiling the target application's original compilation files and the code files of each functional component in the code file set in the last compilation.

[0146] An electronic device may store a set of initial code files and historical compiled files for a target application. The electronic device can respond to an initial compilation instruction for the target application to retrieve the initial set of code files and historical compiled files for that application.

[0147] For example, if the target application is a shopping application, and the current version number of the shopping application is 2.0, and if the historical compilation file of the shopping application is compilation file 2.0, then the electronic device can respond to the first compilation instruction for the shopping application to obtain the first set of code files and compilation file 2.0 corresponding to the shopping application. The first set of code files may include code file 3.0 of the logging component 3.0 and code file 2.0 of the permission verification component 2.0, both of which are first functional components.

[0148] S202. Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated in at least one first functional component.

[0149] The functional component to be updated can be the first functional component whose code file has changed compared to the last compilation.

[0150] For example, if the first set of code files includes code file 3.0 of logging component 3.0 and code file 2.0 of permission verification component 2.0, and both logging component 3.0 and permission verification component 2.0 are first functional components, if the code file 3.0 of logging component 3.0 has changed compared to the last compilation, the electronic device can determine that logging component 3.0 is a functional component to be updated; if the code file 2.0 of permission verification component 2.0 has not changed compared to the last compilation, the electronic device can determine that permission verification component 2.0 is not a functional component to be updated.

[0151] S203. Weave the code files of the functional components to be updated from the first code file set into the historical compilation files to obtain the first target compilation file corresponding to the target application.

[0152] Optionally, the first target compilation file of the target application can be obtained by weaving the code files of the functional components to be updated from the first code file set into the historical compilation files as follows: In the historical compilation files, determine the first pointcut function corresponding to the functional components to be updated, and the current proxy function corresponding to the first pointcut function; weave the code files of the functional components to be updated between the first pointcut function corresponding to the functional components to be updated and the current proxy function to obtain the first target compilation file.

[0153] In the compiled history, each first pointcut function has a corresponding current proxy function. The first pointcut function can be a function that conforms to the pointcut expression; the current proxy function can be a function generated based on the first pointcut function, and it is the object on which the first functional component actually operates. The current proxy function includes the business code used to execute the business logic.

[0154] Because the code files of the functional components to be updated are woven into the historical compilation files of the target application, instead of weaving in the code files of the functional components that have not been updated, this compilation method can be called incremental compilation, and the first target compilation file obtained is the incremental compilation file.

[0155] The first target compilation file can support running the target application. The version of the first target compilation file is the compiled version, which is higher than the version of the historical compilation files.

[0156] For example, if the historical compiled file is compiled file 2.0, the functional component to be updated is logging component 3.0, and the first pointcut function corresponding to the functional component to be updated is function 1, then the electronic device can determine the current proxy function corresponding to function 1 in compiled file 2.0. Assuming that the current proxy function corresponding to function 1 is proxy function 1, the electronic device can weave the code file 3.0 of logging component 3.0 corresponding to function 1 between function 1 and proxy function 1 to obtain compiled file 3.0. Compiled file 3.0 is the first target compiled file. Compiled file 3.0 can be used to support the running of the shopping application. When the shopping application runs based on compiled file 3.0, the current version number of the shopping application changes to 3.0.

[0157] In this embodiment, the electronic device can respond to a first compilation instruction for a target application to obtain a first set of code files and historical compilation files corresponding to the target application. The electronic device can determine the functional component to be updated from at least one first functional component based on the code files of at least one first functional component in the first set of code files, and weave the code files of the functional component to be updated from the first set of code files into the historical compilation files to obtain the first target compilation file of the target application. In the compilation method of this application, the code files of functional components can be woven into the compilation files corresponding to the target application, achieving the goal of not modifying the source code of the application development platform's tool library, enabling the first target compilation file to support AOP implementation in the target application; and by weaving the code files of the functional component to be updated into the historical compilation files of the target application, incremental compilation is achieved without recompiling the code files of the unupdated functional components, thus comprehensively improving the application development efficiency.

[0158] Below, in the above Figure 2 Based on the implementation examples, combined with Figure 3 The above compilation method will be explained in detail.

[0159] Figure 3 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 2 Please see. Figure 3 The method may include:

[0160] S301. Respond to the first compilation instruction for the target application and obtain the first set of code files and historical compilation files corresponding to the target application.

[0161] It should be noted that the execution process of step S301 can be found in step S201.

[0162] S302. Based on the code file of at least one first functional component, determine the first pointcut function corresponding to at least one first functional component in the historical compilation file.

[0163] Pointcut expressions can be included in the code file of any first functional component.

[0164] Pointcut expressions can be used to find the first pointcut function. For example, a pointcut expression could be: `execution(*com.example.service.OrderService.placeOrder(..))`, and the first pointcut function that matches the pointcut expression could be: `logAfterPlaceOrder`.

[0165] The historical compilation file can include multiple functions. For any first functional component, the electronic device can determine the pointcut expression in the code file of that first functional component, and based on the pointcut expression, determine the function that conforms to the pointcut expression in the historical compilation file as the first pointcut function corresponding to that first functional component.

[0166] For example, if the first set of code files includes code file 3.0 of logging component 3.0 and code file 2.0 of authorization verification component 2.0, and if the historical compilation file is compilation file 2.0, then the electronic device can determine pointcut expression A in code file 3.0 of logging component 3.0, and determine function 1 that conforms to pointcut expression A as the first pointcut function corresponding to logging component 3.0 in compilation file 2.0; it can determine pointcut expression B in code file 2.0 of authorization verification component 2.0, and determine function 2 that conforms to pointcut expression B as the first pointcut function corresponding to authorization verification component 2.0 in compilation file 2.0.

[0167] S303. For any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function.

[0168] For any first pointcut function, there is a corresponding function identifier.

[0169] A function identifier can be a string consisting of the pointcut location, class name, function name, and the function name of the first pointcut function. Here, the pointcut location refers to the program position where the first pointcut function is located, and the class name and function name refer to the class and function name of the target method of the first functional component that applies the first pointcut function, respectively.

[0170] For example, if the target application is a shopping application, in the target application's historical compilation files, the OrderService class is responsible for handling order-related business logic. It has a placeOrder method for placing orders (i.e., the placeOrder method is the target method), and the first pointcut function logAfterPlaceOrder is executed after the placeOrder method. Therefore, the function identifier corresponding to the first pointcut function can be: "After method execution - OrderService - placeOrder - logAfterPlaceOrder". Here, "After method execution" indicates the pointcut position, specifying the exact moment after the method execution; "OrderService" is the class name; "placeOrder" is the function name; and "logAfterPlaceOrder" is the function name of the first pointcut function.

[0171] The electronic device can retrieve the historical functional components corresponding to the first cutoff function from a preset storage space based on the function identifier corresponding to the first cutoff function. Optionally, the preset storage space can be a cache, memory, or disk in the electronic device.

[0172] For example, if the first cutoff function is function 1, then for function 1, the electronic device can retrieve the historical functional component corresponding to function 1 as log recording component 2.0 from the preset storage space based on the function identifier 1 corresponding to function 1. If the first cutoff function is function 2, then for function 2, the electronic device can retrieve the historical functional component corresponding to function 2 as permission verification component 2.0 from the preset storage space based on the function identifier 2 corresponding to function 2.

[0173] Optionally, before obtaining the historical functional components corresponding to the first point-point function based on the function identifier of the first point-point function, the electronic device may determine the function identifier corresponding to the first point-point function and the historical functional components corresponding to the first point-point function during the last compilation, and then store the historical functional components corresponding to the first point-point function in a preset storage space based on the function identifier.

[0174] It should be noted that the historical functional components are for the current compilation. The historical functional components are the current functional components corresponding to the first pointcut function in the last compilation.

[0175] For example, if the first cutoff function is function 1 and function 1 is logAfterPlaceOrder, then during the last compilation, the electronic device can determine that the function identifier 1 corresponding to function 1 is "method execution after-OrderService-placeOrder-logAfterPlaceOrder", and determine that the historical function component corresponding to function 1 is the logging component 2.0. Then, the logging component 2.0 corresponding to function 1 can be stored in the preset storage space according to the function identifier 1.

[0176] S304. If the historical functional component corresponding to the first tangent function is inconsistent with the first functional component corresponding to the first tangent function, then in at least one first functional component, the first functional component corresponding to the first tangent function is determined as the functional component to be updated.

[0177] The electronic device can determine whether the first functional component is a functional component to be updated based on whether the historical functional component corresponding to the first cut-off function is consistent with the corresponding first functional component.

[0178] Optionally, the electronic device may identify at least one functional component to be updated among at least one first functional component.

[0179] For example, if the first cutoff function is function 1, then for function 1, if the historical functional component corresponding to function 1 is logging component 2.0, and the first functional component corresponding to function 1 is logging component 3.0, since logging component 2.0 and logging component 3.0 are inconsistent, it can be determined that the first functional component corresponding to function 1 (i.e., logging component 3.0) is the functional component to be updated.

[0180] If the first cutoff function is function 2, then for function 2, if the historical functional component corresponding to function 2 is permission verification component 2.0, and the first functional component corresponding to function 2 is permission verification component 2.0, since the historical functional component and the first functional component corresponding to function 2 are the same, it can be determined that the first functional component corresponding to function 2 (i.e. permission verification component 2.0) is not the functional component to be updated.

[0181] S305. In the historical compilation files, determine the first pointcut function corresponding to the functional component to be updated, and the current proxy function corresponding to the first pointcut function.

[0182] For any functional component to be updated, the electronic device can determine the first pointcut function corresponding to the functional component to be updated, as well as the current proxy function corresponding to the first pointcut function, in the historical compilation file.

[0183] For example, if the historical compilation file is compilation file 2.0, and the functional component to be updated is logging component 3.0, and the first pointcut function corresponding to logging component 3.0 in compilation file 2.0 is function 1, then the electronic device can determine the current proxy function corresponding to function 1 in compilation file 2.0 as proxy function 1.

[0184] S306. Weave the code file of the functional component to be updated between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

[0185] The code file of the component to be updated can include the function to be updated. The function to be updated and the current proxy function can establish a calling relationship through a common function. This common function is the common function corresponding to the current proxy function.

[0186] Optionally, the code file of the functional component to be updated can be woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file in the following way: a first calling relationship is established between the functional function to be updated and the public function, so as to weave the code file of the functional component to be updated between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

[0187] Below, in conjunction with Figure 4 This section explains the calling relationships between the first pointcut function, the function to be updated, the public function, and the current proxy function.

[0188] Figure 4 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 1 Please see. Figure 4 The historical compilation files may include the first pointcut function, the current proxy function corresponding to the first pointcut function, and public functions; the code files of the functional components to be updated include the functional functions to be updated.

[0189] It's important to note that in the call relationship between the first pointcut function and the function to be updated, the first pointcut function can be called the calling function, and the function to be updated can be called the called function. Adding the called function's name to the calling function establishes a call relationship between them, meaning the calling function can call the called function. Therefore, if the calling function's content remains unchanged (i.e., it still includes the called function's name) and the called function's content is updated (but its name remains unchanged), the call relationship between them remains valid. However, if the calling function's content is updated (i.e., the updated calling function no longer includes the called function's name), the call relationship between them will become invalid.

[0190] Since the historical compilation files are already compiled, and the content of these files (including public functions, multiple first pointcut functions, and the current proxy function corresponding to each first pointcut function) is not updated during this compilation, the call relationships between the historical compilation files, the first pointcut functions and the functions to be updated, and the call relationships between public functions and the current proxy functions remain valid during this compilation. Figure 4 In the historical compilation files, call relationship 1 and call relationship 3 are still valid.

[0191] Because the code file of the component to be updated updated contains information about the function to be updated, the call relationship between the function to be updated and the public function becomes invalid during this compilation. Therefore, it is necessary to re-establish the call relationship between the function to be updated and the public function, i.e., the first call relationship. Figure 4 In the historical compilation files, call relationship 2 has become invalid. It is necessary to re-establish the first call relationship between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first pointcut function and the current proxy function, and obtain the first target compilation file.

[0192] Optionally, a first calling relationship can be established between the function to be updated and the public function in the following way: determine the function name of the public function and add the function name of the public function to the function to be updated, so as to establish a first calling relationship between the function to be updated and the public function.

[0193] For example, if the first cutoff function is function 1, and the current proxy function corresponding to function 1 is proxy function 1, and if the functional component to be updated is logging component 3.0, and the functional function to be updated in logging component 3.0 is logging function 3.0, then the electronic device can determine the function name of the common function and add the function name of the common function to logging function 3.0 to establish the first calling relationship between logging function 3.0 and the common function, thereby weaving the code file of logging component 3.0 between function 1 and proxy function 1 to obtain the first target compiled file.

[0194] It should be noted that if there is at least one functional component to be updated, steps S305 to S306 can be executed for each of the at least one functional component to be updated in the historical compilation file to obtain the first target compilation file for this compilation.

[0195] It should be noted that, in Figure 3 The various processing steps (S301-S306) shown in the embodiments do not constitute a specific limitation on the compilation process. In other embodiments of this application, the compilation process may include... Figure 3The embodiments may involve more or fewer steps. For example, the compilation process may include... Figure 3 Some steps in the embodiments, or, Figure 3 Some steps in the embodiments can be replaced by steps with the same function, or Figure 3 Some steps in the embodiments can be broken down into multiple steps, etc.

[0196] In this embodiment, the electronic device can respond to a first compilation instruction for a target application to obtain a first set of code files and historical compilation files corresponding to the target application. The electronic device can determine at least one first pointcut function corresponding to at least one first functional component from the historical compilation files based on the code files of at least one first functional component. For any first pointcut function, the electronic device can obtain the historical functional component corresponding to the first pointcut function based on its function identifier. If the historical functional component corresponding to the first pointcut function is inconsistent with the first functional component corresponding to the first pointcut function, the electronic device can determine the first functional component corresponding to the first pointcut function as the functional component to be updated from at least one first functional component. For any functional component to be updated, the electronic device can determine the first pointcut function corresponding to the functional component to be updated and the current proxy function corresponding to the first pointcut function from the historical compilation files, and weave the code file of the functional component to be updated between the first pointcut function and the current proxy function to obtain a first target compilation file. In the compilation method of this application, the code files of functional components can be woven into the compilation files corresponding to the target application, which eliminates the need to modify the source code of the tool library of the application development platform, so that the first target compilation file can support the target application to implement AOP; and the code files of the functional components to be updated can be woven into the historical compilation files of the target application, eliminating the need to recompile the code files of the unupdated functional components, realizing incremental compilation, and comprehensively improving the development efficiency of the application.

[0197] Figure 2 and Figure 3 The examples all assume that during this compilation, the target application's historical compilation files were used (meaning the target application's source code files were not updated, and this compilation was based on the previously compiled files), and at least one functional component had a component that needed updating. In real-world scenarios, when compiling the target application, there are also situations where at least one functional component has a component that needs updating, and the target application's sub-source code files have been updated. The following will discuss this in conjunction with... Figure 5 This situation needs further explanation; there are also cases where at least one functional component has not been updated, while the target application's sub-source code files have been updated. The following will discuss this in conjunction with... Figure 7 This situation needs to be explained.

[0198] Figure 5A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 3 Please see. Figure 5 The method may include:

[0199] S501, respond to the second compilation instruction for the target application, and obtain the first set of code files and the initial compilation file corresponding to the target application.

[0200] The initial compiled file can be obtained during this compilation based on the target application's sub-source code update files and sub-history compiled files. Sub-source code update files are the sub-source code files that have changed compared to the previous compilation. Sub-history compiled files are the sub-compiled files obtained when the sub-source code files were compiled during the previous compilation. In this compilation, the sub-source code files corresponding to the sub-history compiled files have not changed compared to the previous compilation.

[0201] Optionally, the initial compiled file of the target application can be obtained by responding to the second compilation instruction for the target application, obtaining the sub-source code update file and the sub-historical compiled file of the target application; compiling the sub-source code update file to obtain the sub-compilation update file; and merging the sub-compilation update file and the sub-historical compiled file to obtain the initial compiled file.

[0202] Optionally, the number of sub-source code update files can be at least one, and the number of sub-historical compilation files can be at least one.

[0203] For example, if the target application is a shopping application, and its current version number is 2.0, the source code files of the target application may include 10 sub-source code files, namely sub-source code file 1, sub-source code file 2, sub-source code file 3, ..., sub-source code file 10. During the last compilation, 10 corresponding sub-historical compiled files were obtained, namely sub-historical compiled file 1, sub-historical compiled file 2, sub-historical compiled file 3, ..., sub-historical compiled file 10. If sub-source code file 1 is updated to sub-source code update file 1, then in this compilation, the electronic device can respond to the second compilation instruction for the shopping application, obtaining sub-source code update file 1 and 9 sub-historical compiled files corresponding to the shopping application, namely historical compiled file 2, sub-historical compiled file 3, ..., sub-historical compiled file 10. The sub-source code files corresponding to these 9 sub-historical compiled files, namely sub-source code file 2, sub-source code file 3, ..., sub-source code file 10, remain unchanged compared to the previous compilation. The electronic device can compile the sub-source code update file 1 to obtain the sub-compilation update file 1, and merge it with the 9 sub-historical compilation files to obtain the initial compilation file.

[0204] The electronic device can store a first set of code files and an initial compiled file for the target application. The electronic device can respond to a second compilation instruction for the target application to obtain the first set of code files and the initial compiled file corresponding to the target application.

[0205] For example, if the target application is a shopping application and its current version number is 2.0, the electronic device can respond to the second compilation instruction for the shopping application to obtain the first set of code files and the initial compiled file corresponding to the shopping application. The first set of code files may include code file 3.0 of the logging component 3.0 and code file 2.0 of the permission verification component 2.0, both of which are first functional components.

[0206] S502. Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated in at least one first functional component.

[0207] Optionally, the functional component to be updated can be determined from at least one first functional component based on the code files of at least one first functional component in the first code file set as follows: Based on the code files of at least one first functional component in the first code file set, determine the first pointcut function corresponding to at least one first functional component in the initial compilation file; for any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function; if the historical functional component corresponding to the first pointcut function is inconsistent with the first functional component corresponding to the first pointcut function, then determine the first functional component corresponding to the first pointcut function as the functional component to be updated from at least one first functional component.

[0208] It should be noted that the above process can be referred to the execution process of steps S302 to S304. The only difference is that in steps S302 to S304, at least one first pointcut function corresponding to the first functional component is determined in the historical compilation file, while in step S502, at least one first pointcut function corresponding to the first functional component is determined in the initial compilation file.

[0209] S503. Based on the functional component to be updated, determine the first update point function corresponding to the functional component to be updated in the initial compilation file.

[0210] The first update pointcut function is the pointcut function in the sub-source file that has changed compared to the previous compilation. For example, if sub-source file 1 included function 1 in the previous compilation, and sub-source file 1 is updated to sub-source update file 1 in the current compilation, and function 1.1 in sub-source update file 1 has been updated compared to function 1, then function 1.1 is the first update pointcut function.

[0211] Since the sub-source code update file includes the first update pointcut function, and the initial compilation file is obtained by merging the sub-compiled update file (compiled from the sub-source code update file) and the sub-historical compilation file, the initial compilation file also includes the first update pointcut function. Therefore, after determining the functional component to be updated, the electronic device can determine the corresponding first update pointcut function in the initial compilation file based on the functional component to be updated.

[0212] Optionally, the electronic device can determine the pointcut expression in the code file of the functional component to be updated, and determine the function that conforms to the pointcut expression as the first update pointcut function corresponding to the functional component to be updated in the initial compilation file according to the pointcut expression.

[0213] For example, if the functional component to be updated is logging component 3.0, the electronic device can determine the first update pointcut function corresponding to logging component 3.0 as function 1.1 in the initial compilation file. Function 1.1 is the pointcut function that has changed compared to the previous compilation.

[0214] S504. In the initial compilation file, update the current proxy function corresponding to the first update pointcut function according to the first update pointcut function to obtain the first proxy function.

[0215] Before the initial compilation, the target application's source code file includes multiple first pointcut functions. For any given first pointcut function, it contains business logic code for executing business requirements, but no corresponding current proxy function exists. During the initial compilation, the business logic code can be determined within the first pointcut functions. This business logic code is then copied and renamed to obtain the corresponding current proxy function. Therefore, after the initial compilation, in the compiled file obtained from the source code file, each first pointcut function has a corresponding current proxy function, and this current proxy function contains the business logic code.

[0216] In any compilation other than the first one (including this compilation), for any first pointcut function, if the first pointcut function is updated to the first update pointcut function, since the business code in the first update pointcut function has been updated, the current proxy function corresponding to the first update pointcut function needs to be updated according to the first update pointcut function to obtain the first proxy function.

[0217] The first update pointcut function can include business update code used to perform business logic.

[0218] Optionally, the first proxy function can be obtained by updating the current proxy function corresponding to the first update pointcut function in the initial compilation file in the following way: determine the business update code in the first update pointcut function in the initial compilation file; update the business code in the current proxy function corresponding to the first update pointcut function according to the business update code, and obtain the first proxy function, which includes the business update code.

[0219] For example, if the first update point function is function 1.1, and the business update code for generating an order in function 1.1 is: iterate through the products—calculate the total price—verify the total price—generate the order, and if the current proxy function corresponding to function 1.1 is proxy function 1, and the business code in proxy function 1 is: iterate through the products—calculate the total price—generate the order, then the electronic device can determine the business update code in function 1.1 and update the business code in proxy function 1 to the business update code, thus obtaining proxy function 1.1. Proxy function 1.1 includes the business update code: iterate through the products—calculate the total price—verify the total price—generate the order.

[0220] S505. Weave the code file of the functional component to be updated between the first update point function and the first proxy function to obtain the second target compiled file.

[0221] The code file for the component to be updated can include the function to be updated. The function to be updated and the first proxy function can establish a calling relationship through a common function.

[0222] Optionally, the code file of the functional component to be updated can be woven between the first update pointcut function and the first proxy function to obtain the second target compiled file: a second calling relationship is established between the first update pointcut function and the functional function to be updated, and a third calling relationship is established between the functional function to be updated and the public function, so as to weave the code file of the functional component to be updated between the first update pointcut function and the first proxy function to obtain the second target compiled file.

[0223] Below, in conjunction with Figure 6 The calling relationships between the first update point function, the function to be updated, the public function, and the first proxy function are explained.

[0224] Figure 6 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 2 Please see. Figure 6 The initial compilation file may include the first update pointcut function, the first proxy function, and public functions; the code file of the functional component to be updated includes the functional functions to be updated.

[0225] Since the public function was not updated during this compilation process, the call relationship between the public function and the first proxy function remains valid. Figure 6 In this context, the call relationship 3.1 remains valid.

[0226] Because the first update pointcut function in the initial compiled file was updated during this compilation process, and the function to be updated in the component to be updated was also updated, the call relationships between the first update pointcut function and the function to be updated, and between the function to be updated and the common function, became invalid during this compilation. Therefore, it is necessary to re-establish the second call relationship between the first update pointcut function and the function to be updated, and the third call relationship between the function to be updated and the common function. Figure 6 In the process, call relationships 1.1 and 2.1 have become invalid. It is necessary to re-establish the second call relationship between the first update pointcut function and the function to be updated, as well as the third call relationship between the function to be updated and the public function. This will enable the code file of the function to be updated to be woven between the first update pointcut function and the first proxy function, thus obtaining the second target compiled file.

[0227] Optionally, the electronic device may determine the function name of the function to be updated and add the function name of the function to be updated to the first update point function to establish a second calling relationship between the first update point function and the function to be updated; and may determine the function name of the common function and add the function name of the common function to the function to be updated to establish a third calling relationship between the function to be updated and the common function.

[0228] For example, if the first update pointcut function is function 1.1, and the first proxy function corresponding to function 1.1 is proxy function 1.1, and if the functional component to be updated is logging component 3.0, and the functional function to be updated is logging function 3.0, then the electronic device can determine the function name of logging function 3.0 and add the function name of logging function 3.0 to function 1.1 to establish a second calling relationship between function 1.1 and logging function 3.0; and it can determine the function name of the common function and add the function name of the common function to logging function 3.0 to establish a third calling relationship between the logging function and the common function, thereby weaving the code file 3.0 of logging component 3.0 between function 1.1 and proxy function 1.1 to obtain the second target compiled file.

[0229] It should be noted that if there is at least one functional component to be updated, steps S503 to S505 can be executed for each of the at least one functional component to be updated in the initial compilation file to obtain the second target compilation file for this compilation.

[0230] In this embodiment, the electronic device can respond to a second compilation instruction for a target application to obtain a first set of code files and an initial compilation file corresponding to the target application. The electronic device can determine the functional component to be updated within at least one first functional component based on the code files of at least one first functional component in the first set of code files, and determine the first update pointcut function corresponding to the functional component to be updated in the initial compilation file based on the functional component to be updated. The electronic device can update the current proxy function corresponding to the first update pointcut function in the initial compilation file according to the first update pointcut function to obtain a first proxy function, and weave the code file of the functional component to be updated between the first update pointcut function and the first proxy function to obtain a second target compilation file. In the compilation method of this application, the code files of functional components can be woven into the compilation file corresponding to the target application, achieving the goal of not needing to modify the source code of the application development platform's tool library, enabling the second target compilation file to support AOP implementation in the target application; and by determining the updated first update pointcut function in the initial compilation file of the target application and weaving the code file of the functional component to be updated at the first update pointcut function, it is not necessary to recompile the unupdated pointcut function and the code file of the unupdated functional component, achieving incremental compilation and comprehensively improving the application development efficiency.

[0231] Figure 7 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 4 Please see. Figure 7 The method may include:

[0232] S701, respond to the third compilation instruction for the target application, and obtain the second set of code files and the initial compilation file corresponding to the target application.

[0233] The second set of code files includes the code files for each of the second functional components within at least one second functional component. The second functional components are those that have not been updated during this compilation.

[0234] For example, if at least one second functional component may include a logging component and an authorization verification component, then the second set of code files may include code files for the logging component and code files for the authorization verification component.

[0235] The initial compiled file can be obtained during this compilation, based on the sub-source code update file and sub-historical compiled file of the target application.

[0236] The electronic device may store a second set of code files and an initial compiled file for the target application. The electronic device can respond to a third compilation instruction for the target application to obtain a first set of code files and an initial compiled file for the target application.

[0237] For example, if the target application is a shopping application and its current version number is 2.0, the electronic device can respond to the third compilation instruction for the shopping application to obtain the second set of code files and the initial compilation file corresponding to the shopping application. The second set of code files may include code file 2.0 for the logging component 2.0 and code file 2.0 for the permission verification component 2.0; both the logging component 2.0 and the permission verification component 2.0 are second functional components.

[0238] S702. Based on the code file of at least one second functional component in the second code file set, determine the second pointcut function corresponding to at least one second functional component in the initial compilation file.

[0239] For any second functional component, the electronic device can determine the pointcut expression in the code file of the second functional component, and determine the function that conforms to the pointcut expression as the second pointcut function corresponding to the second functional component in the initial compilation file according to the pointcut expression.

[0240] For example, if the second set of code files includes code file 2.0 of logging component 2.0 and code file 2.0 of authorization verification component 2.0, the electronic device can determine pointcut expression A in code file 2.0 and determine function 1.1 that conforms to pointcut expression A as the second pointcut function corresponding to logging component 2.0 in the initial compilation file; it can also determine pointcut expression B in code file 2.0 and determine function 2.0 that conforms to pointcut expression B as the second pointcut function corresponding to authorization verification component 2.0 in the initial compilation file.

[0241] S703. Determine at least one second update point function in the second point function corresponding to at least one second functional component.

[0242] The second update pointcut function is the pointcut function in the sub-source code update file that has changed compared to the last compilation.

[0243] Optionally, at least one second update point function can be determined in the second point function corresponding to at least one second functional component in the following manner: for any second point function, obtain the historical proxy function corresponding to the second point function according to the function identifier corresponding to the second point function; if the historical proxy function is inconsistent with the business code in the second point function, then the second point function is determined as the second update point function.

[0244] For any second point-of-point function, there is a corresponding function identifier.

[0245] Optionally, during the last compilation, the electronic device can determine the function identifier corresponding to the second pointcut function and the historical proxy function corresponding to the second pointcut function, and then store the historical proxy function corresponding to the second pointcut function in a preset storage space according to the function identifier corresponding to the second pointcut function.

[0246] It should be noted that the historical proxy function is specific to the current compilation; the historical proxy function is the current proxy function corresponding to the second pointcut function in the previous compilation.

[0247] For example, if there are two second pointcut functions, function 1.1 and function 2.0, then for function 1.1, the electronic device can retrieve the historical proxy function corresponding to function 1.1 from the preset storage space based on the function identifier of function 1.1, which is proxy function 1. The business code in proxy function 1 is: traverse products—calculate the total price—generate an order. If the business code in function 1.1 is: traverse products—calculate the total price—verify the total price—generate an order, since the business code in function 1.1 is inconsistent with that in proxy function 1, it means that function 1.1 has been updated, and function 1.1 can be identified as the second update pointcut function. Similarly, for function 2.0, the electronic device can retrieve the historical proxy function corresponding to function 2.0 from the preset storage space based on the function identifier of function 2.0, which is proxy function 2. If the business code in function 2.0 is consistent with that in proxy function 2, it means that function 2.0 has not been updated, and function 2.0 can be identified as not the second update pointcut function.

[0248] S704. In the initial compilation file, update the current proxy function corresponding to the second update pointcut function according to the second update pointcut function to obtain the second proxy function.

[0249] For any second pointcut function, if the second update pointcut function is updated, then the current proxy function corresponding to the second update pointcut function needs to be updated according to the second update pointcut function to obtain the second proxy function.

[0250] The second update pointcut function can include business update code used to perform business logic.

[0251] Optionally, the second proxy function can be obtained by updating the current proxy function corresponding to the second update pointcut function in the initial compilation file according to the second update pointcut function as follows: determine the business update code in the second update pointcut function in the initial compilation file; update the business code in the current proxy function corresponding to the second update pointcut function according to the business update code, and obtain the second proxy function, which includes the business update code.

[0252] For example, if the second update pointcut function is function 1.1, and the business update code for generating an order in function 1.1 is: iterate through the products—calculate the total price—verify the total price—generate the order, and if the current proxy function corresponding to function 1.1 is proxy function 1, and the business code in proxy function 1 is: iterate through the products—calculate the total price—generate the order, then the electronic device can determine the business update code in function 1.1 and update the business code in proxy function 1 to the business update code, thus obtaining proxy function 1.1. Proxy function 1.1 is the second proxy function, and the business update code in proxy function 1.1 is: iterate through the products—calculate the total price—verify the total price—generate the order.

[0253] S705. Weave the code file of the second functional component corresponding to the second update pointcut function between the second update pointcut function and the second proxy function to obtain the third target compiled file.

[0254] The second functional component may include the first functional function.

[0255] Optionally, a third compiled file can be obtained by weaving the code file of the second functional component corresponding to the second update pointcut function between the second update pointcut function and the second proxy function: a fourth calling relationship is established between the second update pointcut function and the first functional function to weave the code file of the second functional component corresponding to the second update pointcut function between the second update pointcut function and the second proxy function, thereby obtaining a third target compiled file.

[0256] Below, in conjunction with Figure 8 The calling relationships between the second update point function, the first function, and the second proxy function are explained.

[0257] Figure 8 Illustration of the calling relationship provided for an exemplary embodiment of this application Figure 3 Please see. Figure 8 The initial compilation file may include a second update pointcut function, a second proxy function, and public functions; the code file of the second functional component includes the first functional function.

[0258] During this compilation process, since the public function and the first functional function were not updated, the call relationships between the first functional function and the public function, and between the public function and the second proxy function, remain valid. For example... Figure 8 In this context, call relationships 2.2 and 3.2 remain valid.

[0259] Because the second update pointcut function was updated during this compilation, the call relationship between the second update pointcut function and the first function function became invalid. Therefore, it is necessary to re-establish the call relationship between the second update pointcut function and the first function function, i.e., the fourth call relationship. Figure 8 In this process, call relationship 1.2 has become invalid. It is necessary to re-establish the fourth call relationship between the second update pointcut function and the first function, so as to weave the code file of the second function corresponding to the second update pointcut function into the second proxy function to obtain the third target compiled file.

[0260] Optionally, a fourth calling relationship can be established between the second update pointcut function and the first function by determining the function name of the first function and adding the function name of the first function to the second update pointcut function, thereby establishing a fourth calling relationship between the second update pointcut function and the first function.

[0261] For example, if the second update pointcut function is function 1.1, the second proxy function corresponding to function 1.1 is proxy function 1.1, and the second functional component corresponding to function 1.1 is logging component 2.0, and the first functional function is logging function 2.0, then the electronic device can determine the function name of logging function 2.0 and add the function name of logging function 2.0 to function 1.1 to establish a fourth calling relationship between function 1.1 and logging function 2.0, thereby weaving the code file of logging component 2.0 between function 1.1 and proxy function 1.1 to obtain the third target compiled file.

[0262] It should be noted that if there is at least one second update point function, steps S704 to S705 can be executed for each of the at least one second update point function in the initial compilation file to obtain the third target compilation file for this compilation.

[0263] In this embodiment, the electronic device can respond to a third compilation instruction for a target application to obtain a second set of code files and an initial compilation file corresponding to the target application. The electronic device can determine at least one second pointcut function corresponding to at least one second functional component in the initial compilation file based on the code files of at least one second functional component in the second set of code files, and determine at least one second update pointcut function within the second pointcut function corresponding to the at least one second functional component. The electronic device can update the current proxy function corresponding to the second update pointcut function in the initial compilation file according to the second update pointcut function to obtain a second proxy function, and weave the code files of the second functional components corresponding to the second update pointcut function between the second update pointcut function and the second proxy function to obtain a third target compilation file. In the compilation method of this application, the code files of functional components can be woven into the compilation file corresponding to the target application, achieving the goal of supporting AOP implementation in the third target compilation file without modifying the source code of the application development platform's tool library; and by determining the updated second update pointcut function in the initial compilation file of the target application and weaving the code files of the second functional components at the second update pointcut function, incremental compilation is achieved without recompiling the unupdated pointcut functions, thus comprehensively improving the application development efficiency.

[0264] Below, based on any of the above embodiments, combined with Figure 9 In light of the three scenarios described above, we will provide another flowchart illustrating the compilation process.

[0265] Figure 9 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 5 Please see. Figure 9 The method may include:

[0266] S901: Respond to the compilation instructions for the target application and obtain the set of code files and application files for the target application.

[0267] Electronic devices can store a collection of code files and application files for a target application. The electronic device can respond to compilation instructions specific to the target application and retrieve the collection of code files and application files for that application.

[0268] Optionally, the application file can be a historical compilation file or an initial compilation file.

[0269] The collection of code files may include code files for at least one functional component.

[0270] For example, an electronic device can respond to compilation instructions for a target application to obtain a set of code files and application files for the target application. The set of code files may include the code files corresponding to the logging component 3.0, the permission verification component 3.0, and the security verification component 2.0, respectively. The current version number of the target application can be 2.0.

[0271] S902. Based on the code files of at least one functional component in the code file set, determine the pointcut function corresponding to at least one functional component in the application file.

[0272] For any given functional component, the electronic device can determine the pointcut expression in the code file of that functional component, and determine the corresponding pointcut function in the application file based on the pointcut expression.

[0273] For example, if at least one functional component includes a logging component, an access control component, and a security verification component, then for the logging component, the electronic device can determine a pointcut expression P1 in the code file of the logging component 3.0, and determine the function F1 that conforms to the pointcut expression P1 in the application file as the pointcut function corresponding to the logging component 3.0; for the access control component, the electronic device can determine a pointcut expression P2 in the code file of the access control component 3.0, and determine the function F2 that conforms to the pointcut expression P2 in the application file as the pointcut function corresponding to the access control component 3.0; for the security verification component, the electronic device can determine a pointcut expression P3 in the code file of the security verification component 2.0, and determine the function F3 that conforms to the pointcut expression P3 in the application file as the pointcut function corresponding to the access control component 2.0.

[0274] S903. For any pointcut function, determine whether the pointcut function is an update pointcut function, and whether the functional component corresponding to the pointcut function in at least one functional component in the code file set is a functional component to be updated.

[0275] Optionally, for any pointcut function, the electronic device can retrieve the historical proxy function and historical functional components corresponding to the pointcut function from a preset storage space based on the function identifier corresponding to the pointcut function.

[0276] For any pointcut function, if the business code in the pointcut function is inconsistent with the business code in the corresponding historical proxy function, then the pointcut function can be determined as an update pointcut function; if the functional component corresponding to the pointcut function is inconsistent with the historical functional component of the pointcut function, then the functional component corresponding to the pointcut function can be determined as the functional component to be updated from at least one functional component in the code file set.

[0277] For example, if there are three pointcut functions, namely function F1, function F2, and function F3, then for function F1, the electronic device can obtain the historical proxy function H1 and the corresponding historical functional component (logging component 2.0) corresponding to function F1 from the preset storage space based on the function identifier corresponding to function F1. If the business code in function F1 is consistent with the business code in the historical proxy function H1, then function F1 can be determined to be an update pointcut function; if logging component 2.0 is inconsistent with logging component 3.0, then logging component 3.0 corresponding to function F1 can be determined to be a functional component to be updated. Similarly, suppose the electronic device can determine that function F2 is an update pointcut function, and the permission verification component 3.0 corresponding to function F2 is a functional component to be updated; and can determine that function F3 is an update pointcut function, and the security verification component 2.0 corresponding to function F3 is not a functional component to be updated.

[0278] S904. If the pointcut function is not an update pointcut function, and the functional component corresponding to the pointcut function is a functional component to be updated, then the code file of the functional component to be updated is woven between the pointcut function and the current proxy function corresponding to the pointcut function.

[0279] In the application file, for any pointcut function, there is a corresponding current proxy function.

[0280] The component to be updated can include the function to be updated. The function to be updated and the current proxy function can establish a calling relationship through a common function.

[0281] If the pointcut function is not the updating pointcut function, and the functional component corresponding to the pointcut function is the functional component to be updated, it can be determined that the call relationship between the pointcut function and the functional component to be updated, and the call relationship between the public function and the current proxy function are still valid. However, the call relationship between the functional component to be updated and the public function has become invalid. Therefore, it is necessary to re-establish the call relationship between the functional component to be updated and the public function, so as to weave the code file of the functional component to be updated between the pointcut function and the current proxy function corresponding to the pointcut function.

[0282] For example, as illustrated above, if function F1 is not an update pointcut function, the current proxy function corresponding to function F1 is proxy function R1, and the logging component 3.0 corresponding to function F1 is a functional component to be updated, and the logging component 3.0 can include logging function 3.0, then the electronic device can determine the function name of the public function corresponding to proxy function R1, and add the function name of the public function corresponding to proxy function R1 to the logging function 3.0 to establish the calling relationship between the logging function 3.0 and the public function, thereby realizing the weaving of the code file of logging component 3.0 between function F1 and proxy function R1.

[0283] After completing step S904, step S907 can be executed.

[0284] S905. If the pointcut function is an update pointcut function and the functional component corresponding to the pointcut function is the functional component to be updated, then the code file of the functional component to be updated is woven between the update pointcut function and the update proxy function corresponding to the update pointcut function.

[0285] In this scenario, since the pointcut function has been updated to an update pointcut function, and the update pointcut function includes business update code, the business update code can be determined within the update pointcut function. Based on this business update code, the business code in the current proxy function corresponding to the update pointcut function is then updated, resulting in the update proxy function corresponding to the update pointcut function. The update proxy function includes the business update code.

[0286] When the pointcut function is an update pointcut function and the functional component corresponding to the pointcut function is the functional component to be updated, it can be determined that the call relationship between the update pointcut function and the functional function to be updated, as well as between the functional function to be updated and the public function, has become invalid. However, the call relationship between the public function and the update proxy function is still valid. Therefore, it is necessary to re-establish the call relationship between the update pointcut function and the functional function to be updated, as well as the call relationship between the functional function to be updated and the public function, so as to weave the code file of the functional component to be updated between the update pointcut function and the update proxy function corresponding to the update pointcut function.

[0287] For example, as illustrated above, if function F2 is an update point function and the current proxy function corresponding to function F2 is proxy function R2.0, then the electronic device can update proxy function R2.0 according to the business update code in function F2 to obtain update proxy function R2.1.

[0288] If the permission verification component 3.0 corresponding to function F2 is a functional component to be updated, permission verification component 3.0 may include permission verification function 3.0. The electronic device can determine the function name of permission verification function 3.0 and add the function name of permission verification function 3.0 to function F2 to establish a call relationship between function F2 and permission verification function 3.0; and can determine the function name of the public function corresponding to proxy function R2.1 and add the function name of the public function corresponding to proxy function R2.1 to permission verification function 3.0 to establish a call relationship between permission verification function 3.0 and public function, thereby weaving the code file of permission verification component 3.0 between function F2 and proxy function R2.1.

[0289] After completing step S905, step S907 can be executed.

[0290] S906. If the pointcut function is an update pointcut function and the functional component corresponding to the pointcut function is not the functional component to be updated, then the code file of the functional component is woven between the update pointcut function and the update proxy function corresponding to the update pointcut function.

[0291] In this case, since the pointcut function has been updated to the update pointcut function, the business code in the current proxy function corresponding to the update pointcut function can be updated based on the business update code in the update pointcut function, thus obtaining the update proxy function corresponding to the update pointcut function.

[0292] If the pointcut function is an update pointcut function and the functional component corresponding to the pointcut function is not the functional component to be updated, it can be determined that the update pointcut function and the functional function in the functional component have become invalid, but the calling relationship between the functional function and the update proxy function is still valid. Therefore, it is necessary to re-establish the calling relationship between the update pointcut function and the functional function, so as to weave the code file of the functional component between the update pointcut function and the update proxy function corresponding to the update pointcut function.

[0293] For example, as illustrated above, if function F3 is an update point function and the current proxy function corresponding to function F3 is proxy function R3.0, then the electronic device can update proxy function R3.0 according to the business update code in function F3 to obtain update proxy function R3.1.

[0294] If the security verification component 2.0 corresponding to function F3 is not a functional component to be updated, security verification component 2.0 may include security verification function 2.0. The electronic device can determine the function name of security verification function 2.0 and add the function name of security verification function 2.0 to function F3 to establish a calling relationship between function F3 and security verification function 2.0, thereby realizing the weaving of the code file of security verification component 2.0 between function F3 and proxy function R3.1.

[0295] After completing step S906, step S907 can be executed.

[0296] S907, Generate target compilation files.

[0297] After executing any one of the above steps S904, S905, and S906, the electronic device can generate the target compilation file.

[0298] For example, if the target application's application file includes functions F1, F2, and F3, and functions F1, F2, and F3 are as illustrated in the example above, then the code file for the logging component 3.0 will be woven between function F1 and the proxy function R1; the code file for the permission verification component 3.0 will be woven between function F2 and the proxy function R2.1; and the code file for the security verification component 2.0 will be woven between function F3 and the proxy function R3.1, thereby generating the target compiled file. The version number of the target compiled file can be 3.0. When the target application runs based on the target compiled file, the current version number of the target application changes to 3.0.

[0299] In this embodiment, the electronic device can respond to compilation instructions for a target application, obtain a set of code files and an application file for the target application, and determine at least one pointcut function corresponding to at least one functional component in the application file based on the code files of at least one functional component in the code file set. For any pointcut function, the electronic device can determine whether the pointcut function is an update pointcut function and whether the functional component corresponding to the pointcut function in at least one functional component in the code file set is a functional component to be updated. If the pointcut function is not an update pointcut function, and the functional component corresponding to the pointcut function is a functional component to be updated, the electronic device can weave the code file of the functional component to be updated between the pointcut function and the current proxy function corresponding to the pointcut function. If the pointcut function is an update pointcut function, and the functional component corresponding to the pointcut function is a functional component to be updated, the electronic device can weave the code file of the functional component to be updated between the update pointcut function and the update proxy function corresponding to the update pointcut function. If the pointcut function is an update pointcut function, and the functional component corresponding to the pointcut function is not a functional component to be updated, the electronic device can weave the code file of the functional component between the update pointcut function and the update proxy function corresponding to the update pointcut function. The electronic device can finally generate the target compiled file. In the compilation method of this application, the code files of functional components can be woven into the application file corresponding to the target application, which eliminates the need to modify the source code of the tool library of the application development platform, so that the target compiled file can support the target application to implement AOP. Furthermore, based on the update status of the pointcut function and the update status of the functional components corresponding to the pointcut function, the code files of the functional components are woven into the application file of the target application, eliminating the need to recompile the unupdated pointcut function and the code files of the unupdated functional components, thus achieving incremental compilation and comprehensively improving the application development efficiency.

[0300] The above embodiments are all compiled under the condition that some pointcut functions and / or some functional components are updated, which are all incremental compilation scenarios. In actual working scenarios, a full compilation of the target application can also be performed.

[0301] Below, in conjunction with Figure 10The process of full compilation is explained.

[0302] Figure 10 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 6 Please see. Figure 10 The method includes:

[0303] S1001, respond to the fourth compilation instruction for the target application, and obtain the source code file and third code file set corresponding to the target application.

[0304] The third set of code files includes the code files for each of the third functional components in at least one third functional component.

[0305] The electronic device can store the source code files and a third set of code files for the target application. The electronic device can respond to a fourth compilation instruction for the target application to obtain the first set of code files and historical compilation files for the target application.

[0306] For example, if the target application is a shopping application and its current version number is 2.0, the electronic device can respond to the fourth compilation instruction for the shopping application to obtain the source code files and the third set of code files corresponding to the shopping application. The third set of code files may include code files for a logging component and code files for a permission verification component; both the logging component and the permission verification component are third-level functional components.

[0307] S1002. Based on the code file of at least one third functional component in the third code file set, determine the third pointcut function corresponding to at least one third functional component in the source code file.

[0308] Any third functional component's code file can include a pointcut expression. For any third functional component, the electronic device can determine the pointcut expression in the code file of that third functional component, and based on the pointcut expression, determine the functions in the source code file that conform to the pointcut expression as the third pointcut functions corresponding to that third functional component.

[0309] For example, if the third set of code files includes code files for the logging component and code files for the authorization component, the electronic device can determine the pointcut expression A1 in the code file of the logging component and determine function 1.2 that conforms to pointcut expression A1 as the third pointcut function corresponding to the logging component in the source code file; it can determine the pointcut expression B1 in the code file of the authorization component and determine function 2.0 that conforms to pointcut expression B1 as the third pointcut function corresponding to the authorization component in the source code file.

[0310] S1003. Generate the surrogate function corresponding to the third pointcut function based on the third pointcut function.

[0311] For any third pointcut function, the electronic device can determine the business code in the third pointcut function, and perform copying and renaming on the business code to obtain the proxy function corresponding to the third pointcut function. The current proxy function corresponding to the third pointcut function includes the business code.

[0312] For example, if there are two third-point function functions, function 1.2 and function 2.0, and the business code for generating an order in function 1.2 is: iterate through the products—calculate the total price—generate the order, then for function 1.2, the electronic device can determine the business code for generating the order within function 1.2, copy the business code, and add the function name "function-a" to obtain the proxy function 1.2 corresponding to function 1.2. The proxy function 1.2 then includes the business code for generating the order, and the function name of the proxy function 1.2 is "function-a". Similarly, for function 2.0, the electronic device can generate the proxy function 2.0 corresponding to function 2.0.

[0313] S1004. Weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function to obtain the full compiled file of the target application.

[0314] For any third functional component, the third functional component may include a second functional function.

[0315] Optionally, the code file of the third functional component corresponding to the third pointcut function can be woven between the third pointcut function and the proxy function to obtain a full compiled file in the following manner: a fifth call relationship is established between the third pointcut function and the second functional function, and a sixth call relationship is established between the second functional function and the proxy function, so as to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function to obtain a full compiled file.

[0316] Optionally, for any third cutoff function, the electronic device can determine the function name of the second function and add the function name of the second function to the third cutoff function so that the third cutoff function can call the second function, that is, establish a fifth calling relationship between the third cutoff function and the second function.

[0317] Optionally, a sixth calling relationship can be established between the second functional function and the proxy function through a public function. This sixth calling relationship can include sub-call relationships between the second functional function and the public function, as well as sub-call relationships between the public function and the proxy function. The public function can be an empty function.

[0318] The electronic device can determine the name of the public function and add the name of the public function to the second function so that the second function can call the public function, that is, establish a sub-call relationship between the second function and the public function; the electronic device can determine the name of the proxy function and add the name of the proxy function to the public function so that the public function can call the proxy function, that is, establish a sub-call relationship between the public function and the proxy function.

[0319] For any third pointcut function, a fifth call relationship is established between the third pointcut function and the second functional function in the code file of the second functional component corresponding to the third pointcut function, and a sixth call relationship is established between the second functional function and the proxy function. That is, the code file of the third functional component corresponding to the third pointcut function is woven into the third pointcut function and the proxy function.

[0320] For example, if there are two third-point function functions, function 1.2 and function 2.0, and if the third functional component corresponding to function 1.2 is a logging component, and the proxy function corresponding to function 1.2 is proxy function 1.2, then the electronic device can determine the second functional function as the logging function in the logging component. The electronic device can add the function name of the logging function to function 1.2 to establish a fifth call relationship 1 between function 1.2 and the logging function. The electronic device can determine the function name of the public function and add the function name of the public function to the logging function to establish a sub-call relationship between the logging function and the public function. It can also determine the function name of proxy function 1.2 and add the function name of proxy function 1.2 to the public function to establish a sub-call relationship between the public function and proxy function 1.2, thereby establishing a sixth call relationship 1 between the logging function and proxy function 1.2. The electronic device establishes a fifth call relationship 1 between function 1.2 and the logging function, and a sixth call relationship 1 between the logging function and the proxy function 1.2, which means weaving the code file of the logging component between function 1.2 and the proxy function 1.2.

[0321] Similarly, if the third functional component corresponding to function 2.0 is the permission verification component, and the proxy function corresponding to function 2.0 is the proxy function 2.0, then the electronic device can determine the permission verification function in the permission verification component, and establish a fifth call relationship 2 between function 2.0 and the permission verification function, and a sixth call relationship 2 between the permission verification function and the proxy function 2.0, thereby realizing the weaving of the permission verification component's code file between function 2.0 and the proxy function 2.0.

[0322] By weaving the code file of the logging component between function 1.2 and proxy function 1.2, and the code file of the permission verification component between function 2.0 and proxy function 2.0, the electronic device can obtain the full compiled file of the target application.

[0323] In this embodiment, the electronic device can respond to a fourth compilation instruction for the target application to obtain the source code file and a third code file set corresponding to the target application. The electronic device can determine at least one third pointcut function corresponding to the third functional component in the source code file based on the code file of at least one third functional component in the third code file set, and generate a proxy function corresponding to the third pointcut function. Then, the code file of the third functional component corresponding to the third pointcut function can be woven between the third pointcut function and the proxy function to obtain the full compiled file of the target application. Through the technical solution of this embodiment, by generating a proxy function corresponding to the pointcut function based on the pointcut function and weaving the code file of the functional component corresponding to the pointcut function between the pointcut function and the proxy function to obtain the full compiled file of the target application, it is possible to achieve the goal of not modifying the source code of the application development platform's tool library, enabling the full compiled file to support AOP implementation in the target application and improving the development efficiency of the target application.

[0324] In real-world scenarios, the target application can be a cloud application developed using the cross-platform application development framework Flutter. Below, we will provide a compilation method, using the example of a cloud application developed using the Flutter framework.

[0325] Figure 11 A flowchart illustrating a compilation method provided for an exemplary embodiment of this application. Figure 7 Please see. Figure 11 The method may include:

[0326] S1101, respond to the first compilation instruction for the target cloud application, and obtain the first set of code files and historical compilation files corresponding to the target cloud application.

[0327] The target application can be an application that does not support AOP. For example, the target application can be a cloud application developed based on the cross-platform application development framework Flutter.

[0328] The first set of code files may include code files for each of the first functional components in at least one first functional component.

[0329] For example, if at least one first functional component may include a logging component and an authorization verification component, then the first set of code files may include code files for the logging component and code files for the authorization verification component.

[0330] Historical compilation files refer to the compilation files obtained from the last compilation of the target application. If the last compilation was a full compilation, the historical compilation files can be the compilation files obtained from compiling the source code files of the target cloud application in the last compilation; if the last compilation was an incremental compilation, the historical compilation files can be the compilation files obtained from compiling the original compilation files of the target cloud application and the code files of each functional component in the code file set in the last compilation.

[0331] The electronic device can store a set of initial code files and historical compiled files for the target cloud application. The electronic device can respond to an initial compilation instruction for the target cloud application and retrieve the initial set of code files and historical compiled files for the target cloud application.

[0332] For example, if the target cloud application is a Wuying Cloud PC application, and the current version number of the Wuying Cloud PC application is 2.0, and if the historical compiled file of the Wuying Cloud PC application is compiled file 2.0, then the electronic device can respond to the first compilation instruction for the Wuying Cloud PC application to obtain the first set of code files and compiled file 2.0 corresponding to the Wuying Cloud PC application. The first set of code files may include code file 1 of the logging component 3.0 and code file 2 of the permission verification component 2.0. Both the logging component 3.0 and the permission verification component 2.0 are first functional components.

[0333] S1102. Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated in at least one first functional component.

[0334] The functional component to be updated can be the first functional component whose code file has changed compared to the last compilation.

[0335] For example, if the first set of code files includes code file 1 of logging component 3.0 and code file 2 of permission verification component 2.0, and both logging component 3.0 and permission verification component 2.0 are first functional components, if the code file of logging component 3.0 has changed compared to the last compilation, the electronic device can determine that logging component 3.0 is a functional component to be updated; if the code file of permission verification component 2.0 has not changed compared to the last compilation, the electronic device can determine that permission verification component 2.0 is not a functional component to be updated.

[0336] S1103. Weave the code files of the functional components to be updated from the first code file set into the historical compilation files to obtain the first target compilation file corresponding to the target cloud application.

[0337] Optionally, the first target compilation file of the target cloud application can be obtained by weaving the code files of the functional components to be updated from the first code file set into the historical compilation files as follows: In the historical compilation files, determine the first pointcut function corresponding to the functional components to be updated, and the current proxy function corresponding to the first pointcut function; weave the code files of the functional components to be updated between the first pointcut function corresponding to the functional components to be updated and the current proxy function to obtain the first target compilation file.

[0338] In the compiled history, each first pointcut function has a corresponding current proxy function. The first pointcut function can be a function that conforms to the pointcut expression; the current proxy function can be a function generated based on the first pointcut function, and it is the object on which the functional component actually operates. The current proxy function includes the business code used to execute the business logic.

[0339] Because the code files of the functional components to be updated are woven into the historical compilation files of the target cloud application, without weaving in the code files of the functional components that have not been updated, this compilation method can be called incremental compilation, and the first target compilation file obtained is the incremental compilation file.

[0340] The first target compilation file can support running the target cloud application. The version of the first target compilation file is the compiled version, which is higher than the version of the historical compilation files.

[0341] For example, if the historical compiled file is compiled file 2.0, the functional component to be updated is logging component 3.0, and the first pointcut function corresponding to the functional component to be updated is function 1, then the electronic device can determine the current proxy function corresponding to function 1 in compiled file 2.0. Assuming that the current proxy function corresponding to function 1 is proxy function 1, the electronic device can weave in the code file of logging component 3.0 corresponding to function 1 based on function 1 and proxy function 1 to obtain compiled file 3.0. Compiled file 3.0 is the first target compiled file. Compiled file 3.0 can be used to support the running of Wuying Cloud PC application. When Wuying Cloud PC application runs based on compiled file 3.0, the current version number of Wuying Cloud PC application changes to 3.0.

[0342] In this embodiment, the electronic device can respond to a first compilation instruction for a target cloud application to obtain a first set of code files and historical compilation files corresponding to the target cloud application. The electronic device can determine the functional component to be updated from at least one first functional component based on the code files of at least one first functional component in the first set of code files, and weave the code files of the functional component to be updated from the first set of code files into the historical compilation files to obtain the first target compilation file of the target cloud application. Through the compilation method of this application, it is possible to achieve AOP implementation of the first target compilation file without modifying the source code of the Flutter utility library; and by weaving the code files of the functional component to be updated into the historical compilation files of the target cloud application, incremental compilation is achieved without recompiling the code files of the unupdated functional components, thus comprehensively improving the development efficiency of applications based on Flutter.

[0343] It should be noted that the steps in any of the above embodiments are implemented using compilation tools. For example... Figure 12 , Figure 12 This is a schematic diagram of a compilation tool provided for an exemplary embodiment of this application. Please see below. Figure 12 A target application based on Flutter can have a corresponding first file, which can be a historical compilation file, an initial compilation file, or a source code file of the target application.

[0344] The compilation tool may include a compiler converter, and the electronic device may execute or call the compiler converter to perform the steps in the corresponding embodiment on the first file, thereby compiling a second file based on the first file.

[0345] For example, for Figure 2 , Figure 3 or Figure 11 In this example, the first file can be a historical compilation file, and the second file can be a first target compilation file; for Figure 5 In this example, the first file can be an initial compilation file, and the second file can be a second target compilation file; for Figure 7 In this example, the first file can be an initial compilation file, and the second file can be a third target compilation file; for Figure 9 In this example, the first file can be an application file, and the second file can be a target compiled file; for Figure 10 In this example, the first file can be a source code file, and the second file can be a fully compiled file.

[0346] Figure 13 This is a schematic diagram of a compilation apparatus provided for an exemplary embodiment of this application. Please refer to... Figure 13The compilation device 10 includes: an acquisition module 11, a first determination module 12, and a weaving module 13, wherein,

[0347] The acquisition module 11 is used to, in response to a first compilation instruction for the target application, acquire a first set of code files and historical compilation files corresponding to the target application, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained by compiling the files corresponding to the target application last time.

[0348] The first determining module 12 is configured to determine, based on the code files of at least one first functional component in the first code file set, a functional component to be updated from the at least one first functional component, wherein the functional component to be updated is a first functional component whose code file has changed compared to the last compilation.

[0349] The weaving module 13 is used to weave the code files of the functional components to be updated from the first code file set into the historical compilation file to obtain the first target compilation file of the target application.

[0350] The compilation apparatus provided in this application embodiment can execute the technical solutions shown in the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0351] In one possible implementation, the weaving module 13 is specifically used for:

[0352] In the historical compilation file, the first pointcut function corresponding to the functional component to be updated and the current proxy function corresponding to the first pointcut function are determined. The first pointcut function is a function that conforms to the pointcut expression, and the current proxy function is a function generated based on the first pointcut function.

[0353] The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

[0354] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the historical compilation file includes the call relationship between the first pointcut function and the functional function to be updated, and the call relationship between the public function corresponding to the current proxy function and the current proxy function; the weaving module 13 is specifically used for:

[0355] A first calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first pointcut function corresponding to the function to be updated and the current proxy function, thereby obtaining the first target compiled file.

[0356] In one possible implementation, the first determining module 12 is specifically used for:

[0357] Based on the code file of the at least one first functional component, determine the first pointcut function corresponding to the at least one first functional component in the historical compilation file;

[0358] For any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function;

[0359] If the historical functional component corresponding to the first cutoff function is inconsistent with the first functional component corresponding to the first cutoff function, then among the at least one first functional component, the first functional component corresponding to the first cutoff function is determined as the functional component to be updated.

[0360] The compilation apparatus provided in this application embodiment can execute the technical solutions shown in the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0361] Figure 14 A schematic diagram of another compilation apparatus provided for an exemplary embodiment of this application. Please refer to... Figure 14 ,exist Figure 13 Based on the illustrated embodiment, the compilation device 10 may further include: a second determining module 14.

[0362] The acquisition module 11 is further configured to, in response to a second compilation instruction for the target application, acquire a first set of code files and an initial compilation file corresponding to the target application, wherein the initial compilation file is obtained based on the sub-source code update file and the sub-historical compilation file of the target application, wherein the sub-source code update file is a sub-source code file that has changed compared to the previous compilation, and the sub-historical compilation file is a sub-compiled file obtained by compiling the sub-source code file in the previous compilation, wherein the sub-source code file corresponding to the sub-historical compilation file has not changed compared to the previous compilation;

[0363] The first determining module 12 is further configured to determine, based on the code files of at least one first functional component in the first code file set, the functional component to be updated among the at least one first functional component;

[0364] The second determining module 14 is used to determine, in the initial compilation file, a first update point function corresponding to the functional component to be updated, based on the functional component to be updated. The first update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0365] The weaving module 13 is further configured to weave the code file of the functional component to be updated corresponding to the first update pointcut function into the initial compilation file to obtain the second target compilation file of the target application.

[0366] In one possible implementation, the weaving module 13 is specifically used for:

[0367] In the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function;

[0368] The code file of the functional component to be updated is woven between the first update point function and the first proxy function to obtain the second target compiled file.

[0369] In one possible implementation, the code file of the functional component to be updated includes the functional function to be updated; the initial compilation file includes the calling relationship between the public function corresponding to the first proxy function and the first proxy function; the weaving module 13 is specifically used for:

[0370] A second calling relationship is established between the first update pointcut function and the function to be updated, and a third calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first update pointcut function and the first proxy function, thereby obtaining the second target compiled file.

[0371] In one possible implementation, the first update point function includes business update code for performing business operations; the weaving module 13 is specifically used for:

[0372] The business update code is determined in the first update point function of the initial compilation file;

[0373] Based on the business update code, the business code in the current proxy function corresponding to the first update point function is updated to obtain the first proxy function, which includes the business update code.

[0374] In one possible implementation, the compilation device 10 further includes a third determining module 15.

[0375] The acquisition module 11 is further configured to, in response to a third compilation instruction for the target application, acquire a second set of code files corresponding to the target application and the initial compilation file, wherein the second set of code files includes code files of each of the second functional components in at least one second functional component;

[0376] The second determining module 14 is further configured to determine, in the initial compilation file, a second pointcut function corresponding to at least one second functional component based on the code file of at least one second functional component in the second code file set;

[0377] The third determining module 15 is used to determine at least one second update point function in the second point function corresponding to the at least one second functional component, wherein the second update point function is the point function in the sub-source code update file that has changed compared to the previous compilation.

[0378] The weaving module 13 is further configured to weave the code file of the second functional component corresponding to the second update pointcut function into the initial compilation file to obtain the third target compilation file of the target application.

[0379] In one possible implementation, the weaving module 13 is specifically used for:

[0380] In the initial compilation file, the current proxy function corresponding to the second update pointcut function is updated according to the second update pointcut function to obtain the second proxy function;

[0381] The code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third target compiled file.

[0382] In one possible implementation, the second functional component includes a first functional function; the initial compilation file includes the calling relationship between the first functional function and the second proxy function; the weaving module 13 is specifically used for:

[0383] A fourth calling relationship is established between the second update pointcut function and the first function, so as to weave the code file of the second function corresponding to the second update pointcut function between the second update pointcut function and the second proxy function, thereby obtaining the third target compiled file.

[0384] In one possible implementation, the third determining module 15 is specifically used for:

[0385] For any second pointcut function, the historical proxy function corresponding to the second pointcut function is retrieved from the preset storage space according to the function identifier corresponding to the second pointcut function;

[0386] If the historical proxy function is inconsistent with the business code in the second pointcut function, then the second pointcut function is determined as the second update pointcut function.

[0387] In one possible implementation, the compilation apparatus 10 further includes a generation module 16.

[0388] The acquisition module 11 is further configured to, in response to a fourth compilation instruction for the target application, acquire the source code file and a third code file set corresponding to the target application, wherein the third code file set includes the code file of each third functional component in at least one third functional component;

[0389] The second determining module 14 is further configured to determine, based on the code file of at least one third functional component in the third code file set, the third pointcut function corresponding to the at least one third functional component in the source code file;

[0390] The generation module 16 is used to generate a proxy function corresponding to the third point-point function based on the third point-point function.

[0391] The weaving module 13 is further configured to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, so as to obtain the full compiled file of the target application.

[0392] In one possible implementation, the third functional component includes a second functional function; the weaving module 13 is specifically used for:

[0393] A fifth calling relationship is established between the third pointcut function and the second functional function, and a sixth calling relationship is established between the second functional function and the proxy function, so as to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, thereby obtaining the full compiled file.

[0394] The compilation apparatus provided in this application embodiment can execute the technical solutions shown in the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0395] Figure 15 This is a schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this application. Please refer to... Figure 15 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.

[0396] The memory 22 stores computer-executed instructions;

[0397] The processor 21 executes the computer execution instructions stored in the memory 22, causing the processor 21 to perform the method as shown in the above method embodiment.

[0398] Accordingly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the above-described method embodiments.

[0399] Accordingly, embodiments of this application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the methods shown in the above-described method embodiments.

[0400] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0401] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0402] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0403] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0404] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0405] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0406] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0407] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0408] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A compilation method, characterized in that, For compiling for a target application, the target application including at least one functional component, the functional component being compiled and inserted into the target application via aspect-oriented programming (AOP), the method comprising: In response to a first compilation instruction for the target application, a first set of code files and historical compilation files corresponding to the target application are obtained, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application; Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated from the at least one first functional component, wherein the functional component to be updated is the first functional component whose code file has changed compared to the last compilation. The code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file of the target application.

2. The method according to claim 1, characterized in that, The code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file of the target application, including: In the historical compilation file, the first pointcut function corresponding to the functional component to be updated and the current proxy function corresponding to the first pointcut function are determined. The first pointcut function is a function that conforms to the pointcut expression, and the current proxy function is a function generated based on the first pointcut function. The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file.

3. The method according to claim 2, characterized in that, The code file of the functional component to be updated includes the functional function to be updated; the historical compilation file includes the call relationship between the first pointcut function and the functional function to be updated, as well as the call relationship between the public function corresponding to the current proxy function and the current proxy function; The code file of the functional component to be updated is woven between the first pointcut function corresponding to the functional component to be updated and the current proxy function to obtain the first target compiled file, including: A first calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first pointcut function corresponding to the function to be updated and the current proxy function, thereby obtaining the first target compiled file.

4. The method according to any one of claims 1-3, characterized in that, Based on the code files of at least one first functional component in the first set of code files, the functional component to be updated is determined from the at least one first functional component, including: Based on the code file of the at least one first functional component, determine the first pointcut function corresponding to the at least one first functional component in the historical compilation file; For any first pointcut function, obtain the historical functional component corresponding to the first pointcut function based on the function identifier of the first pointcut function; If the historical functional component corresponding to the first cutoff function is inconsistent with the first functional component corresponding to the first cutoff function, then among the at least one first functional component, the first functional component corresponding to the first cutoff function is determined as the functional component to be updated.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: In response to a second compilation instruction for the target application, a first set of code files and an initial compilation file corresponding to the target application are obtained. The initial compilation file is obtained based on the sub-source code update file and the sub-historical compilation file of the target application. The sub-source code update file is the sub-source code file that has changed compared to the previous compilation. The sub-historical compilation file is the sub-compiled file obtained by compiling the sub-source code file in the previous compilation. The sub-source code file corresponding to the sub-historical compilation file has not changed compared to the previous compilation. Based on the code file of at least one first functional component in the first set of code files, determine the functional component to be updated from the at least one first functional component; Based on the functional component to be updated, a first update point function corresponding to the functional component to be updated is determined in the initial compilation file. The first update point function is the point function in the sub-source code update file that has changed compared to the previous compilation. The code file of the functional component to be updated corresponding to the first update pointcut function is woven into the initial compilation file to obtain the second target compilation file of the target application.

6. The method according to claim 5, characterized in that, The code file of the functional component to be updated corresponding to the first update pointcut function is woven into the initial compilation file to obtain the second target compilation file of the target application, including: In the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function; The code file of the functional component to be updated is woven between the first update point function and the first proxy function to obtain the second target compiled file.

7. The method according to claim 6, characterized in that, The code file of the functional component to be updated includes the functional function to be updated; the initial compilation file includes the calling relationship between the public function corresponding to the first proxy function and the first proxy function; The code file of the functional component to be updated is woven between the first update pointcut function and the first proxy function to obtain the second target compiled file, including: A second calling relationship is established between the first update pointcut function and the function to be updated, and a third calling relationship is established between the function to be updated and the public function, so as to weave the code file of the function to be updated between the first update pointcut function and the first proxy function, thereby obtaining the second target compiled file.

8. The method according to claim 6 or 7, characterized in that, In the initial compilation file, the current proxy function corresponding to the first update pointcut function is updated according to the first update pointcut function to obtain the first proxy function, including: The business update code is determined in the first update point function of the initial compilation file; Based on the business update code, the business code in the current proxy function corresponding to the first update point function is updated to obtain the first proxy function, which includes the business update code.

9. The method according to any one of claims 5-8, characterized in that, The method further includes: In response to a third compilation instruction for the target application, a second set of code files corresponding to the target application and the initial compilation file are obtained, wherein the second set of code files includes code files of each of the second functional components in at least one second functional component; Based on the code file of at least one second functional component in the second code file set, determine the second pointcut function corresponding to at least one second functional component in the initial compilation file; At least one second update point function is determined from the second point function corresponding to the at least one second functional component. The second update point function is the point function in the sub-source code update file that has changed compared to the previous compilation. The code file of the second functional component corresponding to the second update pointcut function is woven into the initial compilation file to obtain the third target compilation file of the target application.

10. The method according to claim 9, characterized in that, The code file of the second functional component corresponding to the second update pointcut function is woven into the initial compilation file to obtain the third target compilation file of the target application, including: In the initial compilation file, the current proxy function corresponding to the second update pointcut function is updated according to the second update pointcut function to obtain the second proxy function; The code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third target compiled file.

11. The method according to claim 10, characterized in that, The second functional component includes a first functional function; the initial compilation file includes the call relationship between the first functional function and the second proxy function; the code file of the second functional component corresponding to the second update pointcut function is woven between the second update pointcut function and the second proxy function to obtain the third compilation file, which includes: A fourth calling relationship is established between the second update pointcut function and the first function, so as to weave the code file of the second function corresponding to the second update pointcut function between the second update pointcut function and the second proxy function, thereby obtaining the third target compiled file.

12. The method according to any one of claims 9-11, characterized in that, Determining at least one second update point function in the second point function corresponding to the at least one second functional component includes: For any second pointcut function, obtain the historical proxy function corresponding to the second pointcut function based on the function identifier corresponding to the second pointcut function; If the historical proxy function is inconsistent with the business code in the second pointcut function, then the second pointcut function is determined as the second update pointcut function.

13. The method according to any one of claims 1-12, characterized in that, The method further includes: In response to a fourth compilation instruction for the target application, the source code file and a third code file set corresponding to the target application are obtained, wherein the third code file set includes the code file of each third functional component in at least one third functional component; Based on the code file of at least one third functional component in the third code file set, determine the third pointcut function corresponding to the at least one third functional component in the source code file; Generate a proxy function corresponding to the third point-point function based on the third point-point function; The code file of the third functional component corresponding to the third pointcut function is woven between the third pointcut function and the proxy function to obtain the full compiled file of the target application.

14. The method according to claim 13, characterized in that, The third functional component includes a second functional function; the code file of the third functional component corresponding to the third pointcut function is woven between the third pointcut function and the proxy function to obtain the full compiled file, including: A fifth calling relationship is established between the third pointcut function and the second functional function, and a sixth calling relationship is established between the second functional function and the proxy function, so as to weave the code file of the third functional component corresponding to the third pointcut function between the third pointcut function and the proxy function, thereby obtaining the full compiled file.

15. A compilation method, characterized in that, This method is used to compile a target cloud application, which is a cloud application developed based on the cross-platform application development framework Flutter. The target cloud application includes at least one functional component, which is compiled and inserted into the target cloud application using aspect-oriented programming (AOP). The method includes: In response to a first compilation instruction for the target cloud application, a first set of code files and historical compilation files corresponding to the target cloud application are obtained, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application; Based on the code file of at least one first functional component in the first code file set, determine the functional component to be updated from the at least one first functional component, wherein the functional component to be updated is the first functional component whose code file has changed compared to the last compilation. The code files of the functional components to be updated from the first set of code files are woven into the historical compilation files to obtain the first target compilation file corresponding to the target cloud application.

16. A compilation apparatus, characterized in that, For compiling for a target application, the target application including at least one functional component, the functional component being compiled and inserted into the target application using aspect-oriented programming (AOP), the apparatus includes: an acquisition module, a first determination module, and an weaving module, wherein... The acquisition module is used to, in response to a first compilation instruction for the target application, acquire a first set of code files and historical compilation files corresponding to the target application, wherein the first set of code files includes code files of each first functional component in at least one first functional component, and the historical compilation files are compilation files obtained from the previous compilation of the files corresponding to the target application; The first determining module is configured to determine, based on the code files of at least one first functional component in the first code file set, a functional component to be updated from the at least one first functional component, wherein the functional component to be updated is a first functional component whose code file has changed compared to the last compilation. The weaving module is used to weave the code files of the functional components to be updated from the first set of code files into the historical compilation files to obtain the first target compilation file of the target application.

17. An electronic device, characterized in that, include: At least one processor; as well as A memory that is communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the method according to any one of claims 1-15.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-15.

19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-15.