Application construction method and device, and electronic equipment

By acquiring the program logic diagram and converting it into source code snippets, and combining it with the Spring Boot and Beetl template processing engine, the problem of low application building flexibility in existing technologies is solved, and efficient and flexible automated application building is achieved.

CN115390825BActive Publication Date: 2025-11-25CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110574439.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-25
Publication Date
2025-11-25
Estimated Expiration
2041-05-25

AI Technical Summary

Technical Problem

In existing technologies, the automatic assembly process of applications is limited by functional components and fixed processes, resulting in low flexibility, difficulty in expansion, and inability to meet users' development needs.

Method used

By acquiring the program logic diagram, Groovy's dynamic interpretation rules are used to convert it into source code fragments for semantic analysis. Combined with the Spring Boot framework and Beetl template processing engine, compileable source code files are generated, and Maven is used for compilation and building to achieve automated application building.

Benefits of technology

It improves the flexibility and scalability of application building, simplifies the technical requirements for building, and reduces the difficulty of development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115390825B_ABST
    Figure CN115390825B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an application program construction method and device and electronic equipment, the method comprises: obtaining a program logic diagram corresponding to a to-be-constructed application program; converting the program logic diagram into a source code segment according to a preset processing rule; performing semantic analysis processing on the source code segment to obtain a target program package; obtaining a standard source code file corresponding to a preset source code template; and processing the standard source code file, the source code segment and the target program package according to a template processing engine corresponding to the source code template to obtain a compilable source code file. The compilable source code file is compiled and processed to obtain an executable program corresponding to the to-be-constructed application program. The application program is constructed in an automated manner, the technical requirements for constructing the application program are simplified, and the flexibility and scalability of the application program construction are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data processing, and particularly relate to an application program construction method and device and electronic equipment. BACKGROUND

[0002] With the continuous improvement of the performance of mobile phones and other mobile computing devices and the popularity of mobile Internet technology, enterprises and individuals have an increasing demand for various types of application programs.

[0003] In the prior art, in order to speed up the development progress of an application program, the application program can be automatically generated through an existing architecture. The specific implementation process can be that the automatic assembly of the application program is realized through a combination of functional components and process templates, and then the automatically assembled application program is processed through a command line or the like to generate an executable file corresponding to the application program, thereby realizing the automatic development of the application program.

[0004] However, the automatic assembly of the application program is limited by the specific functions of the functional components and the fixed processes, and only the assembly of the existing functions according to the preset processes can be completed, which has low flexibility, and the constructed application program has simple functions and is difficult to extend, and cannot meet the development needs of users. SUMMARY

[0005] Embodiments of the present application provide an application program construction method, device and electronic equipment to improve the flexibility of application program construction.

[0006] In a first aspect, embodiments of the present application provide an application program construction method, comprising:

[0007] obtaining a program logic diagram corresponding to a to-be-constructed application program;

[0008] converting the program logic diagram into a source code segment according to a preset processing rule;

[0009] performing semantic analysis processing on the source code segment to obtain a target program package;

[0010] obtaining a standard source code file corresponding to a preset source code template, and processing the standard source code file, the source code segment and the target program package according to a template processing engine corresponding to the source code template to obtain a compilable source code file;

[0011] performing compilation and construction processing on the compilable source code file to obtain an executable program corresponding to the to-be-constructed application program.

[0012] Optionally, the converting the program logic diagram into a source code segment according to a preset processing rule comprises:

[0013] According to a dynamic interpretation rule of Groovy in the source code generator, the program logic diagram is converted into a source code fragment.

[0014] Optionally, the semantic analysis processing on the source code fragment is performed to obtain a target program package, including:

[0015] The first semantic analysis processing is performed on the source code fragment to obtain a Maven dependent program package;

[0016] The second semantic analysis processing is performed on the source code fragment to obtain at least one Bean class required by program running and a Bean identifier corresponding to each Bean class;

