Method and device for generating software based on large model technology, medium and electronic equipment

Through the method based on large-model technology, software is automatically generated, which solves the problem of low efficiency of existing software development technology and realizes efficient and accurate software code generation.

CN120085843AActive Publication Date: 2025-06-03INTELLIGENT GENERATION (BEIJING) TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510155543.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-06-03
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

Existing software development technology is inefficient, relies on manual code writing, and existing code generation tools can only generate some code snippets for specific programming languages ​​or frameworks, resulting in low development efficiency.

Method used

Using a method based on big model technology, we obtain user demand information, generate configuration definition files, and generate target software code through code generation, and finally generate front-end and back-end pages through the rendering engine to achieve automatic software generation.

Benefits of technology

It realizes the accurate conversion of user demand information into software code, improves the accuracy and efficiency of code generation, reduces the need for manual encoding, and improves the efficiency of software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120085843A_ABST
    Figure CN120085843A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a device for generating software based on a large model technology, a medium and electronic equipment, and relates to the technical field of software generation, and the method comprises the following steps: acquiring demand information of a user for software generation; generating a configuration definition file corresponding to the large model generation demand information through a preset code, wherein the configuration definition file is a configuration file of a domain-specific language definition device; performing regular format reformatting processing on the configuration definition file to obtain a processed file; based on the processed file, determining a service flow logic corresponding to a service function in the to-be-generated software, and based on the service flow logic, generating a target software code corresponding to the to-be-generated software through a code generation large model, the format of the target software code being a configuration file format of the domain-specific language definition device; and based on the target software code, through a preset rendering engine, generating a front-end page and a rear-end page of the software needing to be generated. The method has the effect of improving the software development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of software generation, and specifically relates to a method, device, medium and electronic device for generating software based on large model technology. Background Art

[0002] Software development is the process of building a software system or the software part in a system according to user requirements. Software development is a systematic project including requirement capture, requirement analysis, design, implementation and testing. Software is generally implemented in a certain programming language. Usually, software development tools can be used for development. Software is divided into system software and application software, and it does not only include programs that can run on a computer. Files related to these programs are generally considered to be part of the software. Software development shows its irreplaceable importance in meeting user needs, promoting business development, and promoting economic development. It is not only an important part of the development of modern science and technology, but also a key force to promote the all-round progress of society.

[0003] Currently, the commonly used method for software development is: relying on programmers to manually write code, and at the same time using existing partial code generation tools for assisted coding. However, these tools can usually only generate partial code snippets for specific programming languages or frameworks, and the improvement of the development efficiency of manually written code software development is limited, resulting in low software development efficiency. Summary of the Invention

[0004] To improve the efficiency of software development, this application provides a method, device, medium and electronic device for generating software based on large model technology.

[0005] In the first aspect of this application, a method for generating software based on large model technology is provided, specifically including: Obtain the requirement information for software generation from the user; Generate a configuration definition file corresponding to the requirement information through a preset code generation large model. The configuration definition file is a configuration file of a domain-specific language definition tool, and the code generation large model is a large model with the ability to generate corresponding software code according to the user's requirement information; Perform reformatting processing on the configuration definition file in regular format to obtain a processed file; Based on the processed file, determine the business flow logic corresponding to the business functions in the software to be generated, and based on the business flow logic, generate the target software code corresponding to the software to be generated through the code generation large model. The format of the target software code is the configuration file format of a domain-specific language definition tool; Based on the target software code, generate the front-end page and back-end page of the software to be generated through a preset rendering engine.

[0006] By adopting the above technical solutions, the requirement information generated by the user for the software is obtained, and this requirement information is converted into a configuration definition file, so as to realize the conversion of the requirement information into a unified and standardized JSON DSL format, thereby ensuring the accuracy and consistency of the requirement information in software generation and improving the accuracy of code generation. Then, the configuration definition file is re-formatted to implement format verification. Further, based on the processed file representing the user's requirements, the business flow logic of each business function in the software to be generated is determined, providing an important basis for subsequent software code generation. Then, the target software code is generated through the code generation large model. Finally, based on the code, the front-end and back-end pages of the software to be generated are rendered through the rendering engine, completing the automatic generation of the software. The user only needs to input the requirement information and does not need to participate in coding manually. Based on the code generation large model, the corresponding software is automatically generated quickly and efficiently, thereby improving the efficiency of software development.

[0007] Optionally, before obtaining the requirement information generated by the user for the software, it further includes: Introduce a Latent key-value cache into the multi-head self-attention mechanism of the Transformer model, and store an expert gate in the Latent key-value cache to obtain an initial large model; Input a preset code data sample into the initial large model and perform attention QKV calculation to obtain a KV intermediate result; Store the KV intermediate result in the Latent key-value cache, and establish a mapping relationship between the KV intermediate result and a preset expert module through the expert gate; Input a preset Token sample into the initial large model for pre-training. Based on the mapping relationship, add an expert dimension to the hidden layer output corresponding to the Token sample, and repeat the step of inputting the preset Token sample into the initial large model for pre-training until the model converges to obtain a pre-trained large model; Fine-tune the pre-trained large model to obtain a code generation large model.

[0008] By adopting the above technical solutions, introducing a Latent key-value cache to store the KV intermediate result facilitates establishing a mapping relationship between the KV intermediate result and a preset expert module through the expert gate. Then, the Token sample is input into the initial large model for pre-training, and through the Token sample attention Q, a more matching KV intermediate result is found from each KV intermediate result. Then, based on the mapping relationship, a more suitable expert module is quickly and accurately assigned to the input Token sample. Further, the pre-trained large model is fine-tuned to continuously optimize its ability to generate software code, and finally a code generation large model is obtained.

