A project dependent compilation method, system and medium

By analyzing the dependency relationship of the target project, first compiling the dependency project is completed and then compiling the target project, the problems of low compilation efficiency and high error rate in the existing technology are solved, and the effect of efficient compilation and dynamic early warning is achieved.

CN118151947BActive Publication Date: 2025-01-17北京中科昊芯科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410391405.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2025-01-17
Estimated Expiration
2044-04-02

AI Technical Summary

Technical Problem

The existing compilers do not support concurrent compilation, resulting in low efficiency and occupancy of many compilation resources for independent compilation, which cannot effectively solve the problem of compilation errors.

Method used

By analyzing the dependencies of the target project, first compile the dependency project and then compile the target project, establish a compiled collection and compile it in order of correlation, and transmit the compile status prompt information in real time to dynamically alert and quickly query the error location.

Benefits of technology

Improves compilation efficiency, reduces error rate, and realizes dynamic early warning of compilation status and fast error query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118151947B_ABST
    Figure CN118151947B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a project dependency compilation method, system and medium, the method comprising: responding to a compilation request, obtaining development files of each module in a target project, and analyzing dependent modules corresponding to each module based on the development files; establishing a compilation set based on the dependency relationship between the dependent modules and the target project, the compilation set including a plurality of dependent projects; obtaining dependent projects in the compilation set based on the dependency relationship, and analyzing the correlation between the dependent projects and the target project; adding and compiling all dependent projects in order of correlation to obtain a compilation result; prompting and warning the compilation status of the target project based on the compilation result, obtaining prompt information, and transmitting the prompt information to a terminal in real time; by analyzing the dependency relationship of the target project, first compiling the dependent projects and then compiling the target project, thereby improving compilation efficiency and reducing error rate, and dynamically warning the compilation status and quickly querying the error location.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of engineering compilation technology, and in particular to an engineering dependency compilation method, system and medium. Background Art

[0002] After the project development is completed, it needs to be compiled and compiled without errors before it can be released for use in the production environment. Currently, the compiler does not support concurrent compilation. Compiling multiple projects independently is not only inefficient, but also takes up a lot of compilation resources. For the above problems, effective technical solutions are urgently needed. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a project dependency compilation method, system and medium, which analyzes the dependency relationship of a target project, first compiles the dependent project, and then compiles the target project, thereby improving compilation efficiency and reducing error rate, while providing dynamic warnings on the compilation status and quickly querying the error location.

[0004] The present application also provides a method for compiling project dependencies, including:

[0005] Respond to compilation requests, obtain development files of each module in the target project, and analyze dependent modules corresponding to each module based on the development files;

[0006] Establishing a compilation set based on the dependency relationship between the dependent module and the target project, the compilation set including a plurality of dependent projects;

[0007] Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, add and compile all dependent projects in order of correlation, and obtain compilation results;

[0008] Based on the compilation result, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time.

[0009] Optionally, in the project dependency compilation method described in the embodiment of the present application, in response to a compilation request, obtaining development files of each module in the target project, and analyzing dependent modules corresponding to each module based on the development files specifically include:

[0010] Generate compilation instructions based on compilation requests, and call the configuration interface according to the compilation instructions to configure parameters of the target project;

[0011] Based on the target project after parameter configuration, all development modules in the target project are obtained, and module parameters are configured to generate development files matching the development modules;

[0012] Analyze the dependencies between different development modules and the dependencies between development files and different development modules based on module parameters to obtain a dependency set;

[0013] Generates a matching dependency module for each development module based on the dependency set.

[0014] Optionally, in the project dependency compilation method described in the embodiment of the present application, a compilation set is established based on the dependency relationship between the dependent module and the target project, and the compilation set includes several dependent projects, specifically including:

[0015] Get the source code of the dependent module, add code based on the source code, and generate intermediate code;

[0016] Analyze the syntax and semantic information of the intermediate code to see if there are any errors;

[0017] If an error occurs, recompile the current dependent module;

[0018] If no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code;

[0019] Get the dependent projects corresponding to several dependent modules based on the target code.