[0017] The target program package is obtained according to the Maven dependent program package, the at least one Bean class, and the Bean identifier corresponding to each Bean class.

[0018] Optionally, the processing of the standard source code file, the source code fragment and the target program package by the template processing engine corresponding to the source code template is performed to obtain a compilable source code file, including:

[0019] The target positions of the source code fragment and the target program package in the standard source code file are determined according to a predefined Beetl processing rule in the template processing engine corresponding to the source code template;

[0020] The source code fragment and the target program package are placed into the standard source code file according to the target positions to obtain the compilable source code file.

[0021] Optionally, before the standard source code file corresponding to the preset source code template is obtained, the method further includes:

[0022] Any one or more of an entry class template, a project object template, a configuration file template, an attribute class template, a controller template, a service class template, an interceptor template and a configuration class template is obtained to obtain a source code template;

[0023] The source code template is stored.

[0024] Optionally, after the compilable source code file is compiled and processed to obtain the executable program corresponding to the to-be-built application, the method further includes:

[0025] The executable program corresponding to the to-be-built application is run;

[0026] A to-be-built application running success prompt is generated and displayed.

[0027] In a second aspect, an application program building device is provided, including:

[0028] an acquisition module, configured to acquire a program logic diagram corresponding to a to-be-constructed application program;

[0029] a processing module, configured to convert the program logic diagram into a source code segment according to a preset processing rule;

[0030] The processing module is further configured to perform semantic analysis processing on the source code segment to obtain a target program package.

[0031] The processing module is further configured to acquire a standard source code file corresponding to a preset source code template, and perform processing on the standard source code file, the source code segment and the target program package according to a template processing engine corresponding to the source code template to obtain a compilable source code file.

[0032] The processing module is further configured to perform compilation and construction processing on the compilable source code file to obtain an executable program corresponding to the to-be-constructed application program.

[0033] In a third aspect, an electronic device is provided, including at least one processor and a memory;

[0034] The memory stores computer-executed instructions.

[0035] The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the application program construction method according to any one of the first aspect.

[0036] In a fourth aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores computer-executed instructions. When a processor executes the computer-executed instructions, the application program construction method according to any one of the first aspect is implemented.

[0037] In a fifth aspect, a computer program product is provided, including a computer program. When a processor executes the computer program, the application program construction method according to the first aspect and various possible designs of the first aspect is implemented.

[0038] The application embodiment provides an application program construction method and device and electronic equipment, and after the above scheme is used, the program logic diagram corresponding to the to-be-constructed application program can be acquired first, then the program logic diagram can be converted into a source code segment according to a pre-stored processing rule, semantic analysis processing is performed on the source code segment, a target program package is obtained, a standard source code file corresponding to a preset source code template is acquired, and the standard source code file, the source code segment and the target program package are processed according to a template processing engine corresponding to the source code template, to obtain a compilable source code file, finally, the compilable source code file is compiled and processed to obtain an executable program corresponding to the to-be-constructed application program, and the application program is constructed in an automatic manner by combining the user-defined program logic diagram and the application program assembly flow at the programming language level, which simplifies the technical requirements for constructing the application program and effectively improves the flexibility and expandability of the application program construction. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the application embodiments or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0040] Figure 1 The application system architecture schematic diagram of the application program construction method provided by the application embodiment is shown in the figure.

[0041] Figure 2 The flowchart of the application program construction method provided by the application embodiment is shown in the figure.

[0042] Figure 3 The application schematic diagram of the application program construction system provided by the application embodiment is shown in the figure.

[0043] Figure 4 The flowchart of the application program construction method provided by another application embodiment of the application is shown in the figure.

[0044] Figure 5 The structure schematic diagram of the application program construction device provided by the application embodiment is shown in the figure.

[0045] Figure 6 The hardware structure schematic diagram of the electronic equipment provided by the application embodiment is shown in the figure. DETAILED DESCRIPTION

