Application program generation method and device, computer equipment and storage medium
Through the automated application generation method, the use of functional requirements and interface definition information filtering and integrating functional modules is solved, and the problem of low application generation efficiency in traditional technology is achieved, and efficient application development and generation is achieved.
Patent Information
- Application Number
- CN202411454363.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-18
AI Technical Summary
The traditional application generation process is inefficient and requires developers to manually write code and repeatedly modify it, resulting in human errors and low code reusability.
By obtaining task requirements information for application development, analyzing and obtaining functional requirements information and interface definition information, performing functional splitting, filtering pre-built functional modules, configuring data interfaces, and integrating functional modules to generate applications.
It realizes automated development and generation of applications, improves the reusability of code files and application generation efficiency, and reduces the human interface definition and configuration process.
Smart Images

Figure CN119473228A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to an application generation method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Application software or application program is one of the main categories of computer software, which refers to software written for a specific application purpose for users. Application development or software development refers to a series of computer science activities specifically aimed at the software creation, design, deployment and support process.
[0003] In traditional technical solutions, the specific generation process of an application includes designing algorithms or methods for implementing program functions, overall structural design and framework design of the application, programming and debugging, program integration and testing, and then writing and submitting the program. The implementation of program functions is based on specific target functional requirements. A function, procedure, subroutine, or an independent program with program description is integrated according to the program flow, and finally compiled to form a program file corresponding to the target function.
[0004] However, traditional technical solutions usually require developers to write corresponding codes according to specific functional requirements, and repeatedly modify and adjust the code files to form usable program files. Due to human errors or low code reusability, the process of generating applications through traditional technical solutions is inefficient. Summary of the invention
[0005] Based on this, it is necessary to provide a more efficient application generation method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides a method for generating an application program. The method comprises:
[0007] Obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information;
[0008] Performing functional splitting on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program;
[0009] Screening the pre-built functional modules according to the plurality of sub-functional information to obtain a plurality of target functional modules;
[0010] According to the plurality of target function modules and the interface definition information, configuring data interfaces between the plurality of target function modules;
[0011] Based on the data interface and the function-related logic information, the multiple target function modules are integrated to generate an application program.
[0012] In one embodiment, the pre-built function modules are screened according to the plurality of sub-function information to obtain the plurality of target function modules, including:
[0013] Get the original code set corresponding to the pre-built functional module;
[0014] Filtering the original code set according to the plurality of sub-function information to obtain a candidate code set corresponding to the sub-function information;
[0015] Separating the interface code in the candidate code set to obtain a target code set, wherein the interface code is used to provide an external calling interface for the function function in the candidate code set;
[0016] The target code set is encapsulated to obtain the multiple target function modules.
[0017] In one embodiment, the original code set is screened according to the plurality of sub-function information to obtain a candidate code set corresponding to the sub-function information, comprising:
[0018] Acquire code format information preset in the plurality of sub-function information;
[0019] According to the code format information, the format of the original code set after screening is converted to obtain an intermediate code set;
[0020] According to the variable information in the plurality of sub-function information, the function variables in the intermediate code set are updated to obtain the candidate code set.
[0021] In one embodiment, configuring the data interface between the multiple target function modules according to the multiple target function modules and the interface definition information includes:
[0022] Acquire the function code files corresponding to each function module and the data flow information between the plurality of target function modules, each of the function code files including at least one target function function;
[0023] Generate input port parameters and output port parameters of each target function module according to the input parameters and function return values corresponding to each target function function;
[0024] The data interfaces between the plurality of target functional modules are configured according to the data flow information, the input port parameters, and the output port parameters.
[0025] In one embodiment, configuring the data interface between the plurality of target functional modules according to the data flow information, the input port parameter, and the output port parameter comprises:
[0026] Get the dynamically loaded port mapping rule file;
[0027] Generate a data flow identifier of a data transmission mode between the plurality of target functional modules according to the data flow information;
[0028] According to the port mapping rule file and the input port parameters, the data flow identifier is mapped to the corresponding input port of the target function to obtain the data interface; or, according to the port mapping rule file and the output port parameters, the data flow identifier is mapped to the corresponding output port of the target function to obtain the data interface.
[0029] In one embodiment, obtaining the dynamically loaded port mapping rule file includes:
[0030] Get the command data and environment variables preset in the program test environment;
[0031] The port mapping rule file is dynamically updated according to the data transmission constraints formed by the instruction data and the environment variables.
[0032] In a second aspect, the present application also provides an application generation method device. The device comprises:
[0033] The task acquisition module is used to acquire the task requirement information corresponding to the application development, analyze the task requirement information, and obtain the function requirement information and interface definition information;
[0034] A task analysis module, used to perform functional decomposition on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program;
[0035] A module screening module, used for screening pre-built function modules according to the plurality of sub-function information to obtain a plurality of target function modules;
[0036] An interface definition module, configured to configure data interfaces between the plurality of target function modules according to the plurality of target function modules and the interface definition information;
[0037] A program generation module is used to integrate the multiple target function modules based on the data interface and the function association logic information to generate an application program.
[0038] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0039] Obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information;
[0040] Performing functional splitting on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program;
[0041] Screening the pre-built functional modules according to the plurality of sub-functional information to obtain a plurality of target functional modules;
[0042] According to the plurality of target function modules and the interface definition information, configuring data interfaces between the plurality of target function modules;
[0043] Based on the data interface and the function-related logic information, the multiple target function modules are integrated to generate an application program.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0045] Obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information;
[0046] Performing functional splitting on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program;
[0047] Screening the pre-built functional modules according to the plurality of sub-functional information to obtain a plurality of target functional modules;
[0048] According to the plurality of target function modules and the interface definition information, configuring data interfaces between the plurality of target function modules;
[0049] Based on the data interface and the function-related logic information, the multiple target function modules are integrated to generate an application program.
[0050] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0051] Obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information;
[0052] Performing functional splitting on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program;
[0053] Screening the pre-built functional modules according to the plurality of sub-functional information to obtain a plurality of target functional modules;
[0054] According to the plurality of target function modules and the interface definition information, configuring data interfaces between the plurality of target function modules;
[0055] Based on the data interface and the function-related logic information, the multiple target function modules are integrated to generate an application program.
[0056] The above-mentioned application generation method, device, computer equipment, storage medium and computer program product first obtain the task requirement information corresponding to the application, and parse it to obtain the necessary function requirement information and interface definition information. Function splitting is performed based on the function requirement information to obtain multiple sub-function information and function association logic information. Based on multiple sub-function information, multiple target function modules are screened from pre-built function modules; and the data interface of the target function module is defined based on the interface definition information. Finally, according to the data interface and function association logic information, multiple target function modules are integrated to form an application that meets the task requirements. The scheme can realize the automatic development and generation of the application only when the task requirement information is provided, and the code files in the application are encapsulated in the form of function modules, which replaces the process of manually writing code by developers in the traditional technical scheme, and improves the reusability of the code files. In the process of calling the module, the target function module of the software is obtained by comparing and screening the modules, and the development of the core functions of the software can be completed by modular combination and splicing, which improves the efficiency of application generation. In addition, based on the interface definition information in the task requirements, the automatic configuration of the data interface between the modules can be realized, which replaces the manual interface definition and configuration process, and further improves the efficiency of application generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1An application environment diagram of an application generation method in an embodiment;
[0058] Figure 2 A schematic diagram of a flow chart of a method for generating an application program in one embodiment;
[0059] Figure 3 A schematic diagram of a flow chart of sub-steps of screening and obtaining a target functional module in an embodiment;
[0060] Figure 4 A schematic flow chart of a method for generating an application program in another embodiment;
[0061] Figure 5 A structural block diagram of an application generating method device in one embodiment;
[0062] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] The application generation method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. For example, the terminal 102 can communicate with the server 104 through the fifth generation mobile communication technology (5th Generation Mobile Communication Technology, 5G). The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Taking the development process of a client application for a financial institution as an example, in order to enable the client application (hereinafter referred to as the application) to be put into use as soon as possible, the technical solution of this application can be analyzed according to the online service, technical components, and management end service respectively. According to the results of the demand analysis, the functional development tasks are divided and transferred to different development task lines. Through modular configuration and combination, the functional development of the application is completed to achieve rapid development of the application. Specifically, in this application environment, the developer first needs to set the development task of the application through the terminal 102, form the task requirement information corresponding to the application development, and send this task requirement information to the server 104 by data interaction with the server 104. After receiving the task requirement information, the server 104 will analyze the information that still has no requirement information to obtain modularized functional requirement information and interface definition information for defining the interface between modules. Then, the server 104 will further split the functional requirement information according to the functional boundary definition of the functional module to obtain the most fine-grained sub-function information; and the connection relationship (or data transmission, data association relationship, etc.) between the functional modules recorded in the functional requirement information will be recorded through the functional association logic information. Further, the server 104 will screen the pre-built and initialized functional modules according to the obtained sub-function information to obtain the target functional module that can realize the corresponding function of the sub-function information. After the server 104 adaptively modifies and adjusts the function parameters and variable names in the target function, it will define or configure the data interface between all target functional modules based on the interface definition information obtained in the above process. After that, the server 104 will orderly integrate all target functional modules according to the functional association logic information to form an application that meets the task requirement information. After passing the necessary unit module test and program integration test, the server 104 will complete the online and packaging compression processing of the application. In response to the user's download instruction, the server 104 will send the resource compression package of the application to the user's terminal 102 and install it locally on the terminal 102 .In this application environment, the terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. It should be noted that when the terminal 102 is an IoT device, the application program in the embodiment is mainly a corresponding driver. In this application environment, the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0065] In one embodiment, Figure 2 As shown, a method for generating an application is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0066] Step 202, obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information.
[0067] In the embodiment, the application refers to a computer program for the device to complete one or more specific tasks. In the user mode of the application level, it can interact with the user, and the application can also be provided with a visual user interface. The task requirement information mainly includes the business logic for providing response services to users for the application, and the requirement information for the normal operation of the application. In the embodiment, the process of analyzing the task requirement information can be to identify the key attribute fields of the task requirement information in the text format received by the server through natural language processing, and correspondingly extract the specific information content or attribute value in the key attribute field. The server analyzes the task requirement information by natural language processing, and the results obtained include functional requirement information and interface definition information. The functional requirement information in the embodiment is used to characterize the core tasks that need to be performed by the application; and in the embodiment, the core tasks or actions can be hierarchically divided to obtain multiple subtasks at different levels. In the embodiment, the interface is a communication mechanism for exchanging information between functional modules. The interface definition information mainly includes but is not limited to the interface name, interface method, interface address, request parameters and response parameters.
[0068] Exemplarily, in the acquisition and collection stage of task requirement information, the developer inputs the application development task through the terminal interactive interface to form the text information of the development task. The terminal uploads the text information of this development task to the server, and the server first performs semantic analysis on the text information, and based on the semantic analysis results, performs word segmentation processing on the text information to obtain several text strings. Then, according to the demand analysis rules preloaded in the server, the key fields in the several text strings are identified, including but not limited to function description, interface definition, process design, data format, etc. According to the identified key fields, combined with the semantic analysis results obtained in the above process, the specific information content or specific attribute value corresponding to the key field is identified and extracted; for example, according to the attribute field of the function description, the content in the semantic analysis result is identified and screened, and the description text of the overall functional requirements of the application can be obtained, that is, the functional requirement information; for another example, according to the attribute field of the interface definition, the content in the semantic analysis result is identified and screened, and the description text of the data transmission interface between each specific functional module or function function in the application can be obtained, that is, the interface definition information.
[0069] Step 204, split the functional requirement information into multiple sub-function information and function-related logic information.
[0070] In the embodiment, the function association logic is used to characterize the connection relationship between the function modules in the application. In the embodiment, the function requirement information is a general and holistic description of the functions to be implemented by the application from a relatively macroscopic perspective. The functions or business logic that an application needs to implement can be regarded as an overall task, and the overall task must be formed by multiple subtasks or multiple staged task results during the execution process. Therefore, similarly, the function requirement information in the embodiment is split from a relatively microscopic level to form several sub-functions; the sub-function information is the minimum granularity function information obtained after the complete function of the application is split. It can be understood that a single sub-function in the embodiment can be implemented only by a single function module, while a complete application needs to be implemented by corresponding multiple function modules through collaboration. In order to ensure that the application can run normally in the embodiment, the sub-function information in the embodiment needs to be combined in an appropriate manner to ensure that the various function modules can cooperate with each other and can realize the normal flow and identification of data in each function module. Therefore, the function association logic information in the embodiment is used to record the connection relationship between the function modules, and further characterizes the combination mode between the function modules.
[0071] Exemplarily, in the embodiment, after obtaining the functional requirement information of the application, the functional requirement information is segmented through a word segmentation processing tool with a smaller granularity. For example, through the segmented function description dictionary pre-built in the server, the description fields used to characterize the segmented functions in the word segmentation results are processed, and the respective sub-function information under the overall functional requirement information is formed according to the corresponding description fields. In addition, in the embodiment, the server can also extract the description fields of the connection relationship (such as the contents of the input, output, transmission, etc. fields) in the same way, and form the associated logical information between the modules corresponding to the sub-function information according to the semantic information corresponding to the functional requirement information.
[0072] Step 206: Screen the pre-built function modules according to the multiple sub-function information to obtain multiple target function modules.
[0073] In the embodiment, the pre-built functional module is a module formed by encapsulating the code of a specific functional function when completing the historical application development task; and the encapsulated module can be reused in the subsequent application development process. More specifically, the functional module in the embodiment is a module formed by dividing the functional boundaries according to the business logic that the application needs to implement. In the embodiment, the module division rules and the business logic disassembly rules are consistent, and consistent changes can always be maintained during the development or testing process of the application.
[0074] Exemplarily, in the embodiment, each sub-function information is obtained in the aforementioned steps, and matching and screening are performed in several historical function modules constructed and saved in the process of developing other applications, so as to obtain a function module that can correspond to the business logic described by the sub-function information. In the embodiment, the process of matching and screening the function modules can be implemented by matching the keywords of the functions; for example, in the process of developing other applications, when the historical function modules are formed, the historical function modules are marked with function labels, and when the historical function modules are subsequently screened according to the sub-function information, the function description string corresponding to the sub-function information can be matched with the function label of the historical function module for semantic similarity, so as to screen and obtain the target function module corresponding to the sub-function information.
[0075] Step 208: configuring data interfaces between the multiple target function modules according to the multiple target function modules and the interface definition information.
[0076] Exemplarily, in the embodiment, after all target function modules for implementing the application business logic are screened and determined based on the sub-function information, it is necessary to define and configure the interfaces of each target function module so that normal data interaction and flow can be carried out between each function module. Specifically, the server implements the interface configuration of each target function module according to the interface definition information obtained in the aforementioned steps; for example, the server needs to configure the interface name, interface method, interface address, request parameters and response parameters of the target function module according to the interface definition information. Among them, the interface name is the name or identifier of the interface, which is used to distinguish different interfaces; the interface method is the method provided by the interface, including GET, POST, PUT, DELETE, etc.; the interface address is the access address of the interface; the request parameter is the input parameter required by the interface, including the parameter name, parameter type, parameter description, etc.; the response parameter is the output result returned by the interface, including the type, name, description, etc. of the return value.
[0077] Step 210, based on the data interface and the function-related logic information, multiple target function modules are integrated to generate an application program.
[0078] For example, after completing the configuration of the data interface between each target functional module, all target functional modules are integrated according to the constraints on the data flow of the business logic formed by the interface definition and the association relationship between the functional modules obtained during the functional splitting to form the final application. After passing the necessary functional tests, the application can be further launched.
[0079] The above-mentioned application generation method first obtains the task requirement information corresponding to the application, and parses it to obtain the necessary function requirement information and interface definition information. Based on the function requirement information, the function is split to obtain multiple sub-function information and function association logic information. Based on the multiple sub-function information, multiple target function modules are screened from the pre-built function modules; and the data interface of the target function module is defined based on the interface definition information. Finally, according to the data interface and the function association logic information, the multiple target function modules are integrated to form an application that meets the task requirements. The method can realize the automatic development and generation of the application only when the task requirement information is provided, and the code files in the application are encapsulated in the form of function modules, which replaces the process of manually writing code by developers in the traditional technical method, and improves the reusability of the code files. In the process of calling the module, the target function module of the software is obtained by comparing and screening the modules, and the development of the core functions of the software can be completed by modular combination and splicing, which improves the efficiency of automatic generation of application development. In addition, based on the interface definition information in the task requirements, the automatic configuration of the data interface between the modules can be realized, and the manual interface definition and configuration process is omitted, which further improves the efficiency of application generation.
[0080] In one embodiment, Figure 3 As shown, the method screens the pre-built functional modules according to the multiple sub-functional information to obtain the multiple target functional modules, including:
[0081] Step 302: Obtain the original code set corresponding to the pre-built functional module.
[0082] In the embodiment, the original code set is a code description of the business logic or functional logic that can be implemented by the functional module. Exemplarily, the pre-built functional modules in the embodiment are all formed in the development process of the historical application program. Therefore, the code content encapsulated in the module must have some differentiated adjustments and configurations. For example, the original code encapsulated in the functional module includes multiple functional functions, and according to the description of the requirements for the functional module in the sub-function information, the parameters of the individual functions or the parameters of the interface in the functional module need to be adjusted. Therefore, in the embodiment, a set of original codes corresponding to each known functional requirement can be obtained according to a large number of known software development kits.
[0083] Step 304: Screen the original code set according to the multiple sub-function information to obtain a candidate code set corresponding to the sub-function information.
[0084] In an embodiment, the candidate code set obtained by screening is a set of codes that may be associated with the differentiated configuration in the sub-function information; the set may contain multiple functions or instruction codes. Exemplarily, since different original code sets may exist for a specific function information in the embodiment, the original code set corresponding to the sub-function information needs to be screened in the embodiment to obtain the candidate code set. Specifically in an embodiment, the original code set can be screened according to the constraints on the code in the module in the sub-function information, wherein the constraints on the code in the module include but are limited to the code writing language, a specific code format, etc. The specific choice of code language and code format can be flexibly selected according to the actual situation.
[0085] Step 306, separating the interface codes in the candidate code set to obtain the target code set, where the interface codes are used to provide an external calling interface for the functional functions in the candidate code set.
[0086] In the embodiment, the interface code is a portion of code in the code set used to provide a calling interface to the outside; the target code set in the embodiment is the portion of code retained after the portion of code that provides a calling interface to the outside is separated from the candidate code set. Exemplarily, in the embodiment, the portion of code used to provide a calling interface to the outside contained in the target code set is first separated to remove the portion of the function requirement corresponding to the target code set that provides the calling capability to the outside, so that the finally encapsulated functional module no longer contains the capability of providing a calling interface to the outside.
[0087] Step 308, encapsulating the target code set to obtain multiple target function modules.
[0088] Exemplarily, in the embodiment, all code contents of the target code set formed after removing some codes that provide a calling interface to the outside are encapsulated to form a target function module that can meet the functional requirements corresponding to the sub-function information and meet the specific code constraint requirements at the same time. In the embodiment, by modifying and adjusting the codes in the pre-built function modules in a targeted manner, it is possible to avoid call anomalies or functional anomalies caused by the encapsulated function modules containing unnecessary functions.
[0089] In one embodiment, the method screens the original code set according to the plurality of sub-function information to obtain the candidate code set corresponding to the sub-function information, which may include the following steps:
[0090] Step 1: Obtain code format information preset in multiple sub-function information.
[0091] Step 2: According to the code format information, the format of the original code set after screening is converted to obtain an intermediate code set.
[0092] Step three: update the function variables in the intermediate code set according to the variable information in the multiple sub-function information to obtain the candidate code set.
[0093] Exemplarily, in the embodiment, during the process of screening the original code in the pre-built functional module, the corresponding original code set can also be converted into a new code set in the target format according to the code format information described in the sub-function information. Specifically in the embodiment, the server will screen all the original code sets according to the code format information described in the sub-function information. If there is an original code set in the target format, then the original code set can be retained and the original code sets in other formats can be directly deleted. If there is no original code set in the target format, it is necessary to obtain a new code set in the target format by converting the code format. Furthermore, the server unifies the variable names in each new code set, extracts the context constraints formed during the development of the historical application, and then obtains a more universal target code set.
[0094] In one embodiment, the method includes configuring a data interface between multiple target function modules according to multiple target function modules and interface definition information, including the following steps:
[0095] Step 1: Obtain the function code files corresponding to each function module and the data flow information between multiple target function modules, each function code file includes at least one target function function.
[0096] Step 2: Generate input port parameters and output port parameters of each target function module according to the input parameters and function return values corresponding to each target function.
[0097] Step three: configure the data interface between multiple target functional modules according to the data flow information, input port parameters, and output port parameters.
[0098] In the embodiment, a data stream is a data sequence of a group of ordered bytes with a starting point and an end point. The data in the data sequence can be either raw binary data without processing or specific data that conforms to a certain format after a certain encoding process; the data stream information in the embodiment is used to record the starting point, end point, and specific data content of the data sequence. The target function in the embodiment is a reusable code block that stores a section of code for processing a single task in a code block and then calls it with a short command whenever needed.
[0099] Exemplarily, the application program in the embodiment can run normally. On the one hand, it is necessary for the target function module to perfectly realize the functional requirements; on the other hand, it is necessary for multiple target function modules to collaborate to complete the complete business logic. In the embodiment, the target function module is encapsulated by a code set, and a number of target function functions can be included in the code set. In order to realize the collaboration of multiple target function modules, it is necessary to determine the specific collaboration mode between modules, such as function call, message passing, and shared data structure. Taking the function call mode as an example, in the target function module, each function function can run normally, and the specific data format of the parameters input to the function (i.e., input parameters) and the function return value are all constrained accordingly. However, between different modules, due to the different functions encapsulated inside the module, there are certainly differences in the format requirements for input parameters and return values. Therefore, in the embodiment, after all the target function modules are integrated to obtain the overall framework of the application program, it is necessary to set the input and output port parameters of the module according to the requirements of the target function function in each target function module for input parameters and return values, so as to realize the adaptation of the data interface between the function modules. More specifically, in the embodiment, the interface function can be used to realize the adaptation of the data interface between the target modules. The output result of the previous function module (satisfying the output port parameter) is converted into the output result of the next function module (satisfying the input port parameter) through the interface function through the function operation. In the embodiment, the data interface that connects and cooperates with each other between the target function modules is defined and configured, and multiple target function modules can further ensure that they can cooperate to realize the complete functions and business logic of the application. For example, the application to be constructed in the embodiment includes function module A and function module B. When function module A and function module B are connected through the data interface, in order to enable the business data to flow normally between the two function modules, the server in the embodiment needs to configure the two modules separately. According to the functional requirements of the application software, the function module A obtained by screening mainly performs calculation processing through function x and function y to realize the corresponding target function; the function module B obtained by screening mainly performs calculation processing through function z to realize the corresponding target function. When configuring the data interface between modules, it is first necessary to define the data structure of the input and output parameters of function x and function y in function module A so that the functions in the module can realize normal data flow. Then, the data structure definition of the input parameter of function x is used as the interface definition of the input port of function module A; the data structure definition of the output parameter of function y is used as the interface definition of the output port of function module A; and thus the data interface definition of function module A is completed. Similarly, in the embodiment, the data structure definition of the input and output parameters of function z is used to define the external interface of function module B, so as to form the data interface of function module B.According to the data flow constraints formed by the implementation of the application functions and the data interfaces of the functional modules that have been defined, the functional modules are integrated to form the application in the embodiment, and the corresponding business functions are realized when the business data input is obtained.
[0100] In one embodiment, the process of configuring the data interface between multiple target functional modules according to the data flow information, the input port parameters, and the output port parameters in the method may include the following steps:
[0101] Step 1: Get the dynamically loaded port mapping rule file.
[0102] Step 2: Generate a data flow label for the data transmission mode between multiple target functional modules based on the data flow information.
[0103] Step three, according to the port mapping rule file and input port parameters, map the data flow identifier to the corresponding input port of the target function to obtain a data interface; or, according to the port mapping rule file and output port parameters, map the data flow identifier to the corresponding output port of the target function to obtain a data interface.
[0104] In the embodiment, port mapping is to map one data port to another data port to provide corresponding functional services; and the port mapping rule file (PMRS) in the embodiment is a file for recording specific rules of port mapping.
[0105] Exemplarily, in the embodiment, the data processing to be performed by the target functional module in the business logic is abstracted as a data stream, and a corresponding data stream identifier (stream_id) is assigned. Further, in the embodiment, the server will be based on the port mapping rule file (PMRS), and the corresponding stream_id is mapped to the port (input port or output port) corresponding to the target functional module. More specifically, the application developed in the embodiment has communication between two functional modules, and the communication uses two communication modes, socket and pipe. Each communication mode can have multiple different module ports connected to other ports with different addresses. In the embodiment, the data streams of the two different communication modes are identified as S1 and S2. In the embodiment, through the configuration of PMRS, the S1 data stream is output using the communication port of the pipe, and the S2 data stream is output using the communication port of the socket. In the embodiment, by changing PMRS, the mapping relationship between the data stream and the communication port can be changed. The embodiment uses the mapping rule file and the identification of the data stream to coordinate the functional modules in the application so that normal data flow can be carried out between the functional modules, and the generated application can be guaranteed to realize the corresponding business logic.
[0106] In one embodiment, the process of obtaining the dynamically loaded port mapping rule file may include the following steps:
[0107] Step 1: Obtain the command data and environment variables preset in the program test environment.
[0108] Step 2: dynamically update the port mapping rule file according to the data transmission constraints formed by the instruction data and the environment variables.
[0109] Exemplarily, in the embodiment, the port mapping rule file acquisition module acquires the port mapping rule file in the following manners: the application software acquires the port mapping rule file (PMRS) from the command line, configuration file and / or environment variable in the test environment, or specifies the PMRS through messages acquired through other channels when the application is tested or running.
[0110] Taking the development process of a client application for a financial institution as an example, Figure 4 The complete steps of the application generation method provided in the technical solution of this application are described as follows:
[0111] Step one, obtain the task requirement information for client application development. The developer inputs the application development task through the terminal interactive interface to form the text information of the development task. The terminal uploads the text information of this development task to the server. The server first performs semantic analysis on the text information, and based on the results of the semantic analysis, performs word segmentation on the text information to obtain several text strings. Then, according to the demand analysis rules pre-loaded in the server, the key fields in the several text strings are identified, including but not limited to function description, interface definition, process design, data format, etc. Based on the identified key fields and the semantic analysis results obtained in the aforementioned process, the specific information content or specific attribute values corresponding to the key fields are identified and extracted to obtain the function requirement information and interface definition information.
[0112] Step two, split the requirements to obtain sub-function information and function-related logic information. After obtaining the function requirement information of the application, the function requirement information is segmented through a word segmentation tool with a smaller granularity. For example, through the pre-built segmentation function description dictionary in the server, the description fields used to characterize the segmented functions in the word segmentation results are processed, and according to the corresponding description fields, the various sub-function information under the overall function requirement information is formed. In addition, in the embodiment, the server can also extract the description fields of the connection relationship (such as input, output, transmission and other field contents) in the same way, and form the associated logic information between the modules corresponding to the sub-function information according to the semantic information corresponding to the function requirement information.
[0113] Step three, module screening, to obtain multiple target function modules. According to the various sub-function information obtained in the previous steps, matching and screening are performed in several historical function modules constructed and saved in other application development processes to obtain function modules that can correspond to the business logic described by the sub-function information. In the embodiment, the process of matching and screening function modules can be achieved by keyword matching of functions; for example, in the process of developing other applications, when historical function modules are formed, the historical function modules are annotated with function labels, and when the historical function modules are subsequently screened according to the sub-function information, the function description string corresponding to the sub-function information can be matched with the function label of the historical function module for semantic similarity, thereby screening and obtaining the target function module corresponding to the sub-function information.
[0114] Step 4: Data interface configuration. After all target function modules used to implement the application business logic have been screened and determined based on the sub-function information, it is necessary to define and configure the interfaces of each target function module so that data can interact and flow normally between the function modules. Specifically, the server implements the interface configuration of each target function module based on the interface definition information obtained in the previous steps; for example, the server needs to configure the interface name, interface method, interface address, request parameters, and response parameters of the target function module based on the interface definition information.
[0115] Step 5: Module integration and application generation. After completing the configuration of the data interface between each target functional module, all target functional modules are integrated according to the constraints on the data flow of the business logic formed by the interface definition and the association relationship between the functional modules obtained during the functional split to form the final application. After passing the necessary functional tests, the application can be further launched.
[0116] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0117] Based on the same inventive concept, the embodiment of the present application also provides an application generation device for implementing the above-mentioned application generation method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more application generation method device embodiments provided below can refer to the above-mentioned limitations on the application generation method, and will not be repeated here.
[0118] In one embodiment, Figure 5 As shown, an application generation method device 500 is provided, comprising: a task acquisition module 501, a task parsing module 502, a module screening module 503, an interface definition module 504 and a program generation module 505, wherein:
[0119] The task acquisition module 501 is used to acquire task requirement information corresponding to application development, analyze the task requirement information, and obtain function requirement information and interface definition information;
[0120] Task parsing module 502, used to perform functional decomposition on functional requirement information to form multiple sub-function information and functional association logic information, where the functional association logic is used to characterize the connection relationship between functional modules in the application program;
[0121] The module screening module 503 is used to screen the pre-built function modules according to the multiple sub-function information to obtain multiple target function modules;
[0122] An interface definition module 504, configured to configure data interfaces between multiple target function modules according to multiple target function modules and interface definition information;
[0123] The program generation module 505 is used to integrate multiple target function modules based on the data interface and function association logic information to generate an application program.
[0124] In one embodiment, the module screening module 503 is also used to obtain the original code set corresponding to the pre-built functional module; screen the original code set according to multiple sub-function information to obtain a candidate code set corresponding to the sub-function information; separate the interface code in the candidate code set to obtain a target code set, and the interface code is used to provide an external calling interface for the functional function in the candidate code set; encapsulate the target code set to obtain multiple target functional modules.
[0125] In one embodiment, the module filtering module 503 is also used to obtain preset code format information in multiple sub-function information; according to the code format information, the original code set after filtering is formatted to obtain an intermediate code set; according to the variable information in the multiple sub-function information, the function variables in the intermediate code set are updated to obtain a candidate code set.
[0126] In one embodiment, the interface definition module 504 is also used to obtain the function code files corresponding to each function module and the data flow information between multiple target function modules, each function code file includes at least one target function function; according to the input parameters and function return values corresponding to each target function function, the input port parameters and output port parameters of each target function module are generated respectively; according to the data flow information, the input port parameters, and the output port parameters, the data interface between the multiple target function modules is configured.
[0127] In one embodiment, the interface definition module 504 is also used to obtain a dynamically loaded port mapping rule file; generate a data flow identifier for the data transmission method between multiple target functional modules based on the data flow information; map the data flow identifier to the corresponding input port of the target functional function according to the port mapping rule file and the input port parameters to obtain a data interface; or, map the data flow identifier to the corresponding output port of the target functional function according to the port mapping rule file and the output port parameters to obtain a data interface.
[0128] In one embodiment, the interface definition module 504 is further used to obtain instruction data and environment variables preset in the program test environment; and dynamically update the port mapping rule file according to the data transmission constraints formed by the instruction data and environment variables.
[0129] Each module in the above application generation method device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0130] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pre-built functional module data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an application generation method is implemented.
[0131] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0133] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0134] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0136] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating an application, characterized in that: The method comprises: Obtaining task requirement information corresponding to application development, analyzing the task requirement information, and obtaining function requirement information and interface definition information; Performing functional splitting on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program; Screening the pre-built functional modules according to the plurality of sub-functional information to obtain a plurality of target functional modules; According to the plurality of target function modules and the interface definition information, configuring data interfaces between the plurality of target function modules; Based on the data interface and the function-related logic information, the multiple target function modules are integrated to generate an application program.
2. The method according to claim 1, characterized in that The pre-built function modules are screened according to the plurality of sub-function information to obtain a plurality of target function modules, including: Get the original code set corresponding to the pre-built functional module; Filtering the original code set according to the plurality of sub-function information to obtain a candidate code set corresponding to the sub-function information; Separating the interface code in the candidate code set to obtain a target code set, wherein the interface code is used to provide an external calling interface for the function function in the candidate code set; The target code set is encapsulated to obtain the multiple target function modules.
3. The method according to claim 2, characterized in that The original code set is screened according to the plurality of sub-function information to obtain a candidate code set corresponding to the sub-function information, comprising: Acquire code format information preset in the plurality of sub-function information; According to the code format information, the format of the original code set after screening is converted to obtain an intermediate code set; According to the variable information in the plurality of sub-function information, the function variables in the intermediate code set are updated to obtain the candidate code set.
4. The method according to claim 1, characterized in that: The configuring the data interface between the multiple target function modules according to the multiple target function modules and the interface definition information comprises: Acquire the function code files corresponding to each function module and the data flow information between the plurality of target function modules, each of the function code files including at least one target function function; Generate input port parameters and output port parameters of each target function module according to the input parameters and function return values corresponding to each target function function; The data interfaces between the plurality of target functional modules are configured according to the data flow information, the input port parameters, and the output port parameters.
5. The method according to claim 4, characterized in that The configuring the data interface between the plurality of target function modules according to the data flow information, the input port parameter, and the output port parameter comprises: Get the dynamically loaded port mapping rule file; Generate a data flow identifier of a data transmission mode between the plurality of target functional modules according to the data flow information; According to the port mapping rule file and the input port parameters, the data flow identifier is mapped to the corresponding input port of the target function to obtain the data interface; or, according to the port mapping rule file and the output port parameters, the data flow identifier is mapped to the corresponding output port of the target function to obtain the data interface.
6. The method according to claim 5, characterized in that The obtaining of the dynamically loaded port mapping rule file comprises: Get the command data and environment variables preset in the program test environment; The port mapping rule file is dynamically updated according to the data transmission constraints formed by the instruction data and the environment variables.
7. An application generation method and device, characterized in that: The device comprises: The task acquisition module is used to acquire the task requirement information corresponding to the application development, analyze the task requirement information, and obtain the function requirement information and interface definition information; A task analysis module, used to perform functional decomposition on the functional requirement information to form a plurality of sub-function information and functional association logic information, wherein the functional association logic is used to characterize the connection relationship between the functional modules in the application program; A module screening module, used for screening pre-built function modules according to the plurality of sub-function information to obtain a plurality of target function modules; An interface definition module, configured to configure data interfaces between the plurality of target function modules according to the plurality of target function modules and the interface definition information; A program generation module is used to integrate the multiple target function modules based on the data interface and the function association logic information to generate an application program.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Code processing method and device, equipment, storage medium and program product
CN120723248A