[0020] Optionally, in the project dependency compilation method described in the embodiment of the present application, dependent projects in the compilation set are obtained based on the dependency relationship, the correlation between the dependent projects and the target project is analyzed, and all dependent projects are added and compiled in order of correlation to obtain the compilation result, which specifically includes:

[0021] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0022] Sort the compilation of dependent projects according to the degree of relevance and set the number of splits;

[0023] Split the dependent projects according to the number of splits to obtain multiple compilation groups;

[0024] Synchronously compile dependent projects in the same compilation group based on the order of relevance;

[0025] After the dependent projects in all compilation groups are compiled, the different compilation groups are integrated to obtain the compilation results.

[0026] Optionally, in the project-dependent compilation method described in the embodiment of the present application, a compilation status warning for the target project is prompted based on the compilation result, prompt information is obtained, and the prompt information is transmitted to the terminal in real time, specifically including:

[0027] Analyze the compilation results of each dependent project in order, and obtain the compilation status of each dependent project based on the compilation results;

[0028] Get the compilation status of the target project based on the compilation status of the dependent functions;

[0029] If the compilation result of a dependent project is abnormal, the compilation of subsequent dependent projects will be suspended according to the compilation order of the current dependent project, and an intermediate warning message will be generated;

[0030] Based on the intermediate warning information, the compilation status of the target project is updated and prompted, prompt information is obtained, and the prompt information is transmitted to the terminal for display.

[0031] Optionally, in the project dependency compilation method described in the embodiment of the present application, after obtaining the dependent projects in the compilation set based on the dependency relationship and analyzing the correlation between the dependent projects and the target project, the method further includes:

[0032] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0033] Determining whether the correlation degree is greater than or equal to a set correlation degree threshold;

[0034] If it is greater than or equal to, a dependency relationship between the dependent project and the target project is generated;

[0035] If it is less than, the corresponding dependent project will be removed.

[0036] In a second aspect, an embodiment of the present application provides a project-dependent compilation system, the system comprising: a memory and a processor, the memory comprising a program of a project-dependent compilation method, and the program of the project-dependent compilation method is executed by the processor to implement the following steps:

[0037] Respond to compilation requests, obtain development files of each module in the target project, and analyze dependent modules corresponding to each module based on the development files;

[0038] Establishing a compilation set based on the dependency relationship between the dependent module and the target project, wherein the compilation set includes a plurality of dependent projects;

[0039] Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, add and compile all dependent projects in order of correlation, and obtain compilation results;

[0040] Based on the compilation result, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time.

[0041] Optionally, in the project dependency compilation system described in the embodiment of the present application, in response to a compilation request, obtaining development files of each module in the target project, and analyzing dependent modules corresponding to each module based on the development files specifically include:

[0042] Generate compilation instructions based on compilation requests, and call the configuration interface according to the compilation instructions to configure parameters of the target project;

[0043] Based on the target project after parameter configuration, all development modules in the target project are obtained, and module parameters are configured to generate development files matching the development modules;

[0044] Analyze the dependencies between different development modules and the dependencies between development files and different development modules based on module parameters to obtain a dependency set;

[0045] Generates a matching dependency module for each development module based on the dependency set.

[0046] Optionally, in the project dependency compilation system described in the embodiment of the present application, a compilation set is established based on the dependency relationship between the dependent module and the target project, and the compilation set includes several dependent projects, specifically including:

[0047] Get the source code of the dependent module, add code based on the source code, and generate intermediate code;

[0048] Analyze the syntax and semantic information of the intermediate code to see if there are any errors;

[0049] If an error occurs, recompile the current dependent module;

[0050] If no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code;

[0051] Get the dependent projects corresponding to several dependent modules based on the target code.

[0052] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes an engineering-dependent compilation method program. When the engineering-dependent compilation method program is executed by a processor, the steps of the engineering-dependent compilation method as described in any one of the above items are implemented.