[0046] Clearly, the embodiments described are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0047] The terms "first", "second", "third", "fourth" and the like used in the description and the claims of the present application, and the above-described drawings (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can also include other order instances in addition to those illustrated or described. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0048] In the prior art, in order to speed up the development progress of the application program, the application program can be automatically generated through the existing architecture. The specific implementation process can be that the automatic assembly of the application program is realized by combining the functional components and the process templates, and then the automatically assembled application program is processed through the command line or the like to generate the executable file corresponding to the application program, thereby realizing the automatic development of the application program. However, the application program is limited by the specific functions of the functional components and the fixed process in the automatic assembly process, and can only complete the assembly of the existing functions according to the preset process. For example, the existing architecture only includes three functions A, B and C, and the preset process is that the application program can only be constructed according to the order of functions A, B and C. Therefore, the application program that realizes function A first, function B second and function C last can only be constructed, the flexibility is low, and the application program constructed has simple functions and is difficult to expand, which cannot meet the development needs of users.

[0049] Based on the above problems, the present application realizes the construction of the application program in an automatic manner by combining the user-defined program logic diagram with the application program assembly process at the programming language level, and achieves the technical effects of simplifying the technical requirements of constructing the application program and effectively improving the flexibility and expandability of the application program construction.

[0050] Figure 1 The architecture schematic diagram of the application system of the application program construction method provided by the embodiments of the present application is as follows: Figure 1As shown, the application system includes: a server 101, a database 102, a terminal device 103 and a cloud 104, before building an application program, the server 101 can first obtain a program logic diagram from the database 102, then further process the obtained program logic diagram, and finally obtain an executable program corresponding to the to-be-built application program. After obtaining the executable program, the executable program can be deployed in the cloud, and any authenticated terminal device 103 can download and install the executable program from the cloud 104, and after successful downloading and installation, the executable program can be run.

[0051] Further, the database 102 can store a plurality of program logic diagrams corresponding to a plurality of to-be-built application programs, and can be distinguished by an application program identifier.

[0052] Among them, the terminal device 103 can be a smart phone, a tablet, a personal computer or a smart wearable device, etc. The device that can install the executable program.

[0053] The technical solutions of the present application will be described in detail below with specific embodiments. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.

[0054] Figure 2 The flowchart of the application program building method provided by the embodiment of the present application, the method of the embodiment can be executed by the server 101, as shown in the figure Figure 2 The method of the embodiment can include:

[0055] S201: Obtain a program logic diagram corresponding to a to-be-built application program.

[0056] In this embodiment, the program logic diagram indicates the specific implementation logic of the to-be-built application program. Before building the application program, the program logic diagram corresponding to the to-be-built application program can be determined according to the actual needs of the user, wherein the program logic diagram can be a program logic diagram stored in the database in advance, or a program logic diagram created by the user in real time on a no-code development platform. It can be customized according to actual application scenarios.

[0057] S202: Convert the program logic diagram into a source code segment according to a preset processing rule.

[0058] In this embodiment, after obtaining the program logic diagram corresponding to the to-be-built application program, the program logic diagram can be converted into a source code segment according to a preset processing rule, wherein the converted source code segment has the characteristics of closure and can be run as a separate program unit.

[0059] Further, the program logic diagram is converted into source code segments according to a preset processing rule, which specifically can include:

[0060] The program logic diagram is converted into source code segments according to a dynamic interpretation rule of Groovy in the source code generator.

[0061] Specifically, Groovy is an agile development language based on JVM (Java Virtual Machine), which combines many powerful features of Python, Ruby and Smalltalk. Groovy code can be well combined with Java code and can also be used to extend existing code. According to the dynamic interpretation ability of Groovy, the program logic diagram can be converted into source code segments. The source code segments can be one or more, and the specific number can be determined according to the sub-functions contained in the program logic diagram, that is, one sub-function corresponds to one source code segment.