[0009] Optionally, generating the configuration definition file corresponding to the requirement information through the pre-set code generation large model specifically includes: Determine whether the requirement information is text-based; If not, convert the requirement information into the target token corresponding to the text requirement through the Qformer multimodal compatibility network structure introduced in the pre-set code generation large model; Determine the configuration definition file corresponding to the requirement information through the pre-set prompt engineering and the target token using the code generation large model.

[0010] By adopting the above technical solution, if it is not a text requirement, then through the Qformer multimodal compatibility network structure introduced in the code generation large model, which can be used as the preprocessing part of the input of the code generation large model to process and fuse multimodal data and convert it into information suitable for the code generation large model to process. Finally, convert the target token into a configuration definition file to realize the conversion of the requirement information into a unified and standardized JSON DSL format, thereby ensuring the accuracy and consistency of the requirement information in software generation.

[0011] Optionally, reformatting the configuration definition file in regular format to obtain a processed file specifically includes: Perform format verification on the configuration definition file and determine whether the configuration format of the database fields in the configuration definition file is correct; When the format verification of the configuration definition file fails or the configuration format is incorrect, perform regular matching on the configuration definition file, extract the key fields and corresponding value values in the configuration definition file and perform verification to obtain the verified result; Based on the configuration definition file, determine the missing key fields in the verified result and fill default values for the missing key fields to obtain the processed file.

[0012] By adopting the above technical solution, when the format verification of the configuration definition file fails or the configuration format is incorrect, perform regular matching on the configuration definition file, so as to better verify the format and integrity of the configuration definition file representing the user's requirements, and thus facilitate the subsequent code generation large model to better understand the user's requirements for software generation based on the processed file.

[0013] Optionally, determining the business flow logic corresponding to the business functions in the software to be generated based on the processed file specifically includes: Create a target Base table in the database, and the fields in the target Base table have consistent front-end and back-end logics in any business scenario; Based on the processed file, select the first fields corresponding to a single business function in the software from the target Base table, and summarize each of the first fields to obtain a user behavior object table, where the first fields are fields related to user behavior objects; Based on the processed file, select the second fields corresponding to a single business function in the software from the target Base table, and summarize each of the second fields to obtain a user table, where the second fields are fields related to users; Based on the processed file, select the third fields corresponding to a single business function in the software from the target Base table, and summarize each of the third fields to obtain a user behavior table, where the third fields are fields related to user behavior; Based on the user behavior object table, user table, and user behavior table corresponding to a single business function, describe the business logic of the corresponding business function to be generated in the software to obtain the corresponding business flow logic.

[0014] By adopting the above technical solution, based on the user's requirement information, and based on three dimensions of users, user behavior, and user behavior objects, select the fields that may be dependent from the target Base table to obtain a user table, a user behavior table, and a user behavior object table. Further, based on the fields on which the business function depends, accurately describe the business flow logic of the business function to be generated in the software through these three tables.

[0015] Optionally, the step of describing the business logic of the corresponding business function to be generated in the software based on the user behavior object table, user table, and user behavior table corresponding to a single business function to obtain the corresponding business flow logic specifically includes: For a single business function, based on the user behavior object table and the user table, determine the business logic behavior nodes corresponding to a single user behavior in the user behavior table. The business logic behavior nodes include the upstream node, current node, and downstream node of a single user behavior. The upstream node represents the state of the single user behavior at the previous moment, the current node represents the current state of the single user behavior, and the downstream node represents the state of the single user behavior at the next moment; Assemble each of the business logic behavior nodes to obtain the business flow logic of the corresponding business function to be generated in the software.

[0016] By adopting the above technical solution, assemble the various business logic behavior nodes corresponding to the same business function to obtain the business flow logic of the corresponding business function to be generated in the software, thereby forming the correct dependence of this business function on the fields in the target Base table, enabling the business flow logic to be more accurately described through the target Base table, and further making the business flow logic of the business function more reasonable.

[0017] Optionally, fine-tuning the pre-trained large model to obtain a code generation large model specifically includes: Determine a preset third-party large model as the teacher model, and train the teacher model with preset open-source code snippets to obtain a converged teacher model, where the converged teacher model has the ability to identify code correctness and modify code; Determine the pre-trained large model as the student model, and guide the student model to perform fine-tuning training through the converged teacher model to obtain a fine-tuned large model; If the performance metric data of the fine-tuned large model on the validation set is better than the performance metric data of the converged teacher model on the validation set, then switch the fine-tuned large model to the self-learning stage for training to obtain a code generation large model.

[0018] By adopting the above technical solution, if the performance metric data of the fine-tuned large model on the validation set is better than the performance metric data of the converged teacher model on the validation set, it means that the performance of the fine-tuned large model in code optimization is better than that of the converged teacher model at this time. Then, switch the fine-tuned large model from the teaching stage to the self-learning stage for training, and finally obtain a code generation large model, thereby continuously optimizing the effect of the model in generating software code.

[0019] In the second aspect of the present application, a device for generating software based on large model technology is provided, specifically including: An information acquisition module, configured to acquire requirement information of a user for software generation; A file configuration module, configured to generate a configuration definition file corresponding to the requirement information through a preset code generation large model, where the configuration definition file is a configuration file of a domain-specific language definer, and the code generation large model is a large model with the ability to generate corresponding software code according to the requirement information of the user; A format processing module, configured to perform reformatting processing on the configuration definition file in a regular format to obtain a processed file; A logic determination module, configured to determine the business flow logic corresponding to the business functions in the software to be generated based on the processed file, and based on the business flow logic, generate the target software code corresponding to the software to be generated through the code generation large model, where the format of the target software code is the configuration file format of the domain-specific language definer; A code rendering module, configured to generate the front-end page and the back-end page of the software to be generated based on the target software code through a preset rendering engine.