[0053] As can be seen from the above, an engineering dependency compilation method, system and medium provided in an embodiment of the present application obtain development files of each module in a target project by responding to a compilation request, and analyzes dependent modules corresponding to each module based on the development files; establishes a compilation set based on the dependency relationship between the dependent module and the target project, wherein the compilation set includes several dependent projects; obtains dependent projects in the compilation set based on the dependency relationship, and analyzes the correlation between the dependent project and the target project; adds and compiles all dependent projects in order of correlation to obtain a compilation result; based on the compilation result, issues an early warning for the compilation status of the target project, obtains prompt information, and transmits the prompt information to a terminal in real time; in the compilation process of the target project, by analyzing the dependency relationship of the target project, the dependent project is compiled first, and then the target project is compiled, thereby improving compilation efficiency and reducing error rate, and at the same time, dynamically issues an early warning for the compilation status and quickly queries the error location. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A flowchart of the engineering dependency compilation method provided in an embodiment of the present application;

[0056] Figure 2 A flow chart of a method for obtaining dependent modules based on dependency relationships of an engineering dependency compilation method provided in an embodiment of the present application;

[0057] Figure 3 A flow chart of a method for obtaining dependent projects of a project dependency compilation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0059] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0060] Please refer to Figure 1 , Figure 1 1 is a flowchart of a method for compiling project dependencies in some embodiments of the present application. The method for compiling project dependencies is used in a terminal device, and the method for compiling project dependencies includes the following steps:

[0061] S101, responding to a compilation request, obtaining development files of each module in a target project, and analyzing dependent modules corresponding to each module based on the development files;

[0062] S102, establishing a compilation set based on the dependency relationship between the dependent module and the target project, the compilation set including a plurality of dependent projects;

[0063] S103, obtaining dependent projects in the compilation set based on the dependency relationship, analyzing the correlation between the dependent projects and the target project, and adding and compiling all the dependent projects in order of correlation to obtain a compilation result;

[0064] S104, based on the compilation result, a compilation status warning is given to the target project, prompt information is obtained, and the prompt information is transmitted to the terminal in real time.

[0065] It should be noted that the target project's dependent projects are analyzed based on the dependency relationship. The target project is compiled after the dependent projects are compiled. When one of the dependent projects has an exception, the compilation of subsequent dependent projects is stopped. This can effectively determine the location of the exception, make improvements in time, and improve the compilation accuracy.

[0066] Please refer to Figure 2 , Figure 2 This is a flow chart of a method for obtaining dependent modules based on dependency relationships in a project dependency compilation method in some embodiments of the present application. According to an embodiment of the present invention, in response to a compilation request, the development files of each module in the target project are obtained, and the dependent modules corresponding to each module are analyzed based on the development files, specifically including:

[0067] S201, generating a compile instruction based on a compile request, and calling a configuration interface according to the compile instruction to configure parameters of a target project;

[0068] S202, obtaining all development modules in the target project based on the target project after parameter configuration, configuring module parameters, and generating development files matching the development modules;

[0069] S203, analyzing the dependency relationships between different development modules and the dependency relationships between development files and different development modules based on the module parameters to obtain a dependency relationship set;

[0070] S204, generating a dependent module matching each development module based on the dependency relationship set.

[0071] It should be noted that according to different compilation instructions, the configuration interface is operated to achieve parameter configuration, different development files are generated according to different parameter configurations, and the dependency modules of the target project are established by analyzing the dependency relationships between different development modules, thereby improving the project compilation efficiency.

[0072] Please refer to Figure 3 , Figure 3 This is a flow chart of a method for obtaining a dependent project of a project dependency compilation method in some embodiments of the present application. According to an embodiment of the present invention, a compilation set is established based on the dependency relationship between the dependent module and the target project. The compilation set includes several dependent projects, specifically including:

[0073] S301, obtaining the source program of the dependent module, adding code based on the source program, and generating intermediate code;

[0074] S302, analyzing whether there are errors in the syntax and semantic information of the intermediate code;

[0075] S303, if an error occurs, recompile the current dependent module;

[0076] S304, if no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code;

[0077] S305, obtaining dependent projects corresponding to several dependent modules based on the target code.

[0078] It should be noted that during the project compilation process, code is continuously added to the source program, and the accuracy of the compiled speech is analyzed. When errors occur in the semantic information, it is recompiled to reduce the compilation error rate.