[0062] S203: Perform semantic analysis processing on the source code segments to obtain a target program package.

[0063] In this embodiment, after obtaining a plurality of source code segments, the plurality of source code segments can be subjected to semantic analysis processing to obtain a target program package.

[0064] Further, the source code segments are subjected to semantic analysis processing to obtain a target program package, which specifically can include:

[0065] The source code segments are subjected to first semantic analysis processing to obtain a Maven dependent program package.

[0066] The source code segments are subjected to second semantic analysis processing to obtain at least one Bean class required for program running and a Bean identifier corresponding to each Bean class.

[0067] The target program package is obtained according to the Maven dependent program package, the at least one Bean class, and the Bean identifier corresponding to each Bean class.

[0068] Specifically, after obtaining the source code segments, a code dependency processor can be used to analyze the plurality of source code segments obtained by the source code generator, find out the Maven dependent program package required for code running, and find out the Spring context Bean dependency injection required for local variables of the source code segments. The Bean dependency injection can be represented by a Bean identifier, and the Bean dependency injection can be directly found by the Bean identifier in subsequent searching.

[0069] Further, after obtaining the Bean classes, the Maven dependent package and the Bean identifiers corresponding to the Bean classes, the Maven dependent package and the Bean identifiers corresponding to the Bean classes can be combined, and the Bean classes can be stored in the database, so that the relevant Bean classes can be obtained through the Bean identifiers corresponding to the Bean classes subsequently.

[0070] S204: Obtain a standard source code file corresponding to the preset source code template, and process the standard source code file, the source code segment and the target program package according to a template processing engine corresponding to the source code template, to obtain a compilable source code file.

[0071] In the embodiment, before obtaining the compilable source code file, a source code template needs to be determined first, that is, a basic application framework needs to be determined first, and then the standard source code file corresponding to the source code template, that is, the standard source code file corresponding to the basic application framework, can be obtained, without the need for the user to re-code the basic application framework, thereby improving the efficiency of application program construction.

[0072] After obtaining the standard source code file, the standard source code file, the source code segment and the target program package can be processed according to a template processing engine corresponding to the source code template, to obtain a compilable source code file, which can specifically include:

[0073] The target positions of the source code segment and the target program package in the standard source code file are determined according to a predefined Beetl processing rule in the template processing engine corresponding to the source code template.

[0074] The source code segment and the target program package are placed in the standard source code file according to the target positions, to obtain a compilable source code file.

[0075] Specifically, the positions of the target program package and the source code segment in the standard code file are different, and before the target program package and the source code segment are placed in the standard source code file, the target positions of the source code segment and the target program package in the standard source code file can be determined based on a predefined Beetl processing rule in the template processing engine corresponding to the source code template, and then the source code segment and the target program package are placed in the target positions of the standard source code file, to obtain a compilable source code file.

[0076] Further, the existing framework, such as the switching-oriented and dependency-inverted features of the SpringBoot framework, can be utilized. According to the standard structure of the SpringBoot framework, different source code templates are created for different cut-in points, so as to support placing the required source code fragments and target program packages into the specified positions of the source code files by means of the Beetl template processing code blocks, to obtain the compilable source code files, and to improve the flexibility of the compilable code file generation.

[0077] S205: Compiling and building the compilable source code files to obtain the executable program corresponding to the to-be-built application.

[0078] In the embodiment, after the compilable source code files are obtained, the source code files of this type cannot be directly executed, and the compilable source code files need to be compiled and built to obtain the executable program corresponding to the to-be-built application.

[0079] Further, the Maven can be used to compile and build the compilable source code files to finally generate the executable program corresponding to the to-be-built application.