[0020] After the information acquisition module obtains the requirement information generated by the user for the software by adopting the above technical solution, the file configuration module generates a configuration definition file corresponding to the requirement information. Then, the format processing module performs reformatting processing on the configuration definition file in a regular format to obtain a processed file. Next, the logic determination module determines the business flow logic corresponding to the business functions in the software to be generated, and based on the business flow logic, generates the target software code corresponding to the software to be generated through a code generation large model. Finally, the code rendering module generates the front-end page and the back-end page of the software to be generated based on the target software code through a preset rendering engine.

[0021] In the third aspect of the present application, a computer-readable storage medium is provided. A computer program is stored in the computer-readable storage medium. When the computer program is loaded and executed by a processor, the method steps described in any one of the first aspect are executed.

[0022] In the fourth aspect of the present application, an electronic device is provided, specifically including: A processor, a memory, and a computer program stored in the memory and capable of running on the processor. The processor is used to load and execute the computer program stored in the memory so that the electronic device executes the method described in any one of the first aspect.

[0023] In summary, the present application includes at least one of the following beneficial technical effects: The requirement information generated by the user for the software is obtained, and this requirement information is converted into a configuration definition file, thereby realizing the conversion of the requirement information into a unified and standardized JSON DSL format, further ensuring the accuracy and consistency of the requirement information in software generation, and improving the accuracy of code generation. Then, the configuration definition file is re-formatted to realize format verification. Further, based on the processed file representing the user's requirements, the business flow logic of each business function in the software to be generated is determined, which provides an important basis for subsequent software code generation. Then, the target software code is generated through a code generation large model. Finally, the front-end and back-end pages of the software to be generated are rendered based on the code through a rendering engine, completing the automatic generation of the software. The user only needs to input the requirement information and does not need to participate in coding manually. Based on the code generation large model, the corresponding software is automatically generated quickly and efficiently, thereby improving the efficiency of software development. Description of the Drawings

[0024] Figure 1 is a schematic flowchart of a method for generating software based on large model technology provided by an embodiment of the present application; Figure 2 is a schematic structural diagram of a device for generating software based on large model technology provided by an embodiment of the present application; Figure 3It is a schematic structural diagram of another device for generating software based on large model technology provided by an embodiment of the present application.

[0025] Explanation of reference numerals: 11, information acquisition module; 12, file configuration module; 13, format processing module; 14, logic determination module; 15, code rendering module; 16, model determination module. Detailed implementation manners