[0079] According to an embodiment of the present invention, dependent projects in a compilation set are obtained based on dependency relationships, the correlation between the dependent projects and the target project is analyzed, and all dependent projects are added and compiled in order of correlation to obtain a compilation result, which specifically includes:

[0080] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0081] Sort the compilation of dependent projects according to the degree of relevance and set the number of splits;

[0082] Split the dependent projects according to the number of splits to obtain multiple compilation groups;

[0083] Synchronously compile dependent projects in the same compilation group based on the order of relevance;

[0084] After the dependent projects in all compilation groups are compiled, the different compilation groups are integrated to obtain the compilation results.

[0085] It should be noted that grouping dependent projects and compiling them synchronously and concurrently between different groups can improve compilation efficiency and achieve synchronous compilation of multiple dependent projects.

[0086] According to an embodiment of the present invention, based on the compilation result, a compilation status warning of the target project is provided, prompt information is obtained, and the prompt information is transmitted to the terminal in real time, specifically including:

[0087] Analyze the compilation results of each dependent project in sequence according to the compilation order, and obtain the compilation status of each dependent project based on the compilation results;

[0088] Get the compilation status of the target project based on the compilation status of the dependent functions;

[0089] If the compilation result of a dependent project is abnormal, the compilation of subsequent dependent projects will be suspended according to the compilation order of the current dependent project, and an intermediate warning message will be generated;

[0090] Based on the intermediate warning information, the compilation status of the target project is updated and prompted, prompt information is obtained, and the prompt information is transmitted to the terminal for display.

[0091] It should be noted that the dependent projects are compiled in sequence according to the compilation order. When an exception occurs in the current compilation status, subsequent compilation is suspended. This allows the abnormal dependent project and the abnormal location to be accurately determined, and an early warning is issued for the abnormal status, which is displayed in real time on the terminal, so that the abnormal status can be seen intuitively.

[0092] According to an embodiment of the present invention, after obtaining dependent projects in a compilation set based on dependency relationships and analyzing the correlation between the dependent projects and the target projects, the method further includes:

[0093] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0094] Determine whether the correlation is greater than or equal to a set correlation threshold;

[0095] If it is greater than or equal to, a dependency relationship between the dependent project and the target project is generated;

[0096] If it is less than, the corresponding dependent project will be removed.

[0097] It should be noted that by analyzing the correlation between the dependent project and the target project, it is determined whether the dependency relationship meets the requirements, thereby ensuring the accuracy of the selection of the dependent project and the accuracy of the compilation of the target project.

[0098] According to an embodiment of the present invention, all dependent projects are added and compiled in order of relevance, and after the compilation result is obtained, the following is further included:

[0099] Obtain a compiled program based on the compilation result, test the compiled program, and obtain a test result;

[0100] Compare the test results with the set test information to obtain the test accuracy;

[0101] Determine whether the test accuracy meets the requirements;

[0102] If the requirements are met, the target project and the dependent project are paired and stored;

[0103] If the requirements are not met, adjust the compiler program under each dependent project.

[0104] It should be noted that after the compilation is completed, the compiler is tested, and the dependent project corresponding to the target project is saved according to the test results. The next time the same target project is compiled, the corresponding dependent project is directly called to modify the intermediate code to improve the compilation efficiency.

[0105] In a second aspect, an embodiment of the present application provides an engineering dependency compilation system, the system comprising: a memory and a processor, the memory comprising a program of an engineering dependency compilation method, and when the program of the engineering dependency compilation method is executed by the processor, the following steps are implemented:

[0106] Respond to compilation requests, obtain development files of each module in the target project, and analyze dependent modules corresponding to each module based on the development files;

[0107] A compilation set is established based on the dependency relationship between the dependent module and the target project, and the compilation set includes several dependent projects;

[0108] Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, add and compile all dependent projects in order of correlation, and obtain compilation results;

[0109] Based on the compilation result, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time.

[0110] It should be noted that the target project's dependent projects are analyzed based on the dependency relationship. The target project is compiled after the dependent projects are compiled. When one of the dependent projects has an exception, the compilation of subsequent dependent projects is stopped. This can effectively determine the location of the exception, make improvements in time, and improve the compilation accuracy.