[0080] After the above scheme is adopted, the program logic diagram corresponding to the to-be-built application can be obtained first, then the program logic diagram can be converted into the source code fragments according to the pre-stored processing rules, and the source code fragments are subjected to semantic analysis processing to obtain the target program package, the standard source code files corresponding to the preset source code templates are obtained, and the standard source code files, the source code fragments and the target program package are processed according to the template processing engine corresponding to the source code templates to obtain the compilable source code files, and finally the compilable source code files are subjected to compiling and building to obtain the executable program corresponding to the to-be-built application. Through the combination of the user-defined program logic diagram and the application program assembly flow at the programming language level, the automatic construction of the application program is realized, which simplifies the technical requirements of the application program construction, and effectively improves the flexibility and scalability of the application program construction.

[0081] In addition, Groovy is an agile dynamic language for Java virtual machine, which is a mature object-oriented programming language and can be used for object-oriented programming and as a pure script language. SpringBoot is a Java-based open-source lightweight framework, which is the current mainstream Java programming framework. Beetl is the abbreviation of Bee Template Language, which is a new generation of template engine and one of the commonly used template engines in current software development. JavaBean is a software component model for Java, which can infinitely expand the functions of Java programs through JavaBean, and can quickly generate new applications through the combination of JavaBean. Maven Project Object Model (POM) can manage the construction, reporting and documentation of projects through a small amount of description information. Maven provides advanced project management tools in addition to program construction capabilities. SpringBoot can use Maven for dependency package management and application construction. Codeless development is a software development method that has emerged in recent years, which means that software developers can achieve the target requirements without manual coding. The codeless development platform at the programming language level means that the platform's preset logic units are mapped to the basic elements of the programming language. Users can form a graphical programming codeless development platform by dragging and splicing logic units to form application logic. In the prior art, the automatic execution of the assembly of the application program is usually realized by combining functional components and process templates. The executable file of the program is generated through the command line and the like, and the assembly process is limited by the functions of the functional components and the fixed process. The construction process command is complex and has low flexibility.

[0082] However, the programming language level no-code development platform taking the SpringBoot application as the final delivery needs to generate a real executable application package according to the visual code of the business system created by the user on the no-code development platform, and the business function unit and processing flow of the application are completely implemented by the logic drawn by the user, and the prior art lacks the support for the high flexibility required by the no-code development platform. That is, the application analyzes the program logic drawn by the user through the no-code development platform or other similar tools, uses multiple Beetl templates to form a program main body structure conforming to the SpringBoot framework, converts the logic segments of the application into target program code through the dynamic interpretation ability of Groovy, combines the target program code into specific source code files through the dynamic assembly ability of Beetl and the aspect-oriented ability of SpringBoot, and compiles and builds the source code project composed of multiple source code files through Maven to obtain the executable program required by the user. Through the application program assembly and building process at the programming language level, the application effectively solves the problem that the automatic execution application assembly and building method is limited by the lack of flexibility of the component function and assembly process and the limitation of the specific compiler in the building process, and provides a good solution for the high flexibility of the program assembly and building of the programming language level no-code development platform. The automatic application assembly and building method simplifies the technical requirements for building the application and reduces the development difficulty of the application.

[0083] Based on the method, Figure 2 The embodiments of the present specification also provide some specific embodiments of the method, which are described below.

[0084] In addition, in another embodiment, before acquiring the standard source code file corresponding to the preset source code template, the method can further include:

[0085] The source code template is obtained by acquiring any one or more of an entry class template, a project object template, a configuration file template, a property class template, a controller template, a service class template, an interceptor template and a configuration class template.

[0086] The source code template is stored.

[0087] In the embodiment, the template type needs to cover the injection points of various key programs in the underlying framework of the application to meet the building needs of the application, and can specifically include an entry class template, a project object template, a configuration file template, a property class template, a controller template, a service class template, an interceptor template and a configuration class template.

[0088] Correspondingly, Figure 3 The application schematic diagram of the application program building system provided by the embodiment of the present application is as follows: Figure 3As shown, in this embodiment, the application building system can include:

[0089] Source code generator: processes the program logics of the application drawn by the user through the no-code development platform, and converts the program logics into Groovy-based source code segments one by one, which are executable by a closure and can be assembled as program units.