[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.

[0027] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for illustration" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "exemplary", "for example" or "for illustration" is intended to present relevant concepts in a specific manner.

[0028] In the description of the embodiments of the present application, the term "and / or" only describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and both A and B exist simultaneously. In addition, unless otherwise specified, the meaning of the term "plural" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise particularly emphasized in other ways.

[0029] See Figure 1 , an embodiment of the present application discloses a schematic flowchart of a method for generating software based on large model technology, which can be implemented depending on a computer program or run on a device for generating software based on large model technology based on the von Neumann architecture. This computer program can be integrated in an application or run as an independent tool class application, and specifically includes: S101: Obtain the requirement information generated by the user for the software.

[0030] Specifically, in the embodiments of the present application, the user is a user who wants to generate a certain type of software product. The requirement information is the functional requirement information, performance requirement information, or security requirement information, etc. of the software to be generated by the user, that is, the software product to be generated. Exemplarily, the requirement information may be: generating an e-commerce shopping software with functions such as multi-channel payment and shopping cart. In other embodiments, the requirement information may also be: adding functions such as shopping cart to an existing e-commerce shopping software. Further, the requirement information may be text requirement information. In other embodiments, the requirement information may also be non-text requirement information, specifically, it may be one of video, picture, or voice, or a combination of multiple forms such as video, picture, or voice.

[0031] In addition, the execution subject of a method for generating software based on large model technology disclosed in the embodiments of the present application is a server. The server is wirelessly connected to the user's terminal. The user's terminal may be a personal computer or a tablet computer. A client related to software automatic generation is installed in the terminal. The server may be the background server corresponding to the client, specifically, it may be an independent physical server or a server cluster composed of multiple physical servers. Further, a feasible way to obtain requirement information is: the user inputs the requirement information for the software to be generated in the client in the terminal, and the client sends the requirement information to the server through the Software Development Kit (SDK), and finally the server obtains the requirement information of the user for software generation.

[0032] In other embodiments, before obtaining the requirement information of the user for software generation, it further includes: introducing a Latent key-value cache into the multi-head self-attention mechanism of the Transformer model and storing expert gating in the Latent key-value cache to obtain an initial large model; Inputting a preset code data sample into the initial large model and performing attention QKV calculation to obtain a KV intermediate result; Storing the KV intermediate result in the Latent key-value cache and establishing a mapping relationship between the KV intermediate result and a preset expert module through expert gating; Inputting a preset Token sample into the initial large model for pre-training, adding an expert dimension to the hidden layer output corresponding to the Token sample based on the mapping relationship, and repeating the step of inputting the preset Token sample into the initial large model for pre-training until the model converges to obtain a pre-trained large model; Fine-tuning the pre-trained large model to obtain a code generation large model.

[0033] Specifically, the Multi-Head Self-Attention (MSA) mechanism is a core component in the Transformer model. It obtains the attention distributions of different subspaces of the input sequence by running multiple independent attention mechanisms in parallel, thereby more comprehensively capturing various potential semantic associations in the sequence. The Latent key-value cache is a data structure for storing key-value pairs, used to store and quickly retrieve information. Expert-Gating refers to a mechanism in deep learning models, especially in architectures with multiple expert modules, for efficiently allocating input data to different expert modules. Its core goal is to dynamically determine which expert module to route the data to for processing based on the input features, in order to improve the overall performance and efficiency of the model. The attention QKV calculation is the core part of the attention mechanism. By generating three matrices: Query (Q), Key (K), and Value (V), and calculating the attention analysis, it finally realizes the effective processing and information extraction of the model's input. Among them, the Key matrix and the Value matrix are called KV intermediate results. Further, the Latent key-value cache is introduced into the multi-head self-attention mechanism of the Transformer model, and the expert gating is stored in the Latent key-value cache to obtain the initial large model.

[0034] Further, input the preset code data sample into the initial large model. During the process, the input data sample is processed into tokens, and then the attention QKV calculation is performed to obtain the KV intermediate results. Then, store multiple KV intermediate results in the Latent key-value cache. Next, calculate the correlation between the KV intermediate results and the preset expert modules through expert gating, and then determine the mapping relationship between the KV intermediate results and the preset expert modules. Then, input the preset Token sample into the initial large model for pre-training. During the process, calculate the attention Q of the Token sample, and then determine the matching degree between the attention Q of this Token sample and the KV intermediate results. Finally, based on the mapping relationship between the KV intermediate results and the expert modules, allocate a more suitable expert module to the KV intermediate result with the highest matching degree, and then add the expert dimension of this expert module to the hidden layer output corresponding to the Token sample, enabling the model to continuously learn to allocate suitable expert modules according to the input Tokens, and at the same time enabling the model to continuously learn the ability to understand user needs and the ability to accurately generate software code using suitable expert modules. Further, repeat the step of inputting the preset Token sample into the initial large model for pre-training until the model converges to obtain the pre-trained large model.

[0035] Exemplarily, usually the output of the model's hidden layer is u(t), while after adding the expert dimension, the hidden layer output is u(t, e), which means that at time step t, the model output is related not only to time but also to the corresponding expert module. Among them, the Token sample is a token that simulates the user's requirements for software generation. In addition, the process of determining the matching degree between the attention Q of the Token sample and the intermediate result of KV is as follows: The intermediate result of KV includes {(K 1 , V 1 ), (K 2 , V 2 )......(K n , V n ), and then calculate the cosine similarity between the attention Q of the Token sample and K 1 , K 2 ......K n respectively, so as to determine the matching degree with the intermediate result of KV.

[0036] In another embodiment, in order to continuously optimize the effect of the model in generating software code, after the pre-training is completed, the pre-trained large model is fine-tuned to finally obtain a code generation large model. A feasible implementation is as follows: The preset third-party large model is used as the teacher model, and the third-party large model uses GPT4. In this teacher model, roles such as the questioner and the programmer are initialized, and their multi-round interactions and the corresponding docker environment for isolated operation are initialized. Then, the teacher model is trained with the preset open-source code snippets. The specific process is as follows: Import the preset open-source code snippets, ask questions according to the corresponding prompt words for the input, then add the open-source code snippets to the interpreter for execution. If an error occurs during execution, the feedback result is described in natural language and informed to the questioner role, and is displayed in the conversation context of the teacher model. Then, a new question is formed based on the feedback result and informed to the programmer role, so that the input open-source code snippets are modified and optimized, and the modified code is attached to the context conversation. This process is continuously iterated until the teacher model reaches a convergence state, and a converged teacher model with the ability to identify code correctness and modify code is obtained. Further, the pre-trained large model is used as the student model, and the converged teacher model is used to guide the fine-tuning training of the student model, that is, enter the teaching stage, and a fine-tuned large model is obtained. At the same time, a preset validation set is used to evaluate and test the fine-tuned large model and the converged teacher model. If the performance index data of the fine-tuned large model on the validation set is better than the performance index data of the converged teacher model on the validation set, it means that the performance of the fine-tuned large model in code optimization is better than that of the converged teacher model at this time. Then, the fine-tuned large model is switched from the teaching stage to the self-learning stage for training, and finally a code generation large model is obtained. If the performance index data of the fine-tuned large model on the validation set is not better than the performance index data of the converged teacher model on the validation set, then continue to enter the teaching stage, and the converged teacher model is used to guide the training of the student model. It should be noted that the performance index data can be the accuracy rate of the model on the validation set, or the recall rate or F1 value, etc.‌ S102: Generate a configuration definition file corresponding to the requirement information through a preset code generation large model, and the configuration definition file is a configuration file of a domain-specific language definer.

[0037] Specifically, the code generation large model is a large model capable of generating corresponding software code according to the user's requirement information. The Domain Specific Language (DSL) definer is a tool or component used to create, define, and manage DSL. It can design the language grammar and semantics suitable for the domain according to the domain's requirements. The configuration definition file is the configuration file of the DSL definer, and its file format is the JSON DSL format. The JSON DSL format has the advantages of structured data storage and easy parsing, and is suitable for simple DSL definition and configuration information storage. Further, after obtaining the requirement information, it is determined whether the requirement information is text-based, that is, the requirement information described in text. If it is not text-based, then the Qformer multimodal compatibility network structure introduced in the code generation large model is used. It can be used as the preprocessing part of the input to the code generation large model to process and fuse multimodal data and convert it into information suitable for the code generation large model to process. Specifically, this requirement information is converted into the target token corresponding to the text requirement through the Qformer multimodal compatibility network structure. Here, the token is the basic unit when the large language model processes the input text, and it can be a word, subword, character, or other text segments.

[0038] Further, through the preset prompt engineering and the target token, that is, the prompt engineering and the target token are input into the code generation large model at the same time, and the configuration definition file corresponding to the requirement information is obtained, so as to realize the conversion of the requirement information into a unified and standardized JSON DSL format, and further ensure the accuracy and consistency of the requirement information in software generation. It should be noted that prompt engineering involves designing and optimizing input prompts (prompts) to guide artificial intelligence models (especially large language models, such as GPT series, BERT, etc.) to generate more accurate, useful, and high-quality outputs. By carefully constructing input prompts and leveraging the powerful capabilities of artificial intelligence models, they can perform better in various tasks, such as text generation, machine translation, question answering systems, code generation, text summarization, etc.

[0039] S103: Reformat the configuration definition file in regular format to obtain the processed file.

[0040] Specifically, after determining the configuration definition file corresponding to the requirement information, reformat it in regular format to obtain the processed file, thereby improving the readability of the configuration definition file, checking for syntax errors, cleaning data, and achieving format standardization, which is conducive to better subsequent generation of software code. A feasible processing method is as follows: perform format verification on the configuration definition file and determine whether the configuration format of the database fields in the configuration definition file is correct. Among them, since the JSON DSL format is a special JSON format, format verification mainly performs JSON format verification. If the formats are all correct, it is confirmed that the format verification passes; in addition, database fields refer to the columns in a database table, which are the basic components of the database and are used to store specific types of data. Further, when the format verification of the configuration definition file fails or the configuration format is incorrect, perform regular matching on the configuration definition file, check each key field and its corresponding value in the configuration definition file one by one, and obtain the verified result. Among them, regular matching is a process of text operation using regular expressions. Finally, create a new file in JOSN DSL format with the verified correct result, and then determine the missing key fields compared with the configuration definition file, that is, the missing key fields. Complete these missing key fields and their corresponding value in the new JOSN DSL format file, specifically fill them with default values, and finally obtain the processed file.

[0041] S104: Based on the processed file, determine the business flow logic corresponding to the business functions in the software to be generated, and based on the business flow logic, generate the target software code corresponding to the software to be generated through a code generation large model.

[0042] Specifically, the format of the target software code is the configuration file format of the domain-specific language definer. The business process logic refers to a series of operation sequences, conditional judgments, and interaction relationships that describe the business function from startup to completion. It is an important basis for ensuring the normal operation of software functions, handling exceptions, and ensuring data consistency. The business function refers to a specific service or operation provided in the software to meet user or business requirements. It is a functional unit with a clear business purpose in the software system and completes specific tasks through a series of operations and processes. Further, in the embodiment of the present application, a feasible way to determine the business process logic corresponding to a single business function in the software to be generated is as follows: Establish a target Base table in the database of the server. Specifically, crawl GitHub through web scraping technology to obtain the target Base table. The target Base table includes multiple different fields, and the front-end and back-end logics are consistent in any business scenario, that is, in different business scenarios, the logical meanings and processing methods carried by the fields in the target Base table are the same or compatible in the front-end and back-end. It should be noted that through the target Base table, the business process logic can be clearly sorted out and described because it clarifies the storage and operation sources of data. When designing the business logic, the integrity and consistency of data can be ensured according to the structure of the target Base table.

[0043] Further, based on the processed file (representing the user's requirement information), select the first fields corresponding to a single business function in the software to be generated from the target Base table. The first fields are fields related to the user behavior object. Exemplarily, if the software to be generated is an e-commerce shopping software and the business function is the "shopping cart" function in the e-commerce shopping software, then the user behavior object is the quantity, price, name, etc. of the commodity. Then the first fields finally selected from the target Base table are fields such as quantity, price, name, etc. Summarize the selected first fields to obtain the user behavior object table. Among them, the user behavior object refers to an entity or data structure used to describe the user's execution of a certain behavior in the software system or network environment. It includes the operations performed by the user when using the system, the objects of the operations, and the relevant information of the operations.

[0044] Further, based on the processed file, select the second fields corresponding to a single business function in the software to be generated from the target Base table. The second fields are fields related to the user. Exemplarily, if the business function is the "shopping cart" function, the fields related to the user involved in this function can be the user name and user ID logged in the e-commerce shopping software, etc. This is because the prerequisite for the user to add a commodity to their shopping cart is to have completed logging in. Then the second fields are the fields corresponding to the user name and user ID, etc. Finally, summarize the second fields to obtain the user table.

[0045] Further, based on the processed file, the third fields corresponding to a single business function in the software to be generated are selected from the target Base table. The third fields are fields related to user behavior. Exemplarily, if the business function is the "shopping cart" function, which involves a user adding an item to the shopping cart or deleting an item from the shopping cart, etc., then the third fields involve fields related to user behaviors such as adding and deleting. Finally, each third field is summarized to obtain the user behavior table. It should be noted that for each different business function in the software to be generated, the first field, the second field, and the third field selected from the target Base table are also different.

[0046] Finally, based on the user behavior object table, the user table, and the user behavior table corresponding to a single business function, the business logic of the corresponding business function in the software to be generated is described to obtain the corresponding business flow logic. One implementable implementation is: for a single business function, based on its user behavior object table and user table, determine the business logic behavior nodes corresponding to a single user behavior in the user behavior table, which include the upstream node, the current node, and the downstream node of a single user behavior. The upstream node represents the state of the single user behavior at the previous moment, the current node represents the current state of the single user behavior, and the downstream node represents the state of the single user behavior at the next moment. The upstream node, the current node, and the downstream node can all be understood as operation nodes. Exemplarily, for the user behavior of "placing an order" in an e-commerce shopping software, the state of this user behavior at the previous moment is that the user has logged in. This operation depends on the information in fields such as the username or user ID in the user table. Then, configure the upstream node to depend on fields such as the username. The current state of this user behavior is the interface for placing an order and paying for the goods. This operation depends on the information in fields such as the product name in the user behavior object table. Then, configure the current node to depend on fields such as the product name. The state of this user behavior at the next moment is that a new order is added to the order information. This operation depends on the information in fields related to the order information in the user behavior object table. Then, configure the downstream node to depend on fields such as the order information.

[0047] Further, assemble the various business logic behavior nodes corresponding to the same business function to obtain the business flow logic of the corresponding business function in the software to be generated, thereby forming the correct dependence of this business function on the fields in the target Base table, enabling the business flow logic to be more accurately described through the target Base table, and further making the business flow logic of the business function more reasonable. Finally, based on the business flow logic corresponding to the business function, use a code generation large model to generate the target software code corresponding to the software to be generated.

[0048] S105: Based on the target software code, use a preset rendering engine to generate the front-end page and the back-end page of the software to be generated.

[0049] Specifically, after determining the target software code corresponding to the software to be generated according to the requirement information, it is necessary to render the front-end and back-end pages corresponding to the software to be generated based on the target software code. The front-end page is the direct entry and interface for users to interact with the software system. Only by rendering the front-end page can various functions of the software be presented to users in a visual form, enabling users to conveniently operate and obtain information. The back-end page is responsible for processing core functions such as business logic and data storage. Although not directly visible to users, it also needs to handle corresponding requests and responses according to the front-end requests to ensure the normal operation of the entire software system. Further, the target software code is respectively converted into code in JavaScript format and Python format, and then based on the JavaScript format code, the front-end page of the software to be generated is rendered through the front-end rendering engine. Finally, based on the Python format code, the back-end page of the software to be generated is rendered through the back-end rendering engine, thus finally completing the automatic generation of the corresponding software to be generated based on the requirement information generated by the user for the software using the large model technology. Among them, the front-end rendering engine uses Blink, and the back-end rendering engine uses Tornado.

[0050] In one embodiment, at least one target group type of the software to be generated is obtained. After the software to be generated is released and used by users for downloading, the target business functions with optimization feedback from historical users are obtained, and the first occurrence times of each target business function are counted. The greater the first occurrence times, the more likely the users are to have optimization feedback on the corresponding target business function in the software to be generated, and the more the corresponding target business function needs to be optimized. According to the order from largest to smallest of the first occurrence times, the first number of target business functions is selected from each target business function and determined as the key business functions, that is, the business functions that are likely to have optimization feedback; then the group types of historical users with optimization feedback on a single key business function are obtained, and the second occurrence times of each group type are counted. According to the order from largest to smallest of the second occurrence times, the second number of group types is selected from each group type and determined as the key group types of the corresponding key business functions.

[0051] Further, determine the first weight of each key business function, where the first weight is the ratio of the first occurrence count of each key business function to the sum of the first occurrence counts of all key business functions, and determine the second weight of each key group type corresponding to each key business function, where the second weight is the ratio of the second occurrence count of a single key group type corresponding to the key business function to the sum of the second occurrence counts of all corresponding key group types. Identify the key business functions with the target group type among the corresponding key group types as reference business functions, calculate the first product of the first weight of each reference business function and the second weight of the corresponding target group type, and sum up the first products to obtain the sum of the first products. The larger the sum of the first products, the greater the likelihood that the software to be generated needs to optimize its business functions for its target population. If the sum of the first products exceeds a preset threshold, indicating a high likelihood, then determine to optimize the software to be generated to better meet the needs of the target population, and determine the iterative optimization order of the corresponding reference business functions based on each first product. The larger the first product, the higher the iterative optimization order. Additionally, calculate the second product of the first weight of each key business function and the second weight of each corresponding key group type, and sum up the second products to obtain the sum of the second products corresponding to each key business function. Select the largest sum of the second products from the sums of the second products, and the key business function corresponding to the largest sum of the second products is determined as the business function to be modified. That is, when the code generation large model generates the code for this business function to be modified, the code generation effect is poor. Then determine to iteratively optimize the ability of the code generation large model to generate the code for the business function to be modified.

[0052] The implementation principle of the method for generating software based on large model technology in this application embodiment is as follows: Obtain the requirement information generated by the user for the software, and convert this requirement information into a configuration definition file, thereby realizing the conversion of the requirement information into a unified and standardized JSON DSL format, and further ensuring the accuracy and consistency of the requirement information in software generation and improving the accuracy of code generation. Then, perform reformatting processing on the configuration definition file to achieve format verification. Further, based on the processed file representing the user's requirements, determine the business flow logic of each business function in the software to be generated, providing an important basis for subsequent software code generation. Then, generate the target software code through the code generation large model. Finally, use the rendering engine to render and generate the front-end and back-end pages of the software to be generated based on the code, completing the automatic generation of the software. The user only needs to input the requirement information and does not need to participate in coding manually. Based on the code generation large model, the corresponding software can be automatically generated quickly and efficiently, thereby improving the efficiency of software development.

[0053] The following is an embodiment of the apparatus of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the method embodiment of the present application.

[0054] Please refer to Figure 2 , which is a schematic structural diagram of an apparatus for generating software based on large model technology provided by an embodiment of the present application. The apparatus applied to generating software based on large model technology can be implemented as all or part of the apparatus through software, hardware, or a combination of both. The apparatus includes an information acquisition module 11, a file configuration module 12, a format processing module 13, a logic determination module 14, and a code rendering module 15.

[0055] The information acquisition module 11 is used to acquire requirement information generated by the user for the software; The file configuration module 12 is used to generate a configuration definition file corresponding to the requirement information through a preset code generation large model. The configuration definition file is a configuration file of a domain-specific language definition, and the code generation large model is a large model capable of generating corresponding software code according to the requirement information of the user; The format processing module 13 is used to reformat the configuration definition file in a regular format to obtain a processed file; The logic determination module 14 is used to determine the business flow logic corresponding to the business functions in the software to be generated based on the processed file, and based on the business flow logic, generate the target software code corresponding to the software to be generated through the code generation large model. The format of the target software code is the configuration file format of the domain-specific language definition; The code rendering module 15 is used to generate the front-end page and the back-end page of the software to be generated based on the target software code through a preset rendering engine.

[0056] Optionally, as Figure 3 shown, the apparatus further includes a model determination module 16, which is specifically used for: Introduce a Latent key-value cache into the multi-head self-attention mechanism of the Transformer model, and store an expert gate in the Latent key-value cache to obtain an initial large model; Input a preset code data sample into the initial large model, and perform attention QKV calculation to obtain a KV intermediate result; Store the KV intermediate result in the Latent key-value cache, and establish a mapping relationship between the KV intermediate result and a preset expert module through the expert gate; Input a preset Token sample into the initial large model for pre-training. Based on the mapping relationship, add an expert dimension to the output of the hidden layer corresponding to the Token sample, and repeat the step of inputting the preset Token sample into the initial large model for pre-training until the model converges to obtain the pre-trained large model. Fine-tune the pre-trained large model to obtain the code generation large model.

[0057] Optionally, the file configuration module 12 is specifically used for: Determine whether the requirement information is text-based. If not, convert the requirement information into the target token corresponding to the text requirement through the Qformer multimodal compatibility network structure introduced in the preset code generation large model. Determine the configuration definition file corresponding to the requirement information through the preset prompt engineering and the target token using the code generation large model.

[0058] Optionally, the format processing module 13 is specifically used for: Perform format verification on the configuration definition file and determine whether the configuration format of the database fields in the configuration definition file is correct. When the format verification of the configuration definition file fails or the configuration format is incorrect, perform regular matching on the configuration definition file, extract the key fields and the corresponding value values in the configuration definition file and perform verification to obtain the verified result. Based on the configuration definition file, determine the missing key fields in the verified result and fill the default values for the missing key fields to obtain the processed file.

[0059] Optionally, the logic determination module 14 is specifically used for: Create a target Base table in the database, and the fields in the target Base table have consistent front-end and back-end logics in any business scenario. Based on the processed file, select the first fields corresponding to a single business function in the software to be generated from the target Base table, and summarize each first field to obtain the user behavior object table, where the first fields are fields related to user behavior objects. Based on the processed file, select the second fields corresponding to a single business function in the software to be generated from the target Base table, and summarize each second field to obtain the user table, where the second fields are fields related to users. Based on the processed file, select the third fields corresponding to a single business function in the software to be generated from the target Base table, and summarize each third field to obtain the user behavior table, where the third fields are fields related to user behavior. Based on the user behavior object table, user table, and user behavior table corresponding to a single business function, describe the business logic of the business function corresponding to the software to be generated, and obtain the corresponding business process logic.

[0060] Optionally, the logic determination module 14 is specifically configured to: For a single business function, based on the user behavior object table and the user table, determine the business logic behavior nodes corresponding to a single user behavior in the user behavior table. The business logic behavior nodes include the upstream node, current node, and downstream node of a single user behavior. The upstream node represents the state of the single user behavior at the previous moment, the current node represents the current state of the single user behavior, and the downstream node represents the state of the single user behavior at the next moment; Assemble each business logic behavior node to obtain the business process logic of the business function corresponding to the software to be generated.

[0061] Optionally, the model determination module 16 is specifically configured to: Determine a preset third-party large model as the teacher model, and train the teacher model through preset open-source code snippets to obtain a converged teacher model. The converged teacher model has the ability to identify code correctness and modify code; Determine the pre-trained large model as the student model, and guide the student model to perform fine-tuning training through the converged teacher model to obtain a fine-tuned large model; If the performance index data of the fine-tuned large model on the validation set is better than the performance index data of the converged teacher model on the validation set, then switch the fine-tuned large model to the self-learning stage for training to obtain a code generation large model.

[0062] It should be noted that when the device for generating software based on the large model technology provided in the above embodiment executes the method for generating software based on the large model technology, only the above-mentioned division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating software based on the large model technology provided in the above embodiment and the method embodiment for generating software based on the large model technology belong to the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.

[0063] The embodiment of the present application also discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method for generating software based on the large model technology in the above embodiment is adopted.

[0064] Among them, the computer program can be stored in a computer-readable medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some middleware form, etc. The computer-readable medium includes any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above components.

[0065] Among them, through this computer-readable storage medium, the method for generating software based on the large model technology in the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above method.

[0066] The embodiment of the present application also discloses an electronic device. When the computer program stored in the computer-readable storage medium is loaded and executed by the processor, the above method for generating software based on the large model technology is adopted.

[0067] Among them, the electronic device can be a desktop computer, a laptop computer, or a cloud server, etc. And the electronic device includes but is not limited to a processor and a memory. For example, the electronic device can also include input / output devices, network access devices, and a bus, etc.

[0068] Among them, the processor can adopt a central processing unit (CPU). Of course, according to the actual usage situation, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc. The present application does not make any restrictions on this.

[0069] Among them, the memory can be an internal storage unit of the electronic device. For example, the hard disk or memory of the electronic device, or it can also be an external storage device of the electronic device. For example, the plug-in hard disk, smart media card (SMC), secure digital card (SD), or flash card (FC) equipped on the electronic device, etc. And the memory can also be a combination of the internal storage unit and the external storage device of the electronic device. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store the data that has been output or will be output. The present application does not make any restrictions on this.

[0070] Among them, through this electronic device, the method for generating software based on the large model technology in the above embodiment is stored in the memory of the electronic device and is loaded and executed on the processor of the electronic device for convenient use.

[0071] The foregoing are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. This application aims to cover any variations, uses or adaptations of the present disclosure, and these variations, uses or adaptations follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The description and embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A method for generating software based on large model technology, characterized in that: The method comprises: Obtain the demand information generated by users for software; Generate a configuration definition file corresponding to the requirement information through a preset code generation big model, wherein the configuration definition file is a configuration file of a domain specific language definer, and the code generation big model is a big model capable of generating corresponding software code according to the user's requirement information; Reformatting the configuration definition file into a regular format to obtain a processed file; Based on the processed file, determine the business flow logic corresponding to the business function in the software to be generated, and based on the business flow logic, generate the target software code corresponding to the software to be generated through the code generation model, wherein the format of the target software code is the configuration file format of the domain specific language definer; Based on the target software code, a front-end page and a back-end page of the software to be generated are generated through a preset rendering engine.

2. The method for generating software based on large model technology according to claim 1, characterized in that: Before obtaining the requirement information generated by the user for the software, the method further includes: Introducing a latent key-value cache into the multi-head self-attention mechanism of the Transformer model, and storing expert gating in the latent key-value cache to obtain an initial large model; Input the preset code data sample into the initial large model, and perform attention QKV calculation to obtain the KV intermediate result; The KV intermediate result is stored in the Latent key-value cache, and a mapping relationship between the KV intermediate result and a preset expert module is established through the expert gating; Inputting a preset Token sample into the initial large model for pre-training, adding an expert dimension to the hidden layer output corresponding to the Token sample based on the mapping relationship, and repeatedly executing the step of inputting the preset Token sample into the initial large model for pre-training until the model converges to obtain a pre-trained large model; The pre-trained large model is fine-tuned to obtain a code generation large model.

3. The method for generating software based on large model technology according to claim 1, characterized in that: The step of generating a configuration definition file corresponding to the requirement information by using a preset code generation model specifically includes: Determining whether the demand information is a text demand; If not, the requirement information is converted into a target token corresponding to the text requirement through the Qformer multimodal compatible network structure introduced in the preset code generation model; Through the preset prompt project and the target token, the configuration definition file corresponding to the requirement information is determined through the code generation model.

4. The method for generating software based on large model technology according to claim 1, characterized in that: The step of reformatting the configuration definition file in a regular format to obtain a processed file specifically includes: Performing format verification on the configuration definition file and determining whether the configuration format of the database field in the configuration definition file is correct; When the configuration definition file format verification fails or the configuration format is incorrect, regular matching is performed on the configuration definition file, and the key field and the corresponding value in the configuration definition file are extracted and verified to obtain a verified result; Based on the configuration definition file, the missing key fields in the verified result are determined, and default values ​​are filled for the missing key fields to obtain a processed file.

5. The method for generating software based on large model technology according to claim 1, characterized in that: Determining the business flow logic corresponding to the business function in the software to be generated based on the processed file specifically includes: Establish a target Base table in the database, where the fields in the target Base table are logically consistent between the front-end and back-end in any business scenario; Based on the processed file, selecting the first field corresponding to a single business function in the software to be generated from the target Base table, and aggregating the first fields to obtain a user behavior object table, where the first field is a field related to the user behavior object; Based on the processed file, a second field corresponding to a single business function in the software to be generated is selected from the target Base table, and each of the second fields is aggregated to obtain a user table, where the second field is a user-related field; Based on the processed file, a third field corresponding to a single business function in the software to be generated is selected from the target Base table, and each of the third fields is aggregated to obtain a user behavior table, where the third field is a field related to user behavior; Based on the user behavior object table, user table and user behavior table corresponding to a single business function, the business logic of the corresponding business function in the software to be generated is described to obtain the corresponding business flow logic.

6. The method for generating software based on large model technology according to claim 5, characterized in that: Based on the user behavior object table, user table and user behavior table corresponding to a single business function, the business logic of the corresponding business function in the software to be generated is described to obtain the corresponding business flow logic, specifically including: For a single business function, based on the user behavior object table and the user table, determine the business logic behavior node corresponding to the single user behavior in the user behavior table, the business logic behavior node includes an upstream node, a current node and a downstream node of the single user behavior, the upstream node represents the state of the single user behavior at the previous moment, the current node represents the current state of the single user behavior, and the downstream node represents the state of the single user behavior at the next moment; Assemble the business logic behavior nodes to obtain the business flow logic of the corresponding business function in the software to be generated.

7. The method for generating software based on large model technology according to claim 2, characterized in that: The fine-tuning of the pre-trained large model to obtain a code generation large model specifically includes: Determine a preset third-party large model as a teacher model, and train the teacher model through a preset open source code snippet to obtain a converged teacher model, wherein the converged teacher model has the ability to identify code correctness and modify code; Determine the pre-trained large model as the student model, guide the student model to perform fine-tuning training through the converged teacher model, and obtain the fine-tuned large model; If the performance index data of the large model after fine-tuning training on the verification set is better than the performance index data of the converged teacher model on the verification set, the large model after fine-tuning training is switched to the self-learning stage for training to obtain a code generation large model.

8. A device for generating software based on large model technology, characterized in that: include: An information acquisition module (11) is used to acquire the demand information generated by the user for the software; A file configuration module (12) is used to generate a configuration definition file corresponding to the requirement information through a preset code generation model, wherein the configuration definition file is a configuration file of a domain specific language definer, and the code generation model is a model capable of generating corresponding software code according to the user's requirement information; A format processing module (13) is used to reformat the configuration definition file into a regular format to obtain a processed file; A logic determination module (14) is used to determine the business flow logic corresponding to the business function in the software to be generated based on the processed file, and based on the business flow logic, generate the target software code corresponding to the software to be generated through the code generation model, wherein the format of the target software code is the configuration file format of the domain specific language definer; A code rendering module (15) is used to generate the front-end page and the back-end page of the software to be generated based on the target software code through a preset rendering engine.

9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 7 is adopted.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 7 is adopted.

Citation Information

Patent Citations

  • Enterprise management software development method and device, equipment and medium

    CN117891447A

  • Conversational software function generation method and system based on large language model

    CN118276826A

  • Software product development method and device, electronic equipment and nonvolatile storage medium

    CN118916451A

Cited By

  • End-to-end intelligent system development method and system based on AI large model

    CN120950041A

  • An end-to-end intelligent system development method and system based on an AI large model

    CN120950041B

  • Cross-platform application construction system and method

    CN121187613A

  • A system and method for building cross-platform applications

    CN121187613B

  • Method and system for converting low-code deployment configuration into Kubernetes standard resource file

    CN121326333A