[0111] According to an embodiment of the present invention, in response to a compilation request, the development files of each module in the target project are obtained, and the dependent modules corresponding to each module are analyzed based on the development files, specifically including:

[0112] Generate compilation instructions based on compilation requests, and call the configuration interface according to the compilation instructions to configure parameters of the target project;

[0113] Based on the target project after parameter configuration, all development modules in the target project are obtained, and module parameters are configured to generate development files matching the development modules;

[0114] Analyze the dependencies between different development modules and the dependencies between development files and different development modules based on module parameters to obtain a dependency set;

[0115] Generates a matching dependency module for each development module based on the dependency set.

[0116] It should be noted that according to different compilation instructions, the configuration interface is operated to achieve parameter configuration, different development files are generated according to different parameter configurations, and the dependency modules of the target project are established by analyzing the dependency relationships between different development modules, thereby improving the project compilation efficiency.

[0117] According to an embodiment of the present invention, a compilation set is established based on the dependency relationship between the dependent module and the target project. The compilation set includes several dependent projects, specifically including:

[0118] Get the source code of the dependent module, add code based on the source code, and generate intermediate code;

[0119] Analyze the syntax and semantic information of the intermediate code to see if there are any errors;

[0120] If an error occurs, recompile the current dependent module;

[0121] If no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code;

[0122] Get the dependent projects corresponding to several dependent modules based on the target code.

[0123] It should be noted that during the project compilation process, code is continuously added to the source program, and the accuracy of the compiled speech is analyzed. When errors occur in the semantic information, it is recompiled to reduce the compilation error rate.

[0124] According to an embodiment of the present invention, dependent projects in a compilation set are obtained based on dependency relationships, the correlation between the dependent projects and the target project is analyzed, and all dependent projects are added and compiled in order of correlation to obtain a compilation result, which specifically includes:

[0125] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0126] Sort the compilation of dependent projects according to the degree of relevance and set the number of splits;

[0127] Split the dependent projects according to the number of splits to obtain multiple compilation groups;

[0128] Synchronously compile dependent projects in the same compilation group based on the order of relevance;

[0129] After the dependent projects in all compilation groups are compiled, the different compilation groups are integrated to obtain the compilation results.

[0130] It should be noted that grouping dependent projects and compiling them synchronously and concurrently between different groups can improve compilation efficiency and achieve synchronous compilation of multiple dependent projects.

[0131] According to an embodiment of the present invention, based on the compilation result, a compilation status warning of the target project is provided, prompt information is obtained, and the prompt information is transmitted to the terminal in real time, specifically including:

[0132] Analyze the compilation results of each dependent project in order, and obtain the compilation status of each dependent project based on the compilation results;

[0133] Get the compilation status of the target project based on the compilation status of the dependent functions;

[0134] If the compilation result of a dependent project is abnormal, the compilation of subsequent dependent projects will be suspended according to the compilation order of the current dependent project, and an intermediate warning message will be generated;

[0135] Based on the intermediate warning information, the compilation status of the target project is updated and prompted, prompt information is obtained, and the prompt information is transmitted to the terminal for display.

[0136] It should be noted that the dependent projects are compiled in sequence according to the compilation order. When an exception occurs in the current compilation status, subsequent compilation is suspended. This allows the abnormal dependent project and the abnormal location to be accurately determined, and an early warning is issued for the abnormal status, which is displayed in real time on the terminal, so that the abnormal status can be seen intuitively.

[0137] According to an embodiment of the present invention, after obtaining dependent projects in a compilation set based on dependency relationships and analyzing the correlation between the dependent projects and the target projects, the method further includes:

[0138] Obtain parameter information of dependent projects and target projects, and analyze the correlation;

[0139] Determine whether the correlation is greater than or equal to a set correlation threshold;

[0140] If it is greater than or equal to, a dependency relationship between the dependent project and the target project is generated;

[0141] If it is less than, the corresponding dependent project will be removed.

[0142] It should be noted that by analyzing the correlation between the dependent project and the target project, it is determined whether the dependency relationship meets the requirements, thereby ensuring the accuracy of the selection of the dependent project and the accuracy of the compilation of the target project.