[0090] Code dependency processor: finds out the Maven dependency packages required for code running and the Spring context Bean dependency injection required for local variables of the source code segments by analyzing the source code segments obtained by the source code generator.

[0091] Source code engineering structure selector: selects the most suitable one from a plurality of source code engineering structures composed of templates by analyzing the source code segments obtained by the source code generator and combining the application type selected by the user on the no-code development platform, and generates a source code engineering structure for the currently processed application, which is composed of a plurality of specific directories and specific source code template files and meets the requirements of the SpringBoot framework.

[0092] Template processing engine: used for merging the source code templates, the plurality of source code segments obtained by the source code generator, the Maven dependency package identifiers analyzed by the code dependency processor, and the Spring context Bean dependency injection identifiers, and finally outputting the source code file with a compilable condition.

[0093] Source code template: according to the standard structure of the SpringBoot framework, different source code templates are created for different cut-in points to support processing code blocks through Beetl templates and flexibly placing the required source code segments into the specified positions of the source code file to obtain a compilable source code file by using the switching and dependency inversion features of the SpringBoot framework.

[0094] Executable program builder: compiles and builds the compilable source code file that has completed template processing through Maven, and finally generates an executable program of the application to be built.

[0095] The source code template can include a plurality of source code templates, and the template types cover various key program injection points of the SpringBoot framework to meet the needs of building the SpringBoot application, specifically:

[0096] Entry class template: adds Beetl template processing code to the entry class annotation position for the application based on the SpringBoot framework, and generates an application entry class file.

[0097] POM(Project Object Model, project object model): add Beetl template processing code to the Maven project object model (POM) to generate POM files to support dynamically customizing Maven dependency packages and application descriptions of the application as needed.

[0098] Configuration file template: used to automatically customize and generate configuration files in the SpringBoot framework according to user needs.

[0099] Property class template: used to automatically import configuration property information into the project based on the capabilities of the SpringBoot framework, and generate property class files corresponding to the configuration files.

[0100] Controller template: according to the user-defined program logic diagram processing type, the request information and control processing are merged through the Beetl template processing code to generate the controller class file of the application, supporting custom initialization and result formatting logic before and after processing logic.

[0101] Service class template: according to the user-defined program logic diagram processing type, the application logic is merged through the Beetl template processing code to generate the service class file of the application, supporting custom initialization and result formatting logic before and after processing logic.

[0102] Interceptor template: according to the user-defined interceptor processing logic, generate the interceptor class file of the SpringBoot framework.

[0103] Configuration class template: according to the user-defined specific configuration information, generate the configuration class file of the SpringBoot framework.

[0104] In addition, in another embodiment, after compiling and building the compilable source code file to obtain the executable program corresponding to the to-be-built application, the following can also be included:

[0105] Run the executable program corresponding to the to-be-built application.

[0106] Generate and display a to-be-built application running success prompt.

[0107] In this embodiment, after obtaining the to-be-built application, the executable program corresponding to the to-be-built application can be directly run locally. After the executable program runs successfully, a to-be-built application running success prompt can be generated and displayed, reminding the user that the to-be-built application has been successfully run, improving the user's experience.

[0108] In addition, the executable program corresponding to the to-be-constructed application can be uploaded to the cloud, and the terminal device can download and install the executable program corresponding to the to-be-constructed application from the cloud, and after successful installation, the executable program corresponding to the to-be-constructed application can be directly run.

[0109] Figure 4 A flowchart of an application construction method according to another embodiment of the application is shown in FIG. 3. Figure 4 As shown in FIG. 3, the method can include the following steps.

[0110] First, the program logic diagram corresponding to the to-be-constructed application is obtained, and the program logic diagram is converted, and then it is determined whether there is an unprocessed program logic diagram, and if so, the program logic diagram is converted into a source code segment.

