Application construction method and system, medium and electronic equipment
The application construction method using a trained large model and interactive tools lowers the technical barrier for complex software development, enabling efficient and accurate application construction through natural language input.
Patent Information
- Application Number
- CN202411061119.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-13
AI Technical Summary
Existing low-code platforms require users to have industry knowledge and design experience, posing a high technical threshold for complex application software development, and are inefficient for ordinary developers.
An application construction method utilizing a trained preset large model to parse natural language business requests, generate business data, and construct applications through a graphical user interface, incorporating a base layer with natural language processing, an instruction layer for prompt engineering, and a business layer for application building, supported by a knowledge base and interactive tools.
Reduces the technical threshold and improves efficiency and convenience of application construction by allowing users to input business requests in natural language, enhancing interaction and accuracy through prompt projects, and reducing the cost of using large models.
Smart Images

Figure CN119127150A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of low-code development technology, and specifically, to an application construction method, system, medium and electronic device. Background Art
[0002] The traditional application construction process is a collection of application engineering activities required to transform user requirements into applications, including requirements analysis, specifications, detailed design, coding development, testing and verification, installation and deployment, monitoring and maintenance, and documentation. It may also include short-term and long-term repairs and upgrades to continuously meet user needs. Once the requirements change, the complete software process must be executed to deliver. Building applications through a low-code platform can alleviate the problems of low development efficiency, high technical barriers, and difficulty in maintenance and updating in the traditional application construction method.
[0003] A low-code platform is a tool for rapid application development. It reduces the need to write code. It allows users to quickly build various types of applications through a software development platform without coding or with little coding. It allows end users to develop their own applications using easy-to-understand visual tools. After completing the business logic and function construction, the application can be delivered with one click.
[0004] However, for complex application software development, users are still required to have certain industry background knowledge, design experience and skill levels. Moreover, as the complexity of application software increases, the application logic design and the writing of "a small amount of program code" are beyond the capabilities of ordinary developers. For users who are not in this technical field, using low-code platforms may encounter a high learning threshold. Therefore, how to lower the technical threshold for application construction and improve the efficiency and convenience of application construction has become a topic worth studying.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide an application construction method, an application construction system, a computer-readable storage medium and an electronic device, which can to a certain extent solve the problems of complexity and high technical threshold of application construction in related technologies.
[0007] According to a first aspect of an embodiment of the present disclosure, there is provided an application construction method, the method comprising:
[0008] Obtaining an input business request and determining a business operation matching the business request;
[0009] Generate business data corresponding to the business operation based on the prompt engineering of the trained preset large model;
[0010] Building an application corresponding to the business request according to the business data, and displaying the application in the current graphical user interface;
[0011] Wherein, the business request at least includes an application generation request, a page generation request, a component generation request, a script generation request and a general question and answer request, and the business request is a natural language statement, and the business operation includes a first business operation and a second business operation;
[0012] The determining of the service operation matching the service request includes:
[0013] Parsing the natural language sentence to obtain business keywords;
[0014] If the first business operation matching the business keyword is determined by a preset matching rule, executing the first business operation;
[0015] If the first business operation matching the business keyword cannot be determined through the preset matching rule, the preset large model is called to identify the second business operation matching the business keyword using the preset large model.
[0016] In an exemplary embodiment of the present disclosure, the prompting project based on the trained preset large model generates business data corresponding to the business operation, including:
[0017] Retrieving configuration data related to the business operation from a preset knowledge base;
[0018] Calling an instruction template corresponding to the business operation;
[0019] Based on the instruction template, the business data is determined from the configuration data using the prompting engineering of the preset large model.
[0020] In an exemplary embodiment of the present disclosure, determining the business data from the configuration data based on the instruction template and using the prompting engineering of the preset large model includes:
[0021] Add the instruction template of the business request of the application to the prompt project built by the application;
[0022] Based on the prompting project, the business data is determined from the configuration data using the preset large model.
[0023] In an exemplary embodiment of the present disclosure, retrieving configuration data related to the business operation from a preset knowledge base includes:
[0024] Vectorizing and storing the application configuration information in the preset knowledge base to obtain a vector database;
[0025] Feature extraction is performed on the business operation to obtain a query vector, and similarity between the query vector and all vectors in the vector database is calculated to determine configuration data with a similarity higher than a preset similarity threshold.
[0026] In an exemplary embodiment of the present disclosure, constructing an application corresponding to the business request according to the business data, and displaying the application in the current graphical user interface includes:
[0027] Merging the instruction template corresponding to the business operation with the business data to obtain target data;
[0028] generating an application building confirmation control in the current graphical user interface according to the target data;
[0029] When a trigger operation acting on the application building confirmation control is received, an application building action is executed, and the application is displayed in the current graphical user interface.
[0030] According to a second aspect of an embodiment of the present disclosure, there is provided an application construction system, including:
[0031] The base layer includes the trained preset large models;
[0032] The instruction layer is used to determine the business operation matching the input business request, and generate business data corresponding to the business operation based on the prompt engineering of the trained preset large model;
[0033] A business layer, used to construct an application corresponding to the business request according to the business data;
[0034] The application layer is used to obtain the inputted service request and display the application corresponding to the service request in the current graphical user interface;
[0035] Wherein, the business request at least includes an application generation request, a page generation request, a component generation request, a script generation request and a general question and answer request, and the business request is a natural language statement, and the business operation includes a first business operation and a second business operation;
[0036] The determining of the business operation matching the input business request includes:
[0037] Parsing the natural language sentence to obtain business keywords;
[0038] If the first business operation matching the business keyword is determined by a preset matching rule, executing the first business operation;
[0039] If the first business operation matching the business keyword cannot be determined through the preset matching rule, the preset large model is called to identify the second business operation matching the business keyword using the preset large model.
[0040] In an exemplary embodiment of the present disclosure, the preset large model prompting project includes:
[0041] A task chain is used to decompose the input business request into multiple subtasks and construct a task chain according to the dependency relationship between the subtasks;
[0042] A prompt chain, used to retrieve configuration data related to the business operation corresponding to each of the subtasks from a preset knowledge base, and call an instruction template corresponding to the business operation;
[0043] The thinking chain is used to determine the business data from the configuration data based on the instruction template and using the preset large model.
[0044] In an exemplary embodiment of the present disclosure, the prompt chain includes:
[0045] A configuration data determination module is used to vectorize the application configuration information in the preset knowledge base and store it to obtain a vector database; extract features of the business operations corresponding to each subtask to obtain a query vector, and calculate the similarity between the query vector and all vectors in the vector database to determine the configuration data whose similarity is higher than a preset similarity threshold.
[0046] According to a third aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processing unit, the application construction method described in any one of the above items is implemented.
[0047] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a processing unit; and a storage unit for storing executable instructions of the processing unit; wherein the processing unit is configured to execute any one of the above-described application construction methods by executing the executable instructions.
[0048] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0049] In the application construction method provided in the example implementation mode of the present disclosure, an input business request is obtained and a business operation matching the business request is determined; business data corresponding to the business operation is generated based on a prompt project of a trained preset large model; an application corresponding to the business request is constructed according to the business data, and the application is displayed in the current graphical user interface. On the one hand, compared with the traditional application construction method, the present disclosure only needs to input a business request in the form of a natural language statement to complete the construction of the application, which not only reduces the technical threshold for application construction, but also improves the efficiency and convenience of application construction; on the other hand, the present disclosure improves the interactive effect and accuracy of the application construction process through the prompt project of the preset large model, and reduces the cost of using the preset large model.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings herein are incorporated into and constitute a part of the disclosure, illustrate embodiments consistent with the disclosure, and are used together with the disclosure to explain the principles of the disclosure. Obviously, the drawings described below are only some embodiments of the disclosure, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic diagram of an application construction system in an embodiment of the present disclosure is shown.
[0053] Figure 2 A flow chart of an application construction method in an embodiment of the present disclosure is shown.
[0054] Figure 3 A schematic diagram of a process for determining a business operation in an embodiment of the present disclosure is shown.
[0055] Figure 4 A flowchart of another application construction method in an embodiment of the present disclosure is shown.
[0056] Figure 5 A schematic diagram of an application construction device in an embodiment of the present disclosure is shown.
[0057] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0058] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0059] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0060] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0061] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0062] Next, the embodiments of the present disclosure are described in detail.
[0063] Figure 1 A schematic diagram of an application construction system in an embodiment of the present disclosure is shown.
[0064] like Figure 1As shown, the application construction system 100 may include a base layer 101 , an instruction layer 102 , a business layer 103 and an application layer 104 .
[0065] Among them, the base layer 101 includes a trained preset large model, such as a commercial large model trained based on the deep learning architecture of the Transformer network. The base layer 101 can realize functions such as natural language processing, speech recognition and speech synthesis, data analysis and prediction. The instruction layer 102 is used to determine the business operation that matches the input business request, and generate business data corresponding to the business operation based on the prompt engineering of the trained preset large model. The business layer 103 is used to build an application corresponding to the business request based on the business data. The business request may include an application generation request, a page generation request, a component generation request, a script generation request, and a general question and answer request, etc. The application layer 104 is used to obtain the input business request and display the application corresponding to the business request in the current graphical user interface.
[0066] The application construction system 100 may further include a preset knowledge base 105 and a user 106. The preset knowledge base 105 is in communication with the business layer 103 and may provide configuration data for the business layer 103. The user 106 may construct an application through the application layer 104. After the application layer 104 completes the construction of the application in collaboration with the base layer 101, the instruction layer 102 and the business layer 103, the constructed application may be displayed on the application layer 104 for the user 106 to view and modify.
[0067] The instruction layer 102 can realize the encapsulation of interactive instructions and the interaction with the preset big model, including parsing the input of the user 106, converting it into a format that the preset big model can understand, and generating a response that the user 106 can understand according to the output of the preset big model. In addition, the instruction layer 102 also supports switching between different big model APIs (Application Programming Interfaces), providing different options for the user 106, and improving the flexibility of the user 106 in building scalable applications.
[0068] The instruction layer 102 is mainly implemented through the Python language and the LangChain framework. Python is easy to read and has extensive library support, which is suitable for processing complex text data and interacting with preset large models. The LangChain framework provides a set of tools and interfaces for building and managing interactions with preset large models, enhancing the functionality and flexibility of the instruction layer 102. The instruction layer 102 not only provides users with an interface for interacting with the preset large model, but also greatly improves the intelligence of the entire application. Through precise instruction processing and flexible model switching, the instruction layer 102 can meet the personalized needs of different users and enhance the user experience.
[0069] The instruction layer 102 can interact with the preset large model through the prompt project 1021 of the preset large model. The prompt project 1021 includes a task chain 10211, a prompt chain 10212 and a thinking chain 10213. Among them, the task chain 10211 is used to decompose the input business request into multiple subtasks and build a task chain according to the dependency relationship between the subtasks. The prompt chain 10212 is used to retrieve the configuration data related to the business operation corresponding to each subtask from the preset knowledge base and call the instruction template corresponding to the business operation. The thinking chain 10213 is used to determine the business data from the configuration data based on the instruction template and the preset large model.
[0070] Exemplarily, in the configuration data determination module in the prompt chain 10212, the application configuration information in the preset knowledge base can be vectorized and stored to obtain a vector database, the business operations corresponding to each subtask can be feature extracted to obtain a query vector, and the similarity between the query vector and all vectors in the vector database can be calculated to determine the configuration data whose similarity is higher than a preset similarity threshold.
[0071] The business layer 103 can call the instruction layer 102 to obtain the return value of the preset large model to process queries that require advanced analysis, prediction, or reasoning. For example, when the user 106 requests to generate a table component, the business layer 103 processes the request and retrieves the corresponding answer from the preset knowledge base 105, and calls the instruction layer 102 to generate sample data through the preset large model, and then returns the integrated result to the user 106.
[0072] The business layer 103 is mainly implemented using the Python programming language. In addition, the business layer 103 also uses FastAPI technology. FastAPI is a modern, fast (high-performance) network framework for building APIs, which can provide simple declarative data model definitions and automatic generation of API documents, allowing developers to easily provide interfaces for the application side.
[0073] The application layer 104 may include a visual development module, a data model design module, an integrated connection module, an automated testing module, and a deployment module, etc., and has the functions of a complete traditional low-code platform. User 106 can manually configure various functions of the application through an intuitive graphical interface in the visual development module without writing complex code. For example, user 106 can customize a data dashboard and select the displayed data type, format, and layout through simple interface operations, thereby quickly creating an application that meets business needs.
[0074] Among them, the visual development module is used to build the user interface and business logic of the application through the operation and configuration of the visual interface. The data model design module is used to define and manage the data model, create database tables and perform data operations, including insertion, update, query, etc., so that users can easily manage the data of the application; the integration connection module is used to integrate and connect with other systems and services such as databases, third-party APIs (Application Programming Interfaces), cloud services, etc., to facilitate data exchange and function expansion; the automated testing module is used to test and verify the application; the deployment module is used to deploy the application to different environments, such as test environments, production environments, etc.
[0075] The application layer 104 uses technologies such as Vue.js, TypeScript, Vite, and Nginx. Vue.js is a progressive JavaScript framework that provides declarative rendering and component systems, greatly simplifying the development interface. The introduction of TypeScript brings a strong type system and compile-time error checking to the system, enhancing the maintainability and stability of the code. Vite is a modern development and construction tool that provides extremely fast module hot updates and targeted build optimizations. As a server, Nginx provides efficient content distribution and reverse proxy functions, ensuring high performance and stable operation of the application.
[0076] The application layer 104 provides developers with great flexibility through rich application components and interaction and data transmission functions between components or between different pages. For example, developers can design an interactive form component and connect it to the data display component by dragging and page configuration to achieve real-time data update and display. Application construction through the application layer 104 not only improves the efficiency of application construction, but also makes the constructed application more user-friendly and can quickly adapt to market changes and user needs.
[0077] The preset knowledge base 105 may use a PostgreSQL database combined with pgvector technology. PostgreSQL is a powerful open source relational database suitable for processing complex queries and large amounts of data. pgvector is a technology for storing and retrieving vector data in PostgreSQL, which is conducive to performing operations such as text similarity analysis.
[0078] This exemplary embodiment provides an application construction method. Figure 2 As shown, the application construction method may include the following steps S210 to S230:
[0079] Step S210. Obtain an input service request and determine a service operation matching the service request;
[0080] Step S220. Generate business data corresponding to the business operation based on the reminder project of the trained preset large model;
[0081] Step S230. construct an application corresponding to the business request according to the business data, and display the application in the current graphical user interface;
[0082] The business request at least includes an application generation request, a page generation request, a component generation request, a script generation request and a general question and answer request.
[0083] Executing the application construction method in the example implementation of the present disclosure, on the one hand, compared with the traditional application construction method, the present disclosure only needs to input the business request in the form of natural language statements to complete the application construction, which not only lowers the technical threshold for application construction, but also improves the efficiency and convenience of application construction; on the other hand, the present disclosure improves the interaction effect in the application construction process and the accuracy of application construction through the prompt project of the preset large model, thereby reducing the cost of using the preset large model.
[0084] Next, the above steps of this exemplary embodiment are described in more detail.
[0085] In step S210, an input service request is obtained, and a service operation matching the service request is determined.
[0086] Among them, the business request refers to the needs put forward by the user during the application construction process, for example, it can include application generation request, page generation request, component generation request, script generation request and general question and answer request, and can also include improvement requests for the functions, processes, interfaces, data models, etc. of the application program, etc. In the example implementation of the present disclosure, the business request can be a natural language sentence.
[0087] Among them, the application generation request is used to obtain the data required to generate the application from the preset knowledge base and perform the operation of generating the application, the page generation request is used to obtain the data required to generate the page from the preset knowledge base and perform the operation of generating the page, the component generation request is used to obtain the data required to generate the component from the preset knowledge base and perform the operation of generating the component, the script generation request is used to obtain the data required to generate the script from the preset knowledge base and perform the operation of generating the script, and the general question and answer request is used to obtain the data required to answer the question from the preset knowledge base and generate the answer result through the preset large model.
[0088] Business operations refer to specific business activities or tasks performed during the application construction process. They can be application generation operations, page generation operations, component generation operations, script generation operations, general question and answer operations, etc. corresponding to business requests, or they can be the definition and management of data models, including creation, reading, update, and deletion operations.
[0089] For example, if the business operation is a component generation operation, when the user requests to generate a table component, the business layer will process the request and retrieve the corresponding data from the preset knowledge base, and at the same time call the instruction layer to generate sample data through the preset large model, and then return the integrated result to the user; for another example, if the business operation is a script generation operation, the business layer will retrieve the corresponding data in the preset knowledge base according to the script generation request, and call the instruction layer to generate script sample data through the preset large model identification, and finally return the integrated script result to the user; for another example, when the business operation is a general question and answer operation, the business layer will combine the preset knowledge base and call the instruction layer to generate the corresponding answer result through the preset large model.
[0090] In one example implementation, reference is made to Figure 3 As shown, the service operation matching the service request may be determined according to steps S310 to S330.
[0091] Step S310: Parse the natural language sentence to obtain business keywords.
[0092] For example, a user can input a natural language sentence in the visual development module provided by the application layer by voice input or text input. After obtaining the natural language sentence, the natural language processing technology can be used to parse the natural language sentence to obtain business keywords.
[0093] Specifically, first, natural language sentences can be segmented through a word segmentation method based on statistics or deep learning. Next, stop words in the natural language sentences can be removed according to a preset stop word list. Then, each word after segmentation is tagged with a part of speech, and each word is marked as a noun, verb, adjective, etc. Then, keywords in natural language sentences can be extracted through frequency-based statistical methods, graph algorithm-based methods, deep learning-based methods, etc. Finally, the keywords can be further screened and sorted according to their length, part of speech, frequency, etc. to determine business keywords.
[0094] Step S320: If the first business operation matching the business keyword is determined through a preset matching rule, the first business operation is executed.
[0095] The first business operation refers to an operation that can be directly processed through rule routing, such as simple instructions such as clearing and deleting with relatively simple and fixed steps.
[0096] Specifically, when determining the first business operation that matches the business keyword, the business keyword and multiple first business operations can first be subjected to text preprocessing, including word segmentation, stop word removal, stemming and other operations. Next, the business keyword and multiple first business operations can be subjected to similarity calculations one by one through keyword matching algorithms such as word vector algorithms, TF-IDF (term frequency–inverse document frequency) algorithms or cosine similarity algorithms, so as to determine the first business operation that matches the business keyword according to preset matching rules.
[0097] It is understandable that in the process of determining the first business operation of the business keyword match, the matching result can be determined by similarity, and the corresponding matching rule can be a specific threshold set according to the user's matching requirements. Taking the cosine similarity algorithm as an example, the matching result can be determined by cosine similarity, and when the cosine similarity exceeds the set threshold, it can be considered that the match is successful.
[0098] After determining the first business operation that matches the business keyword, the first business operation may be executed.
[0099] Step S330: If the first business operation matching the business keyword cannot be determined through the preset matching rule, the preset big model is called to identify the second business operation matching the business keyword using the preset big model.
[0100] The second business operation refers to the operation that needs to be identified and processed by the preset large model of the base layer. The preset large model can be a commercial large model trained based on the deep learning architecture of the Transformer network, or it can be an SVM (Support Vector Machine) model, an NBM (Naive Bayes model) model, or an RNN.
[0101] (recursive neural network, recurrent neural network) and other deep learning models.
[0102] If the first business operation matching the business keyword cannot be determined through the preset matching rule, the user intent contained in the natural language sentence is determined through the preset large model to determine the second business operation matching the business keyword according to the user intent.
[0103] Specifically, a command list may be preset according to actual needs, and the command list may include scene generation, page generation, script generation, component generation, etc. After the command parser identifies the user intent contained in the natural language sentence, it may match the corresponding command from the command list to determine the second business operation.
[0104] For example, if the natural language sentence obtained is "I want to generate a scene" or "Generate a State Power Investment Corporation scene", the recognized user intent is "Generate a scene", which can be matched to the corresponding command "Scene generation", and the corresponding second business operation is the scene generation operation. If the natural language sentence obtained is "Generate a page layout" or "Generate an e-commerce large screen", the recognized user intent is "Generate a page", which can be matched to the corresponding command "Page generation", and the corresponding second business operation is the page generation operation. If the natural language sentence obtained is "Multiply the value by 100 and take the square root", the command "Numerical component script generation" can be matched through the recognized user intent, and the corresponding second business operation is the script generation operation. If the natural language sentence obtained is "What are the main operating indicators of the photovoltaic station?", there is no matching command in the command list, and the command "No matching command" is output.
[0105] When determining the second business operation that matches the business keyword according to the user intent, the second business operation can be matched according to the user intent through matching methods such as rule matching, bag of words model, word vector matching, and deep learning model.
[0106] Taking the bag of words model as an example, first, the training data set of the original intent and the original second business operation for the later model training can be prepared. Each sample should contain two natural language texts corresponding to the original intent and the original second business operation, as well as labels indicating whether they match. The original intent and the original second business operation are preprocessed by removing punctuation, converting to lowercase letters, and segmenting. Based on the preprocessed text data of the original intent and the original second business operation, an intent vocabulary and a classification vocabulary are respectively constructed. The intent vocabulary and the classification vocabulary contain all the words that appear in the original intent and the original second business operation respectively. Next, the original intent and the original second business operation can be converted into an intent feature vector and a classification feature vector respectively through the bag of words model. Specifically, the number of occurrences of each word in the intent vocabulary and the classification vocabulary corresponding to the original intent and the original second business operation is counted respectively, or the TF-IDF algorithm is used to measure the importance of each word, and each word is used as a feature dimension to form an intent feature vector and a classification feature vector. Next, a training model such as naive Bayes or random forest is trained through the data pairs of the original intent and the original second business operation and the labels indicating whether they match.
[0107] After obtaining the training model, the user intention and each second business operation can be input into the training model respectively to obtain the matching result of the user intention and each second business operation through the training model, thereby determining the second business operation with the highest matching degree with the user intention.
[0108] In this example, the corresponding business operation can be determined according to the natural language sentence input by the user, so that the user can provide business requests in a more convenient way, which reduces the technical threshold for application construction and improves the convenience of application construction.
[0109] In step S220, the prompting project based on the trained preset large model generates business data corresponding to the business operation.
[0110] Prompt engineering is a technical means to improve the efficiency, performance and generalization ability of the preset large model during the training and use of the preset large model. Business data refers to the specific data required when performing business operations. For example, if the business operation is a component generation operation, the corresponding business data is the component data required in the process of generating components.
[0111] First, the configuration data related to the business operation can be retrieved from the preset knowledge base. Exemplarily, the application configuration information in the preset knowledge base can be vectorized and stored to obtain a vector database, and then the business operation is feature extracted to obtain a query vector, and the similarity between the query vector and all vectors in the vector database is calculated to determine the configuration data with a similarity higher than a preset similarity threshold. Among them, the configuration data refers to a plurality of matching data retrieved from the preset knowledge base that has the highest matching degree with the business operation. Taking the business operation as a component generation operation as an example, the corresponding configuration data can be three, five or other numbers of component configuration data with the highest matching degree with the component generation operation.
[0112] Specifically, first, the features of each application configuration information in the preset knowledge base are extracted through feature extraction methods such as CNN (Convolutional Neural Networks) and bag-of-words model, and then each application configuration information is represented as a vector using vectorization methods such as one-hot encoding and word embedding. The vectorized application configuration information is stored in the preset knowledge base to obtain a vector database.
[0113] Then, the business operation is feature extracted by inverse document frequency, one-hot encoding and other methods to obtain the query vector corresponding to the business operation. The similarity between the query vector and all vectors in the vector database is calculated by similarity calculation methods such as cosine similarity, Euclidean distance or Pearson correlation coefficient.
[0114] Taking the Euclidean distance as an example, after calculating the similarities between the query vector and all vectors in the vector database according to the Euclidean distance, the values corresponding to the similarities can be arranged from small to large. The smaller the value corresponding to the similarity, the higher the similarity between the query vector and the vector corresponding to the similarity. The corresponding preset similarity threshold can be a specific value set according to actual needs.
[0115] Next, the instruction template corresponding to the business operation can be called, and based on the instruction template, the business data can be determined from the configuration data using the preset large model prompt project. Specifically, the instruction template of the application business request can be added to the prompt project of the application construction, and based on the prompt project, the business data can be determined from the configuration data using the preset large model.
[0116] For example, if the business operation is "component generation", you can first query the configuration data corresponding to "component generation" in the preset knowledge base, then call the instruction template corresponding to "component generation" through the preset large model, and determine the business data required in the process of generating components from the configuration data according to the instruction template corresponding to "component generation".
[0117] In this example, by combining the preset large model prompt project with the preset knowledge base business data, not only the efficiency of obtaining business data can be improved, but also the accuracy of business data can be improved, thereby improving the efficiency and accuracy of subsequent application creation.
[0118] In step S230, an application corresponding to the business request is constructed according to the business data, and the application is displayed in the current graphical user interface.
[0119] Specifically, the instruction template corresponding to the business operation and the business data can be merged to obtain the target data, and then the application construction confirmation control is generated in the current graphical user interface according to the target data. When the trigger operation acting on the application construction confirmation control is received, the application construction action is executed and the application is displayed in the current graphical user interface. Among them, the instruction template can include static text, variables, conditional logic, etc., and different business operations correspond to different instruction templates.
[0120] For example, the instruction template and business data can be integrated through template engines, string concatenation, regular expressions, etc. to obtain target data.
[0121] Taking the template engine as an example, the instruction template can be parsed first to identify the fixed text content and specific placeholders or instruction syntax in the instruction template, so as to identify the business data that needs to be replaced or executed based on these placeholders or instruction syntax, and then execute the corresponding instruction operations according to the loop statements, conditional statements, function calls and other instruction syntaxes in the instruction template. After the execution is completed, the business data is replaced with the placeholders in the instruction template, thereby completing the fusion of the instruction template and the business data.
[0122] Optionally, after the corresponding application is built according to the business request, a prompt box and controls can be displayed in the graphical user interface to prompt the user to choose whether to create a new application or whether to manually change and edit the application, and execute corresponding instructions according to the triggering operation.
[0123] Optionally, when the application is displayed in the current graphical user interface, the current business request and business operation may also be displayed in the graphical user interface.
[0124] In this example, the constructed application is displayed in the current graphical user interface, so that the user can intuitively check the application, and the user can modify and adjust it according to the needs, thereby improving the accuracy of application construction.
[0125] refer to Figure 4 As shown, another application construction method is also provided in the exemplary embodiment of the present disclosure, and the method may include the following steps S401 to S409:
[0126] Step S401. Obtaining a business request;
[0127] Step S402. Execute the first business operation: obtain the business keyword in the business request, and if the first business operation matching the business keyword is determined by the preset matching rule, execute the first business operation, otherwise execute step S403;
[0128] Step S403. Determine the second business operation: use the preset large model to identify the second business operation that matches the business keyword;
[0129] Step S404. Determine configuration data: retrieve configuration data related to business operations from a preset knowledge base;
[0130] Step S405. Determine the instruction template: call the instruction template corresponding to the business operation;
[0131] Step S406. Determine business data: Based on the instruction template, determine business data from the configuration data using the preset large model prompt project;
[0132] Step S407. Generate target data: merge the instruction template corresponding to the business operation with the business data to obtain the target data;
[0133] Step S408. Build application: build application according to target data;
[0134] Step S409. Display application: display the application in the current graphical user interface.
[0135] In the application construction method provided in the example implementation mode of the present disclosure, an input business request is obtained and a business operation matching the business request is determined; business data corresponding to the business operation is generated based on a prompt project of a trained preset large model; an application corresponding to the business request is constructed according to the business data, and the application is displayed in the current graphical user interface. On the one hand, compared with the traditional application construction method, the present disclosure only needs to input a business request in the form of a natural language statement to complete the construction of the application, which not only reduces the technical threshold for application construction, but also improves the efficiency and convenience of application construction; on the other hand, the present disclosure improves the interactive effect and accuracy of the application construction process through the prompt project of the preset large model, and reduces the cost of using the preset large model.
[0136] In this example implementation, an application construction device is also provided. Figure 5 As shown, the application construction device 500 may include a business operation determination module 510, a business data generation module 520 and an application construction module 530, wherein:
[0137] The business operation determination module 510 is used to obtain an input business request and determine a business operation matching the business request;
[0138] A business data generation module 520, for generating business data corresponding to the business operation based on the reminder engineering of the trained preset large model;
[0139] An application construction module 530, configured to construct an application corresponding to the business request according to the business data, and display the application in the current graphical user interface;
[0140] The business request at least includes an application generation request, a page generation request, a component generation request, a script generation request, and a general question and answer request, and the business request is a natural language statement, and the business operation includes a first business operation and a second business operation; the business operation determination module 510 includes:
[0141] A business keyword determination module, used for parsing the natural language sentence to obtain business keywords;
[0142] a first business operation execution module, configured to execute the first business operation when the first business operation matching the business keyword is determined by a preset matching rule;
[0143] The second business operation determination module is used to call the preset big model and use the preset big model to identify the second business operation matching the business keyword when the first business operation matching the business keyword cannot be determined through the preset matching rule.
[0144] In an optional implementation, the business data generating module 520 includes:
[0145] A configuration data determination module, used to retrieve configuration data related to the business operation from a preset knowledge base;
[0146] An instruction template calling module, used to call the instruction template corresponding to the business operation;
[0147] A business data determination module is used to determine the business data from the configuration data based on the instruction template and using the prompting project of the preset large model.
[0148] In an optional implementation, the business data determination module includes:
[0149] A prompt project update submodule, used to add the instruction template of the business request of the application to the prompt project constructed by the application;
[0150] The business data determination submodule is used to determine the business data from the configuration data based on the prompt project using the preset large model.
[0151] In an optional implementation, the configuration data determination module includes:
[0152] A vector database determination submodule is used to vectorize the application configuration information in the preset knowledge base and store it to obtain a vector database;
[0153] The configuration data determination submodule is used to extract features from the business operation to obtain a query vector, calculate the similarity between the query vector and all vectors in the vector database, and determine configuration data whose similarity is higher than a preset similarity threshold.
[0154] In an optional implementation, the application construction module 530 includes:
[0155] A target data determination module, used to merge the instruction template corresponding to the business operation with the business data to obtain the target data;
[0156] A confirmation control generation module, used to generate an application construction confirmation control in the current graphical user interface according to the target data;
[0157] The application construction and display module is used to execute the application construction action and display the application in the current graphical user interface when receiving a trigger operation acting on the application construction confirmation control.
[0158] The specific details of each module in the above-mentioned application construction device have been described in detail in the corresponding application construction method, so they will not be repeated here.
[0159] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of this specification is stored. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary method" section of this specification. The program product may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, an apparatus or a device or used in combination with it.
[0160] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0161] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0162] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0163] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C#, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0164] The exemplary embodiment of the present disclosure also provides an electronic device capable of implementing the above method. Figure 6 The electronic device 600 according to this exemplary embodiment of the present disclosure is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0165] like Figure 6 As shown, the electronic device 600 may be in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), and a display unit 640.
[0166] The storage unit 620 stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can execute Figure 2 The storage unit 620 may be used to store business data and business operations, etc., which is not limited in the present disclosure.
[0167] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit (Cache) 622 , and may further include a read-only memory unit (ROM) 623 .
[0168] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0169] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0170] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0171] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary implementation of the present disclosure.
[0172] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiment of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0173] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0174] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the disclosure and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The disclosure and embodiments are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0175] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An application construction method, characterized in that: include: Obtaining an input business request and determining a business operation matching the business request; Generate business data corresponding to the business operation based on the prompt engineering of the trained preset large model; Building an application corresponding to the business request according to the business data, and displaying the application in the current graphical user interface; Wherein, the business request at least includes an application generation request, a page generation request, a component generation request, a script generation request and a general question and answer request, and the business request is a natural language statement, and the business operation includes a first business operation and a second business operation; The determining of the service operation matching the service request includes: Parsing the natural language sentence to obtain business keywords; If the first business operation matching the business keyword is determined by a preset matching rule, executing the first business operation; If the first business operation matching the business keyword cannot be determined through the preset matching rule, the preset large model is called to identify the second business operation matching the business keyword using the preset large model.
2. The application construction method according to claim 1, characterized in that: The prompting project based on the trained preset large model generates business data corresponding to the business operation, including: Retrieving configuration data related to the business operation from a preset knowledge base; Calling an instruction template corresponding to the business operation; Based on the instruction template, the business data is determined from the configuration data using the prompting engineering of the preset large model.
3. The application construction method according to claim 2, characterized in that: The determining the business data from the configuration data based on the instruction template and using the prompting engineering of the preset large model includes: Add the instruction template of the business request of the application to the prompt project built by the application; Based on the prompting project, the business data is determined from the configuration data using the preset large model.
4. The application construction method according to claim 2, characterized in that: The retrieving configuration data related to the business operation from a preset knowledge base includes: Vectorizing and storing the application configuration information in the preset knowledge base to obtain a vector database; Feature extraction is performed on the business operation to obtain a query vector, and similarity between the query vector and all vectors in the vector database is calculated to determine configuration data with a similarity higher than a preset similarity threshold.
5. The application construction method according to claim 2, characterized in that: Building an application corresponding to the business request according to the business data, and displaying the application in the current graphical user interface, including: Merging the instruction template corresponding to the business operation with the business data to obtain target data; generating an application building confirmation control in the current graphical user interface according to the target data; When a trigger operation acting on the application building confirmation control is received, an application building action is executed, and the application is displayed in the current graphical user interface.
6. An application construction system, characterized in that: include: The base layer includes the trained preset large models; The instruction layer is used to determine the business operation matching the input business request, and generate business data corresponding to the business operation based on the prompt engineering of the trained preset large model; A business layer, used to construct an application corresponding to the business request according to the business data; The application layer is used to obtain the inputted service request and display the application corresponding to the service request in the current graphical user interface; Wherein, the business request at least includes an application generation request, a page generation request, a component generation request, a script generation request and a general question and answer request, and the business request is a natural language statement, and the business operation includes a first business operation and a second business operation; The determining of the business operation matching the input business request includes: Parsing the natural language sentence to obtain business keywords; If the first business operation matching the business keyword is determined by a preset matching rule, executing the first business operation; If the first business operation matching the business keyword cannot be determined through the preset matching rule, the preset large model is called to identify the second business operation matching the business keyword using the preset large model.
7. The application construction system according to claim 6, characterized in that: The preset large model prompting project includes: A task chain is used to decompose the input business request into multiple subtasks and construct a task chain according to the dependency relationship between the subtasks; A prompt chain, used to retrieve configuration data related to the business operation corresponding to each of the subtasks from a preset knowledge base, and call an instruction template corresponding to the business operation; The thinking chain is used to determine the business data from the configuration data based on the instruction template and using the preset large model.
8. The application construction system according to claim 7, characterized in that: The prompt chain includes: A configuration data determination module is used to vectorize the application configuration information in the preset knowledge base and store it to obtain a vector database; extract features of the business operations corresponding to each subtask to obtain a query vector, and calculate the similarity between the query vector and all vectors in the vector database to determine the configuration data whose similarity is higher than a preset similarity threshold.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing unit, the application construction method according to any one of claims 1 to 6 is implemented.
10. An electronic device, characterized in that: include: Processing unit; as well as, A storage unit, used to store executable instructions of the processing unit; Wherein, the processing unit is configured to execute the application construction method according to any one of claims 1 to 6 by executing the executable instructions.
Citation Information
Cited By
Page building method and device and medium
CN120010827A
A method, apparatus, and medium for page building
CN120010827B