[0143] According to an embodiment of the present invention, all dependent projects are added and compiled in order of relevance, and after the compilation result is obtained, the following is further included:

[0144] Obtain a compiled program based on the compilation result, test the compiled program, and obtain a test result;

[0145] Compare the test results with the set test information to obtain the test accuracy;

[0146] Determine whether the test accuracy meets the requirements;

[0147] If the requirements are met, the target project and the dependent project are paired and stored;

[0148] If the requirements are not met, adjust the compiler program under each dependent project.

[0149] It should be noted that after the compilation is completed, the compiler is tested, and the dependent project corresponding to the target project is saved according to the test results. The next time the same target project is compiled, the corresponding dependent project is directly called to modify the intermediate code to improve the compilation efficiency.

[0150] A third aspect of the present invention provides a computer-readable storage medium, which includes an engineering-dependent compilation method program. When the engineering-dependent compilation method program is executed by a processor, the steps of any of the above-mentioned engineering-dependent compilation methods are implemented.

[0151] The invention discloses a method, system and medium for project dependency compilation, which obtain the development files of each module in a target project by defining a monitoring area and responding to a compilation request, and analyze the dependent modules corresponding to each module based on the development files; establish a compilation set based on the dependency relationship between the dependent modules and the target project, and the compilation set includes a plurality of dependent projects; obtain the dependent projects in the compilation set based on the dependency relationship, and analyze the correlation between the dependent projects and the target project; add and compile all the dependent projects in order of correlation to obtain a compilation result; based on the compilation result, give an early warning of the compilation status of the target project, obtain prompt information, and transmit the prompt information to a terminal in real time; in the compilation process of the target project, by analyzing the dependency relationship of the target project, first compile the dependent projects and then compile the target project, so as to improve the compilation efficiency and reduce the error rate, and at the same time, give a dynamic early warning of the compilation status and quickly query the error location.

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

[0153] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0154] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0155] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0156] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A project dependency compilation method, characterized in that: include: Respond to compilation requests, obtain development files of each module in the target project, and analyze dependent modules corresponding to each module based on the development files; Establishing a compilation set based on the dependency relationship between the dependent module and the target project, the compilation set including a plurality of dependent projects; Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, add and compile all dependent projects in order of correlation, and obtain compilation results; Based on the compilation result, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time; A compilation set is established based on the dependency relationship between the dependent module and the target project. The compilation set includes several dependent projects, specifically including: Get the source code of the dependent module, add code based on the source code, and generate intermediate code; Analyze the syntax and semantic information of the intermediate code to see if there are any errors; If an error occurs, recompile the current dependent module; If no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code; Get the dependent projects corresponding to several dependent modules based on the target code; Based on the dependency relationship, the dependent projects in the compilation set are obtained, the correlation between the dependent projects and the target project is analyzed, and all the dependent projects are added and compiled in the order of correlation to obtain the compilation results, including: Obtain parameter information of dependent projects and target projects, and analyze the correlation; Sort the compilation of dependent projects according to the degree of relevance and set the number of splits; Split the dependent projects according to the number of splits to obtain multiple compilation groups; Synchronously compile dependent projects in the same compilation group based on the order of relevance; After all dependent projects in the compilation group are compiled, different compilation groups are integrated to obtain the compilation results; Add and compile all dependent projects in order of relevance. After obtaining the compilation results, it also includes: Obtain a compiled program based on the compilation result, test the compiled program, and obtain a test result; Compare the test results with the set test information to obtain the test accuracy; Determine whether the test accuracy meets the requirements; If the requirements are met, the target project and the dependent project are paired and stored; If the requirements are not met, adjust the compiler program under each dependent project.

2. The engineering dependency compilation method according to claim 1, characterized in that: Respond to compilation requests, obtain the development files of each module in the target project, and analyze the dependent modules corresponding to each module based on the development files, including: Generate compilation instructions based on compilation requests, and call the configuration interface according to the compilation instructions to configure parameters of the target project; Based on the target project after parameter configuration, all development modules in the target project are obtained, and module parameters are configured to generate development files matching the development modules; Analyze the dependencies between different development modules and the dependencies between development files and different development modules based on module parameters to obtain a dependency set; Generates a matching dependency module for each development module based on the dependency set.