[0111] Selecting a source code engineering structure: when all the program logic diagrams have been converted into source code segments, one of a plurality of predefined source code engineering structures is automatically selected according to the execution needs of the source code, the structure meets the requirements of the SpringBoot framework, and includes one or more standard directories, standard source code files, and source code templates that need to be processed subsequently, for use in subsequent steps.

[0112] Extracting Maven dependencies: when the to-be-constructed application has unprocessed program source code segments, the source code segments are analyzed, and according to the code semantics, Maven dependency packages required for program running are found, and specific identifiers of these dependency packages are recorded for use in subsequent steps.

[0113] Extracting Bean dependencies: the source code segments are analyzed, and according to the code semantics, Beans that should be included in the Spring context for program running are found, and identifiers of these Beans are recorded for use in subsequent steps.

[0114] Merging source code templates: through a template processing engine, the program source code, Maven dependency package identifiers, and Spring context Bean dependency identifiers obtained in the foregoing steps are combined, and appropriate source code templates are selected for template processing according to the SpringBoot framework standard.

[0115] Construction engineering: all the merged source code files are combined according to the SpringBoot framework standard to form a compilable source code file, and the source code file is compiled and processed by Maven to obtain an executable program corresponding to the to-be-constructed application.

[0116] Running the executable program corresponding to the to-be-constructed application, and then realizing the function corresponding to the to-be-constructed application.

[0117] Based on the same idea, the present application also provides an apparatus corresponding to the above method, Figure 5 The application program construction device provided by the embodiment of the present application has the structure as shown in the figure, Figure 5 As shown in the figure, it can include:

[0118] The acquisition module 501 is configured to acquire a program logic diagram corresponding to a to-be-constructed application.

[0119] The processing module 502 is configured to convert the program logic diagram into a source code segment according to a preset processing rule.

[0120] In the embodiment, the processing module 502 is further configured to:

[0121] According to the dynamic interpretation rule of Groovy in the source code generator, the program logic diagram is converted into a source code segment.

[0122] The processing module 502 is further configured to perform semantic analysis processing on the source code segment to obtain a target program package.

[0123] In the embodiment, the processing module 502 is further configured to:

[0124] The first semantic analysis processing is performed on the source code segment to obtain a Maven dependent program package.

[0125] The second semantic analysis processing is performed on the source code segment to obtain at least one Bean class required for program running and a Bean identifier corresponding to each Bean class.

[0126] The target program package is obtained according to the Maven dependent program package, the at least one Bean class, and the Bean identifier corresponding to each Bean class.

[0127] The processing module 502 is further configured to acquire a standard source code file corresponding to a preset source code template, and process the standard source code file, the source code segment and the target program package according to a template processing engine corresponding to the source code template to obtain a compilable source code file.

[0128] In the embodiment, the processing module 502 is further configured to:

[0129] According to the Beetl processing rule predefined in the template processing engine corresponding to the source code template, target positions of the source code segment and the target program package in the standard source code file are determined respectively.

[0130] According to the target positions, the source code segment and the target program package are placed into the standard source code file, to obtain a compilable source code file.

[0131] The processing module 502 is further configured to compile and build the compilable source code file, to obtain an executable program corresponding to the to-be-built application.

[0132] In addition, in another embodiment, the processing module 502 is further configured to:

[0133] Obtain any one or more of an entry class template, a project object template, a configuration file template, a property class template, a controller template, a service class template, an interceptor template, and a configuration class template, to obtain a source code template.

[0134] Store the source code template.

[0135] In addition, in another embodiment, the processing module 502 is further configured to:

[0136] Run the executable program corresponding to the to-be-built application.

[0137] Generate and display a to-be-built application running success prompt.

[0138] The apparatus provided in the embodiments of the present application can implement the method of the embodiments as shown in Figure 2 The implementation principle and technical effects are similar, and thus will not be described here again.

[0139] Figure 6 The hardware structure schematic diagram of the electronic device provided in the embodiments of the present application is shown in Figure 6 The device 600 provided in the embodiments includes at least one processor 601 and a memory 602. The processor 601 and the memory 602 are connected through a bus 603.

[0140] In the specific implementation process, the at least one processor 601 executes the computer execution instructions stored in the memory 602, so that the at least one processor 601 executes the method in the method embodiments.

[0141] The specific implementation process of the processor 601 can refer to the method embodiments, and the implementation principle and technical effects are similar, and thus will not be described here again.

[0142] In the aboveFigure 6 In the illustrated embodiment, it is to be understood that the processor can be a central processing unit (CPU), and can also be other general purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.

[0143] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory.

[0144] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0145] The embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions, and when the processor executes the computer execution instructions, the application program construction method of the above method embodiment is realized.

[0146] The embodiment of the application further provides a computer program product, comprising a computer program, and when the processor executes the computer program, the application program construction method as described above is realized.

[0147] The above computer readable storage medium, the above readable storage medium can be realized by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0148] An exemplary readable storage medium is coupled to the processor such that the processor can read information from, and can write information to, the readable storage medium. Of course, the readable storage medium can be part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can exist as discrete components in the device.

[0149] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware of program instructions. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes various media that can store program codes, such as ROM, RAM, magnetic disk, or optical disk.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An application building method, characterized in that, include: Obtain the program logic diagram corresponding to the application to be built, which is created in real time by the user on the no-code development platform; The program logic diagram is converted into source code fragments according to Groovy's dynamic interpretation rules in the source code generator; Perform first semantic analysis on the source code fragment to obtain the Maven dependency package; The source code fragment is subjected to a second semantic analysis process to obtain at least one Bean class required for program execution, as well as the Bean identifiers corresponding to each Bean class; The target package is obtained based on the Maven dependency package, the at least one Bean class, and the Bean identifiers corresponding to each Bean class; Leveraging the switching and dependency inversion features of the Spring Boot framework, and based on the standard structure of the Spring Boot framework, different source code templates are created for different entry points. Standard source code files corresponding to the preset source code templates are obtained, and the target positions of the source code fragments and the target packages in the standard source code files are determined according to the predefined Beetl processing rules in the template processing engine corresponding to the source code templates. The source code fragment and the target package are placed into the standard source code file according to the target location to obtain a compilable source code file; The compilable source code file is compiled and built to obtain the executable program corresponding to the application to be built.

2. The method according to claim 1, characterized in that, Before obtaining the standard source code file corresponding to the preset source code template, the method further includes: Obtain any one or more of the following templates to get the source code template: entry class template, project object template, configuration file template, property class template, controller template, service class template, interceptor template, and configuration class template; Store the source code template.

3. The method according to claim 1, characterized in that, After compiling and building the compilable source code file to obtain the executable program corresponding to the application to be built, the method further includes: Run the executable program corresponding to the application to be built; Generate and display a message indicating that the application being built has run successfully.

4. An application building apparatus, said application building apparatus being used to implement the application building method according to any one of claims 1-3, characterized in that, include: The acquisition module is used to obtain the program logic diagram corresponding to the application to be built. The processing module is used to convert the program logic diagram into source code fragments according to preset processing rules; The processing module is also used to perform semantic analysis on the source code fragment to obtain the target package; The processing module is further configured to obtain a standard source code file corresponding to a preset source code template, and process the standard source code file, the source code fragment, and the target package according to the template processing engine corresponding to the source code template to obtain a compilable source code file; The processing module is also used to compile and build the compilable source code file to obtain the executable program corresponding to the application to be built.

5. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the application building method as described in any one of claims 1 to 3.

6. 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 application building method as described in any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the application building method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Application program construction method and device and computer equipment

    CN112667228A

  • Source code generator

    JP1992299416A

  • Automatically generating code for application programming interfaces

    US20190339947A1