3. The engineering dependency compilation method according to claim 2, characterized in that: Based on the compilation results, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time, including: Analyze the compilation results of each dependent project in sequence according to the compilation order, and obtain the compilation status of each dependent project based on the compilation results; Get the compilation status of the target project based on the compilation status of the dependent functions; If the compilation result of a dependent project is abnormal, the compilation of subsequent dependent projects will be suspended according to the compilation order of the current dependent project, and an intermediate warning message will be generated; Based on the intermediate warning information, the compilation status of the target project is updated and prompted, prompt information is obtained, and the prompt information is transmitted to the terminal for display.

4. The engineering dependency compilation method according to claim 3, characterized in that: Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, and also include: Obtain parameter information of dependent projects and target projects, and analyze the correlation; Determining whether the correlation degree is greater than or equal to a set correlation degree threshold; If it is greater than or equal to, a dependency relationship between the dependent project and the target project is generated; If it is less than, the corresponding dependent project will be removed.

5. A project-dependent compilation system, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of an engineering-dependent compilation method, and when the program of the engineering-dependent compilation method is executed by the processor, the following steps are implemented: Respond to compilation requests, obtain development files of each module in the target project, and analyze dependent modules corresponding to each module based on the development files; Establishing a compilation set based on the dependency relationship between the dependent module and the target project, the compilation set including a plurality of dependent projects; Obtain dependent projects in the compilation set based on dependency relationships, analyze the correlation between dependent projects and target projects, add and compile all dependent projects in order of correlation, and obtain compilation results; Based on the compilation result, the compilation status of the target project is warned, prompt information is obtained, and the prompt information is transmitted to the terminal in real time; A compilation set is established based on the dependency relationship between the dependent module and the target project. The compilation set includes several dependent projects, specifically including: Get the source code of the dependent module, add code based on the source code, and generate intermediate code; Analyze the syntax and semantic information of the intermediate code to see if there are any errors; If an error occurs, recompile the current dependent module; If no error occurs, all dependent modules are compiled in sequence based on the dependency relationship between the dependent modules and the target to obtain the target code; Get the dependent projects corresponding to several dependent modules based on the target code; Based on the dependency relationship, the dependent projects in the compilation set are obtained, the correlation between the dependent projects and the target project is analyzed, and all the dependent projects are added and compiled in the order of correlation to obtain the compilation results, including: Obtain parameter information of dependent projects and target projects, and analyze the correlation; Sort the compilation of dependent projects according to the degree of relevance and set the number of splits; Split the dependent projects according to the number of splits to obtain multiple compilation groups; Synchronously compile dependent projects in the same compilation group based on the order of relevance; After all dependent projects in the compilation group are compiled, different compilation groups are integrated to obtain the compilation results; Add and compile all dependent projects in order of relevance. After obtaining the compilation results, it also includes: Obtain a compiled program based on the compilation result, test the compiled program, and obtain a test result; Compare the test results with the set test information to obtain the test accuracy; Determine whether the test accuracy meets the requirements; If the requirements are met, the target project and the dependent project are paired and stored; If the requirements are not met, adjust the compiler program under each dependent project.

6. The engineering dependency compilation system according to claim 5, characterized in that: Respond to compilation requests, obtain the development files of each module in the target project, and analyze the dependent modules corresponding to each module based on the development files, including: Generate compilation instructions based on compilation requests, and call the configuration interface according to the compilation instructions to configure parameters of the target project; Based on the target project after parameter configuration, all development modules in the target project are obtained, and module parameters are configured to generate development files matching the development modules; Analyze the dependencies between different development modules and the dependencies between development files and different development modules based on module parameters to obtain a dependency set; Generates a matching dependency module for each development module based on the dependency set.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an engineering-dependent compilation method program, and when the engineering-dependent compilation method program is executed by a processor, the steps of the engineering-dependent compilation method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Project compiling method and device, electronic equipment and storage medium

    CN113986236A