Webpage generation method and device, electronic equipment and storage medium
By combining the Large Language Model (LLM) with a professional knowledge base in a low-code platform, and utilizing NLP and vector representation technology, we can accurately match user needs and generate web pages that meet user intentions. This solves the problem of web page generation deviation caused by the limitations of LLM understanding, and achieves an efficient and accurate web page construction experience.
Patent Information
- Application Number
- CN202510811245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-26
AI Technical Summary
The limitations of large language models (LLMs) in low-code platforms cause the generated web pages to be inconsistent with user intent. Especially when the length of the user's required text exceeds the model's processing limit, the generated results may be biased, reducing the accuracy and practical value of the platform.
By receiving user demand information, using the Large Language Model (LLM) to parse component information and retrieve matching standard components in the professional knowledge base, the configuration code is generated. Combining natural language processing (NLP) technology and vector representation, it ensures the precise matching and integration of component information. Finally, the configuration code is parsed to generate source code and render the page, achieving a seamless transition from concept to visualization.
It significantly reduces the deviation between web page generation and the user's actual intention, improves the intelligence of the low-code platform, lowers the usage threshold for non-professional users, promotes the integration of creativity and technology, and accelerates the web page development process.
Smart Images

Figure CN120704660A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a web page generation method and device, electronic equipment, and storage medium. Background Art
[0002] With the rapid development of front-end development technologies and visualization tools, low-code platforms have emerged, facilitating the rapid development of applications. However, their practical use still requires users to have a certain level of basic technical knowledge, and as the complexity of applications increases, the operation steps may become cumbersome, increasing the learning and usage costs.
[0003] In recent years, the development of large-scale language models (LLMs) has provided a new approach to improving the usability and efficiency of low-code platforms. Users can describe their requirements in natural language, which theoretically should significantly simplify the development process. However, LLMs have limited training datasets and lack sufficient knowledge of specific domains or professional skills. Furthermore, the high cost of updating model knowledge and the uncertainty of model outputs, especially when the length of user requirement text exceeds the model's processing limit, can lead to deviations from the user's true intent, reducing the platform's accuracy and practical value.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a web page generation method and device, an electronic device, and a storage medium to at least solve the technical problem in related technologies that low-code platforms that integrate large language models have understanding limitations, resulting in the generated web pages not being consistent with user intentions.
[0006] According to one aspect of an embodiment of the present invention, a web page generation method is provided, which includes: receiving user demand information for an expected web page, and inputting the demand information into a target language model to obtain N component information in the expected web page, wherein N is a positive integer; searching a target database based on the N component information to obtain a retrieval result, wherein the target database pre-records standard component information of M components, and M is an integer greater than or equal to N; inputting the fusion demand information of the retrieval result and the demand information into the target language model to obtain a configuration code, wherein the configuration code is used to describe the page layout, component properties and application logic of the expected web page; parsing the configuration code to obtain the corresponding source code, and rendering the page based on the source code to obtain a target web page corresponding to the expected web page.
[0007] Furthermore, the step of receiving user demand information for an expected web page and inputting the demand information into a target language model to obtain N component information in the expected web page includes: identifying keyword information in the demand information, wherein the keyword information is used to indicate the basic component type and layout requirements of the expected web page; generating a first model prompt word based on the keyword information and a preset standard prompt template, wherein the first model prompt word is used to describe the basic component type and layout requirements of the expected web page to the target language model; inputting the first model prompt word into the target language model, and having the model output the N component information based on the first model prompt word.
[0008] Furthermore, the step of retrieving the target database based on the N component information to obtain the retrieval result includes: for each of the component information, converting the component information in natural language form into a vector representation to obtain a query vector; searching the target database for a set of candidate vectors corresponding to the query vector, wherein the candidate vector set records R standard component vectors similar to the query vector, where R is a positive integer; matching each of the standard component vectors with the query vector one by one, and taking the standard component vector with the highest matching degree as the matching vector; extracting the standard component information corresponding to the matching vector in the target database to obtain the retrieval result.
[0009] Furthermore, the step of inputting the fusion requirement information of the retrieval result and the requirement information into the target language model to obtain the configuration code includes: when determining that the N standard component information recorded in the retrieval result meets the requirement information, extracting the first model prompt word corresponding to the requirement information; fusing the N standard component information recorded in the retrieval result with the first model prompt word to obtain the second model prompt word; inputting the second model prompt word into the target language model, and the model outputting the configuration code according to the second model prompt word.
[0010] Furthermore, the step of parsing the configuration code to obtain the corresponding source code includes: reading the page layout information, component attribute information of each component and application logic information in the configuration code to obtain a reading result; generating an application code snippet based on the reading result, wherein the application code includes the following types: HTML code, CSS code and JavaScript code; integrating all code snippets to obtain a code document, and if the code document passes the syntax check and integrity check, determining the code document as the source code.
[0011] Furthermore, the step of rendering a page based on the source code to obtain a target web page corresponding to the expected web page includes: loading the source code into a web page rendering engine; generating an initialization page frame according to the page layout information in the source code; inserting page elements into the initialization page frame according to the component attribute information and application logic information in the source code to obtain a preview page; and determining that the preview page is the target web page when the preview result indicates that the visual effects and interaction logic are consistent with the user's demand information for the expected web page.
[0012] Furthermore, all code snippets are integrated to obtain a code document, which also includes: if the code document fails a syntax check or an integrity check, generating a third model prompt word based on the code document and a preset standard prompt template, wherein the third model prompt word is used to describe the syntax error problem or content missing problem of the code document to the target language model; inputting the third model prompt word into the target language model, and the model outputting the adjusted code document according to the third model prompt word.
[0013] According to another aspect of an embodiment of the present invention, a web page generation device is further provided, which includes: a receiving unit for receiving user demand information for an expected web page, and inputting the demand information into a target language model to obtain N component information in the expected web page, wherein N is a positive integer; a retrieval unit for searching a target database based on the N component information to obtain a retrieval result, wherein the target database pre-records standard component information of M components, and M is an integer greater than or equal to N; an input unit for inputting the fusion demand information of the retrieval result and the demand information into the target language model to obtain a configuration code, wherein the configuration code is used to describe the page layout, component properties and application logic of the expected web page; a parsing unit for parsing the configuration code to obtain a corresponding source code, and rendering a page based on the source code to obtain a target web page corresponding to the expected web page.
[0014] Furthermore, the receiving unit includes: an identification module for identifying keyword information in the demand information, wherein the keyword information is used to indicate the basic component type and layout requirements of the expected web page; a first generation module for generating a first model prompt word based on the keyword information and a preset standard prompt template, wherein the first model prompt word is used to describe the basic component type and layout requirements of the expected web page to the target language model; an input module for inputting the first model prompt word into the target language model, and the model outputs the N component information based on the first model prompt word.
[0015] Furthermore, the retrieval unit includes: a conversion module, used to convert the component information in natural language form into a vector representation for each component information to obtain a query vector; a search module, used to search the target database for a set of candidate vectors corresponding to the query vector, wherein the candidate vector set records R standard component vectors similar to the query vector, and R is a positive integer; a matching unit, used to match each standard component vector with the query vector one by one, and take the standard component vector with the highest matching degree as the matching vector; a first extraction unit, used to extract the standard component information corresponding to the matching vector from the target database to obtain the retrieval result.
[0016] Furthermore, the input unit includes: a second extraction unit, used to extract a first model prompt word corresponding to the requirement information when determining that the N standard component information recorded in the retrieval result meets the requirement information; a fusion unit, used to fuse the N standard component information recorded in the retrieval result with the first model prompt word to obtain a second model prompt word; a second input unit, used to input the second model prompt word into the target language model, and the model outputs the configuration code according to the second model prompt word.
[0017] Furthermore, the parsing unit includes: a reading module, used to read the page layout information, component attribute information of each component and application logic information in the configuration code to obtain a reading result; a second generation module, used to generate application code fragments based on the reading result, wherein the application code includes the following types: HTML code, CSS code and JavaScript code; a first determination module, used to integrate all code fragments to obtain a code document, and if the code document passes the syntax check and integrity check, determine the code document as the source code.
[0018] Furthermore, the input unit also includes: a loading module for loading the source code into a web page rendering engine; a third generation module for generating an initialization page frame according to the page layout information in the source code; an insertion module for inserting page elements into the initialization page frame according to the component attribute information and application logic information in the source code to obtain a preview page; and a second determination module for determining that the preview page is the target web page when the preview result indicates that the visual effects and interaction logic are consistent with the user's demand information for the expected web page.
[0019] Furthermore, the first determination module includes: a generation submodule, used to generate a third model prompt word based on the code document and a preset standard prompt template when the code document fails the syntax check or integrity check, wherein the third model prompt word is used to describe the syntax error problem or content missing problem of the code document to the target language model; an input submodule, used to input the third model prompt word into the target language model, and the model outputs the adjusted code document according to the third model prompt word.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned webpage generation methods.
[0021] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned web page generation methods.
[0022] In the present invention, a web page generation method is proposed, which first receives user demand information for an expected web page, and inputs the demand information into a target language model to obtain N component information in the expected web page, where N is a positive integer. Then, based on the N component information, a target database is retrieved to obtain a retrieval result, where standard component information of M components is pre-recorded in the target database, where M is an integer greater than or equal to N. Then, the fusion demand information of the retrieval result and the demand information is input into the target language model to obtain a configuration code, where the configuration code is used to describe the page layout, component properties and application logic of the expected web page. Finally, the configuration code is parsed to obtain the corresponding source code, and the page is rendered based on the source code to obtain a target web page corresponding to the expected web page.
[0023] In the present invention, a method of deeply integrating a large language model (LLM) with a professional knowledge base is adopted, and the purpose of accurately capturing and converting users' natural language description needs is achieved through the means of intelligent retrieval and generation technology. Specifically, the present invention first receives the user's target description of the expected web page, and then inputs it into a pre-trained LLM model. Based on the model's powerful understanding and generation capabilities, it parses the requirements and outputs the basic elements required for the expected web page. Through an efficient retrieval mechanism, it matches the most relevant standard component information in the target database to ensure that the required knowledge is accurately extracted from the huge data. Subsequently, the retrieved information is integrated with the user's needs to form integrated demand information rich in context and professional details, which is submitted to the LLM model again. Based on a full understanding of the context, the model generates configuration code that describes the web page layout, component properties and application logic. It not only covers the user's explicit needs, but also supplements possible implicit needs through the reasoning ability of LLM, making the generated web page more complete and closer to the user's intention. Finally, through the code parsing and rendering mechanism unique to the low-code platform, the configuration code is converted into actual source code, and then the target web page is rendered in real time, realizing a seamless transition from concept to visualization, thereby solving the technical problem that the low-code platform that integrates large language models in related technologies has understanding limitations, resulting in the generated web page not being consistent with the user's intention.
[0024] This invention significantly reduces the discrepancy between web page generation and user intent within a low-code platform that integrates a large language model. This effectively overcomes the limitations of model understanding in related technologies, providing users with a more intuitive, accurate, and efficient web page building experience. This innovative approach not only enhances the intelligence of low-code platforms but also significantly lowers the barrier to entry for non-professional users, fostering a fusion of creativity and technology and accelerating the development of web pages. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 is an architectural diagram of an optional intelligent low-code application development platform according to an embodiment of the present invention;
[0027] Figure 2 is a flow chart of an optional web page generation method according to an embodiment of the present invention;
[0028] Figure 3 is a flow chart of an optional method for intelligently generating a web page according to an embodiment of the present invention;
[0029] Figure 4is a schematic diagram of an optional method for intelligently creating a web page according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of an optional webpage generating device according to an embodiment of the present invention;
[0031] Figure 6 The figure is a hardware structure block diagram of an electronic device (or mobile device) for executing a webpage generation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] To facilitate those skilled in the art to understand the present invention, some of the terms or nouns involved in the embodiments of the present invention are explained below:
[0035] LLM, short for Large Language Model, refers to a neural network model with a large number of parameters. It is primarily used to understand and generate human language and can demonstrate excellent performance on a variety of natural language processing tasks. In this paper, LLM plays a core role in parsing user requirements and generating configuration code. Its powerful text understanding and generation capabilities are the foundation for the rapid construction of low-code web pages.
[0036] NLP (Natural Language Processing) is a technology that covers multiple aspects, including speech recognition, semantic understanding, and text generation. It is the foundation for natural language interaction between users and systems. In this paper, NLP is used to parse user input, extract key elements, and format them into an input form that the LLM model can understand.
[0037] JSON Schema is a specification for describing JSON data structures. In low-code development, JSON Schema is often used as metadata to describe page layout and component properties, facilitating platform parsing and rendering. The configuration code generated by this invention using LLM is based on the JSON Schema format, enabling the low-code engine to directly parse and quickly generate the required web page interface and source code.
[0038] A low-code platform is a software development tool that allows users to quickly build and publish applications using a graphical interface, drag-and-drop components, and minimal coding. The introduction of low-code platforms aims to lower the barrier to entry for software development, enabling non-professionals to participate in application development. In this invention, the low-code platform provides front-end and back-end control programs to process the code generated by the LLM and ultimately present it as a visual web page.
[0039] The following embodiments of the present invention can be applied to various systems / applications / devices that require intelligent page generation and customization, and can realize the function of accurately building web pages based on natural language descriptions. At the technical level, the present invention integrates a large language model (LLM) and a professional knowledge base. Through the natural language demand information input by the user, the LLM parses and locates the required components, and then uses an efficient retrieval algorithm to obtain the most matching standard component information in the target database. This process not only takes into account the explicit expression of user needs, but also supplements potential implicit needs through the reasoning ability of the LLM, ensuring that the generated web page layout, component properties and application logic are highly consistent with the user's intentions.
[0040] The core components of the present invention also include a low-code engine, which is based on the configuration code jointly generated by LLM and professional knowledge base, and can automatically parse and render the web page interface required by the user. In addition, the low-code engine also supports fine-tuning and secondary development, allowing users to customize the generated pages based on the generated pages, further improving the flexibility and efficiency of web page construction. Through such a technical architecture, the present invention can more accurately understand user needs and more efficiently generate web pages that meet the needs, thereby significantly reducing the use threshold and technical barriers of the low-code platform in the field of web page construction, and realizing a rapid conversion from concept to visualization.
[0041] The present invention will be described in detail below with reference to various embodiments.
[0042] Example 1
[0043] According to an embodiment of the present invention, an embodiment of a web page generation method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] The present invention is implemented as follows Figure 2 The web page generation method shown in the figure is implemented by combining the large language model (LLM) and retrieval-augmented generation (RAG) technology for large front-end development scenarios, especially to solve the understanding limitations of low-code platforms that integrate large language models in related technologies, which leads to the problem that the generated web pages do not match the user's intentions. Through deep learning and professional knowledge base retrieval, the web page demand information described by the user in natural language is received and input into the LLM to obtain the key component information describing the expected web page, and the relevant standard component information is retrieved in the professional knowledge base. The retrieval results are integrated with the user demand information and input into the LLM again to generate configuration code describing the expected web page layout, component properties and application logic. The configuration code is parsed to generate the corresponding source code, and the page is rendered in real time to obtain the target web page that matches the expected web page.
[0045] Figure 1 This is an architectural diagram of an optional intelligent low-code application development platform according to an embodiment of the present invention. Figure 1 As shown in the figure, the architecture includes: an automatic orchestration layer, which contains a front-end control program, a visual editor, a back-end control program and a Schema parsing engine to realize asynchronous dialogue and data processing; a RAG module, equipped with a knowledge base, LLM (Language Model), a data model and NLP (Natural Language Processing) capabilities to realize intelligent segmentation and vectorization of document content; a mapping layer, which integrates a rule engine and a low-code engine to realize the conversion between DSL (Domain Specific Language) documents and source code; a data storage layer, which contains metadata models and business data support, and is used for the storage and retrieval of DSL documents.
[0046] The above architecture greatly simplifies the development process. Through the collaborative work of the automatic orchestration layer and the RAG module, users only need to describe their needs in natural language, and the platform can automatically parse and generate the corresponding component information and configuration code, and finally convert it into executable source code. For example, when a user asks "I need a product list page with a search function", the platform can quickly understand the needs, retrieve relevant components, such as product list components, search box components, etc., and automatically generate the corresponding configuration code. This process solves the tedious manual coding and configuration problems in traditional development and greatly improves development efficiency. In addition, the platform supports source code generation in multiple programming languages, including but not limited to JavaScript and TypeScript, to meet the diverse needs of developers with different technical backgrounds.
[0047] Figure 2 is a flow chart of an optional web page generation method according to an embodiment of the present invention, such as Figure 2 As shown, the method includes the following steps:
[0048] Step S201 : receiving user demand information for an expected web page, and inputting the demand information into a target language model to obtain N component information in the expected web page, where N is a positive integer.
[0049] It should be noted that the expected webpage requirement information is a description of the webpage that the user hopes to build through the intelligent low-code development system. It usually uses natural language to describe the user's expectations for webpage layout, component types, functional requirements, etc. For example, "I want a page with a login form and a registration button."
[0050] The Target Language Model (LLM) is a deep learning model trained on large-scale data, specifically designed to understand and generate human language. When a user's request information is input, the LLM interprets the request and locates the relevant components that make up the desired webpage based on its internal semantic understanding and knowledge graph.
[0051] The component information (N components) in the expected web page is a specific component description generated by LLM after parsing user requirements. Each description includes the component type, properties, and instructions for how to layout it on the page. For example, in the login page example above, the component information may include "Input" and "Button", with their respective property settings, such as the input box's placeholder text, the button's text content, and its action.
[0052] Furthermore, the steps of receiving user demand information for an expected web page and inputting the demand information into a target language model to obtain N component information in the expected web page include: identifying keyword information in the demand information, wherein the keyword information is used to indicate the basic component types and layout requirements of the expected web page; generating a first model prompt word based on the keyword information and a preset standard prompt template, wherein the first model prompt word is used to describe the basic component types and layout requirements of the expected web page to the target language model; and inputting the first model prompt word into the target language model, and having the model output N component information based on the first model prompt word.
[0053] In an optional embodiment, the implementation system first parses the received user requirement information to extract keywords that describe the intended webpage layout and component types. These keywords are key to understanding user intent. For example, words like "form," "login," and "button" are directly associated with specific webpage components and layout requirements. Natural language processing (NLP) technology is used in this recognition process to ensure that even when the user requirement is not precisely expressed, the core information is accurately captured.
[0054] Next, based on the identified keywords and a preset standard prompt template, the first model prompt is generated. The purpose of the prompt is to translate user needs into a format that is easily understood and processed by the target language model. Prompts include not only keyword information but also high-level descriptions such as the logical relationships between components and basic principles of page design, guiding the model to produce results that are closer to user expectations.
[0055] Finally, the first model's prompts are submitted to the target language model for processing. After receiving the prompts, the model uses its powerful semantic understanding and generation capabilities to analyze the meaning of each keyword, the relationships between components, and the overall layout requirements. It then outputs detailed descriptions of multiple components, covering not only basic information such as component type, size, and location, but also more refined property settings and function definitions. This allows even non-expert user descriptions to be converted into specific and practical component configuration parameters.
[0056] Step S202 : searching a target database based on N component information to obtain a search result, wherein the target database has pre-recorded standard component information of M components, where M is an integer greater than or equal to N.
[0057] In step S202, a preset target database is accurately searched based on the N component information obtained in the previous step (S201), with the goal of finding the most appropriate standard component information for each component to ensure that the subsequently constructed web page is both accurate and efficient.
[0058] The target database is a database that stores component information. The types and quantity of components in the database are sufficient to cover any requirements raised by users. The information in the database has been carefully designed and optimized, covering a variety of types from basic text boxes and buttons to complex charts, multimedia players, etc. Each component is given a set of standardized and structured descriptions, including the component's ID, name, property list, default style, function description, etc. More importantly, all component information corresponds to actual business scenarios and design specifications, ensuring that each component has a detailed description and clear usage guide for easy retrieval and application.
[0059] Standard component information is a detailed description of each component in the database, including all of its properties and usage rules. For example, for a "Text Box" component, standard component information includes fields such as "id," "name," "type" (for text boxes), "attributes" (such as "placeholder" and "size"), "defaultStyles" (preset styles), and "functions" (available functions). This information is not only a key reference during component retrieval but also an important basis for subsequent component configuration and web page generation.
[0060] Furthermore, the step of retrieving the target database based on N component information to obtain the retrieval result includes: for each component information, converting the component information in natural language form into a vector representation to obtain a query vector; searching for a set of candidate vectors corresponding to the query vector in the target database, wherein the candidate vector set records R standard component vectors similar to the query vector, where R is a positive integer; matching each standard component vector with the query vector one by one, and taking the standard component vector with the highest matching degree as the matching vector; extracting the standard component information corresponding to the matching vector in the target database to obtain the retrieval result.
[0061] In one specific embodiment, at the initial stage of the intelligent retrieval process, the implementation system converts the user's component requirements (i.e., N components) described in natural language into a vector representation, called a query vector. This conversion process primarily relies on natural language processing (NLP) and deep learning embedding techniques, such as Word2Vec or BERT, which can map text to vectors in a high-dimensional space. This allows similar concepts or components to be close in distance in the vector space, enabling the system to measure the similarity of component information based on vector distance, thereby enabling more efficient retrieval.
[0062] The target database is then searched for a set of candidate vectors similar to the query vector. The target database stores a large number of standard component vectors, each corresponding to a specific component and its attribute descriptions. By calculating the similarity between the query vector and each vector in the database, the R standard component vectors most likely to meet the user's needs are selected to form a candidate set. This process is essentially an intelligent search of the knowledge base, utilizing vector space nearest neighbor search algorithms, such as cosine similarity or Euclidean distance, to ensure accurate and targeted search results.
[0063] Each standard component vector in the candidate vector set is carefully compared and matched against the query vector, and the one with the highest degree of match is selected as the matching vector. This matching process can be based on a precise calculation of the similarity described above, or it can be combined with other factors (such as component frequency, popularity, or user preferences) to comprehensively evaluate the optimal component. Selecting the optimal component vector ensures a high degree of consistency between user requirements and standard components, thereby generating component information that best meets the needs.
[0064] Finally, the corresponding standard component information is extracted from the target database based on the matching vectors, generating the final search results. These results include detailed component descriptions, property configurations, and usage examples, providing essential input for subsequent configuration code generation. The accuracy and richness of these search results directly impact the quality of the final page and user satisfaction, making them a critical component of the entire intelligent low-code development process.
[0065] Step S203 : Inputting the fusion demand information of the search result and the demand information into the target language model to obtain a configuration code, wherein the configuration code is used to describe the page layout, component properties and application logic of the expected web page.
[0066] It should be noted that fused demand information refers to the information obtained by combining the demand information directly provided by the user with the standard component information retrieved from the target database. It not only includes the user's basic description of the page layout, component appearance and function, but also details each attribute and setting of the specific component, forming a complete and detailed blueprint for web page construction.
[0067] In this step, the fused demand information is submitted to the target language model again for in-depth processing. The task of the LLM model is to generate a set of configuration codes that can reflect user intentions and meet technical specifications based on understanding user needs and component characteristics. The configuration code uses a specific encoding format, such as JSON, to describe the detailed layout of the expected web page, the property settings of each component, and the interaction logic between pages. For example, the configuration code will clearly specify the position, size, style, and response mechanism of the component when an event is triggered. It is a bridge connecting user creativity and technical implementation in the low-code development system. By parsing the configuration code, the system can quickly generate the corresponding source code and visual interface to realize the user's development vision.
[0068] In short, step S203 combines user requirements with standard component information through intelligent fusion processing using the target language model (LLM), generating configuration code that describes all the details of the intended web page, providing clear guidance for subsequent page rendering and source code generation. This process emphasizes the intelligence and flexibility of the technology, ensuring that even users with non-technical backgrounds can achieve highly customized and professional web development results through natural language expression.
[0069] Furthermore, the step of inputting the fusion requirement information of the search results and the requirement information into the target language model to obtain the configuration code includes: when determining that the N standard component information recorded in the search results meet the requirement information, extracting the first model prompt word corresponding to the requirement information; fusing the N standard component information recorded in the search results with the first model prompt word to obtain the second model prompt word; inputting the second model prompt word into the target language model, and the model outputting the configuration code according to the second model prompt word.
[0070] An optional specific embodiment is that when the implementation system confirms that the N standard component information retrieved fully meets the requirement information originally proposed by the user, the first model prompt words closely related to these component information are extracted, the N standard component information and the first model prompt words are integrated to generate the second model prompt words.
[0071] The second model prompt is a further refined model input, containing all necessary information about the component and the specific requirements and expectations of the user. This integration process ensures that the model fully considers the details of the component's functional implementation and user interface design when generating configuration code, resulting in more accurate and complete configuration code that better matches user expectations.
[0072] The second model prompt is fed into the target language model. Based on this prompt, the model combines its own language generation capabilities and understanding of component information to generate configuration code that describes the intended webpage. This configuration code, using common configuration formats such as JSON or XML, specifies each component's location, size, style, and interaction logic with other components. This not only solves the problem of translating user requirements into component configuration, but also enables efficient code generation and consistent coding style, providing solid technical support for low-code development platforms.
[0073] Step S204 , parsing the configuration code to obtain a corresponding source code, and rendering a page based on the source code to obtain a target web page corresponding to the expected web page.
[0074] It's important to note that in the intelligent low-code development process, source code is automatically generated by the system based on the configuration code. It adheres to specific programming language specifications, such as JavaScript, HTML, and CSS, and is used to implement the page layout, component properties, and application logic described by the configuration code. Source code generation is a key step in the implementation of low-code platform technology. It can automatically convert natural language descriptions from non-technical personnel into computer-readable code, avoiding the tediousness and errors of manual coding and greatly improving development efficiency and code consistency.
[0075] Once the source code is generated, the next step is to parse and present it in the browser environment, creating a visual page visible to the user. Rendering is the process of mapping the data and logic in the source code to the front-end interface elements. This involves HTML structure, CSS styles, and JavaScript dynamics. The rendering process ensures consistency between code and design, allowing users to preview the page effect in real time and make timely adjustments during development.
[0076] The target webpage is the final output of the intelligent low-code development process. It is the actual webpage rendered according to user requirements and configured code. The target webpage not only reflects the user's initial creative concept but also integrates the optimized component configuration and page layout, ready for online publishing or further customized development. This achievement marks that even non-technical users can participate in professional-level web development through simple instructions, significantly lowering the development threshold and improving the user experience.
[0077] In short, step S204 generates source code by parsing the configuration code, and then converts the source code into a visual page in real time under the rendering mechanism of the low-code platform, and finally generates a target web page that meets the user's expectations.
[0078] Furthermore, the step of parsing the configuration code to obtain the corresponding source code includes: reading the page layout information, component attribute information of each component and application logic information in the configuration code to obtain the reading results; generating application code snippets based on the reading results, wherein the application code includes the following types: HTML code, CSS code and JavaScript code; integrating all code snippets to obtain a code document, and when the code document passes the syntax check and integrity check, determining the code document as the source code.
[0079] An optional embodiment: In the intelligent low-code development process, reading the configuration code is a crucial step. First, the configuration code is parsed to extract the page layout information, component attribute information of each component, and application logic information. The page layout information describes the position and arrangement of the components on the page; the component attribute information specifies the appearance, size, status, etc. of the components in detail; the application logic information describes the interaction rules and data processing flow between components. This reading process usually uses JSON parsing technology, because the configuration code often uses JSON or similar structured data formats, which makes it easier for the system to quickly locate and extract key information.
[0080] Next, the corresponding HTML, CSS, and JavaScript code snippets are generated based on the page layout, component properties, and application logic. The HTML code describes the page structure; the CSS code defines the component's style; and the JavaScript code implements the component's dynamic interaction and data processing logic. This generation process is accomplished through a code generation engine, which automatically converts the configuration code into standard front-end code, reducing the burden of manual coding and accelerating development.
[0081] All generated code snippets are integrated into a complete code document. After integration, a series of syntax checks and integrity checks are performed to ensure the correctness and stability of the source code. Syntax checks include checking for closed HTML tags, syntax errors in CSS properties, and compliance with JavaScript statements. Integrity checks ensure that the code includes all necessary components and that no components or logic are omitted. Only after all these checks pass is the code document officially confirmed as source code for subsequent page rendering or further custom development.
[0082] Furthermore, the step of rendering a page based on the source code to obtain a target web page corresponding to the expected web page includes: loading the source code into a web page rendering engine; generating an initialization page frame according to the page layout information in the source code; inserting page elements into the initialization page frame according to the component attribute information and application logic information in the source code to obtain a preview page; when the preview result indicates that the visual effect and interaction logic are consistent with the user's demand information for the expected web page, determining that the preview page is the target web page.
[0083] In one specific embodiment, during the final stage of intelligent low-code development, the implementation system loads the generated source code into a web rendering engine. The rendering engine is responsible for converting HTML, CSS, and JavaScript code into a user interface, serving as the bridge between the source code and the actual page. The loading process can be instant, allowing users to preview the effects immediately after coding, or pre-compiled to improve rendering speed and compatibility.
[0084] First, an initial page skeleton is generated based on the page layout information in the source code. This layout information defines the position and size of elements on the page, including the use of layout elements such as grid systems, containers, rows, and columns. By parsing this layout information, the rendering engine can quickly build the basic structure of the page, providing a clear blueprint for subsequent element insertion. This step is crucial for ensuring visual quality and responsive design.
[0085] Next, page elements are dynamically inserted into the initialization page framework based on the component attribute information and application logic information in the source code. Component attribute information guides how to set the appearance and behavior of each element, such as color, font, and animation; application logic details the interaction logic between elements, such as form submission and button click events. This process is implemented through JavaScript DOM (Document Object Model) operations, ensuring that page elements are highly consistent with user requirements. Once inserted, the generated page becomes a preview page, allowing users to instantly view the page's effects and functionality within the development environment.
[0086] Finally, the preview page's visuals and interaction logic are checked to confirm that they fully align with the user's desired webpage requirements. This verification can be performed through automated testing scripts or manual review to ensure the page's compatibility and responsiveness across different devices and browsers. Only after all tests pass and users are satisfied is the preview page officially confirmed as the target webpage, ready for launch or further development.
[0087] Furthermore, all code snippets are integrated to obtain a code document, which also includes: if the code document fails the syntax check or integrity check, generating a third model prompt word based on the code document and a preset standard prompt template, wherein the third model prompt word is used to describe the syntax error problem or content missing problem of the code document to the target language model; inputting the third model prompt word into the target language model, and the model outputting the adjusted code document according to the third model prompt word.
[0088] In a specific implementation, during the intelligent low-code development process, generated HTML, CSS, and JavaScript code snippets are integrated into a complete code document. This integration effort aims to create a standalone front-end application framework that contains all the structure, style, and interaction logic of the page. However, after the initial integration, the code document may contain syntax errors or lack certain necessary component information, which may hinder subsequent page rendering and functional implementation.
[0089] To correct these issues, the implementation system generates third-model prompts based on the preliminary code document and a pre-set standard prompt template. These third-model prompts describe grammatical errors or missing content in the code document to the target language model (LLM), allowing the model to make targeted correction suggestions.
[0090] The third model's prompts are then sent to the target language model, which adjusts and optimizes code documents containing errors or missing information based on the descriptions in the prompts. The model's responses include providing correct syntax, filling in missing component information, and fixing logical vulnerabilities, ensuring that the code documents pass syntax and integrity checks. This process demonstrates the unique advantages of LLM in code completion, error diagnosis, and repair, tightly integrating natural language processing technology with code optimization to form a closed loop of intelligent code generation and management.
[0091] Through the above steps S201 to S204, the user's demand information for the expected web page can be first received, and the demand information can be input into the target language model to obtain N component information in the expected web page, where N is a positive integer. Then, based on the N component information, the target database is searched to obtain the search results, where the target database pre-records the standard component information of M components, where M is an integer greater than or equal to N. Then, the fusion demand information of the search results and the demand information is input into the target language model to obtain the configuration code, where the configuration code is used to describe the page layout, component properties and application logic of the expected web page. Finally, the configuration code is parsed to obtain the corresponding source code, and the page is rendered based on the source code to obtain the target web page corresponding to the expected web page.
[0092] In the embodiment of the present invention, a method of deeply integrating a large language model (LLM) with a professional knowledge base is adopted, and the purpose of accurately capturing and converting the user's natural language description needs is achieved through the means of intelligent retrieval and generation technology. Specifically, the present invention first receives the user's target description of the expected web page, and then inputs it into a pre-trained LLM model. Based on the model's powerful understanding and generation capabilities, it parses the requirements and outputs the basic elements required for the expected web page. Through an efficient retrieval mechanism, it matches the most relevant standard component information in the target database to ensure that the required knowledge is accurately extracted from the huge data. Subsequently, the retrieved information is integrated with the user's needs to form integrated demand information rich in context and professional details, which is submitted to the LLM model again. Based on a full understanding of the context, the model generates configuration code that describes the web page layout, component properties and application logic. It not only covers the user's explicit needs, but also supplements possible implicit needs through the reasoning ability of LLM, making the generated web page more complete and closer to the user's intention. Finally, through the code parsing and rendering mechanism unique to the low-code platform, the configuration code is converted into actual source code, and then the target web page is rendered in real time, realizing a seamless transition from concept to visualization, thereby solving the technical problem that the low-code platform that integrates large language models in related technologies has understanding limitations, resulting in the generated web page not being consistent with the user's intention.
[0093] based on Figure 1 The intelligent low-code application development platform shown in the figure, the embodiment of the present invention also provides a method for intelligent generation of web pages, first select and configure the technology stack, and choose an LLM that suits the needs. The embodiment of the present invention uses LLAMA3 as the LLM large model, and further chooses to use Markdown (a lightweight markup language) format to create a knowledge base to ensure rich document content and clear structure, and selects the FAISS vector database to store vectorized document content.
[0094] Then, the knowledge base documents are segmented and vectorized, and natural language processing technology (NLP) and Markdown syntax analyzer are used to intelligently segment the knowledge base documents according to content structure and hierarchy, retaining the integrity of the original data; text embedding technology is used to convert the segmented document content into vector representation and store it in a vector database.
[0095] Going further, Figure 3 FIG. 1 is a flow chart of an optional method for intelligently generating a web page according to an embodiment of the present invention. Figure 3As shown in the figure, the user requirements are converted into vector representations for searching in the vector database; the document vector closest to the query vector is searched in the vector database, and the corresponding document content is obtained; the retrieved document content is analyzed by LLM to select the component set (i.e., DSL fragment) most relevant to the query; the LLM return content is passed through the efficient indexing mechanism of the vector database to quickly filter out the candidate document set related to the query; more sophisticated algorithms and features are used to sort the candidate document set to ensure that the most relevant documents are ranked first; the reasoning ability of LLM is used to add relevant background knowledge, explanatory concepts, etc. to the retrieved document content; enrich prompts to help LLM better understand the query and retrieved content, and improve the accuracy and reliability of LLM reasoning; LLM returns Json Schema format data to describe the structure and function of the page; the low-code engine parses and renders the UI interface according to Json Schema, so that users can intuitively see the page effect; at the same time, the low-code engine converts Json The schema is converted into corresponding source code for developers to use directly or further customize. Feedback and suggestions from users are collected during use to understand the strengths and weaknesses of the system. The knowledge base content is updated regularly to ensure that the information in the system is always up to date. Based on user feedback and actual needs, Promote is continuously updated and optimized to improve the accuracy and reliability of the system.
[0096] In another specific embodiment, Figure 4 is a schematic diagram of an optional method for intelligently creating a web page according to an embodiment of the present invention, such as Figure 4 As shown, integrating LLM capabilities accelerates the development process and user experience of front-end applications. Users can quickly generate forms, tables, content details, and other pages using simple natural language descriptions without having to memorize a large number of component configurations and functional points, effectively improving the efficiency of using low-code platforms. Details are as follows.
[0097] (1) Input requirements: In the front-end application, the user inputs "create a form page containing an input box, a password box, and a button."
[0098] (2) Asynchronous dialogue and data processing:
[0099] 1. Open the front-end application, and establish a websocket asynchronous connection between the front-end control program and the back-end control program, or use the post data stream to control.
[0100] 2. The user enters the requirement "Create a form page containing an input box, a password box, and a button" in the front-end application. The front-end application saves the user requirement to the session and sends the user requirement to the back-end control program.
[0101] 3. After the backend control program receives the user's requirements, it constructs a prompt as follows:
[0102]
You are a front-end engineer. User requirements: "Create a form page containing an input box, a password box, and a button." Find the set of component names that can meet the user's requirements with the minimum number of components from the available component names: 'image, paragraph, text area, title, xxx, etc.' Just return the required component names, separated by commas, without explanation.
[0103] 4. After the LLM receives the prompt, it generates a set of components "{input box, password box, button}" that can meet the user's requirements and sends this set of components to the backend control program.
[0104] 5. The backend control program sends the set of components to the knowledge base, traverses and queries the usage methods of individual components in the set of components, and combines them into a set of component usage methods "{usage method of input box, usage method of password box, usage method of button}".
[0105] 6. After the backend control program generates the set of component usage methods, it constructs a prompt as follows:
[0106]
You are a low-code JSON generator. The available components in <component library> are {input box, password box, button} with usage methods {usage method of input box, usage method of password box, usage method of button}. < / component library> Modify according to <user requirements> "Create a form page containing an input box, a password box, and a button" < / user requirements>. For attributes not clearly defined in <user requirements>, you can set a default value. First, select the required components in <component library> according to <user requirements>, and only select components from <component library> (this is very important), without explaining the reason, and generate a complete JSON array.
[0107] 7. After the LLM receives the prompt, it implements the user's requirements according to the set of component usage methods, generates JSON, and returns it to the backend control program.
[0108] 8. The backend control program sends the returned JSON to the front-end control program, and the front-end control program uses the schema to render the page.
[0109] (3) Page generation: The low-code engine analyzes these metadata, automatically converts them into source code, and stream-renders the page required by the user.
[0110] Furthermore, a method for intelligently modifying web pages is provided. If the generated page does not fully meet expectations and requires fine-tuning, users can also easily do so through natural language input. This allows users to fine-tune the page content through natural language input in the chat panel, such as adding, deleting, or modifying form or list fields, changing page titles, or customizing component styles. This provides users with a low-cost, highly fault-tolerant interactive experience. The details are as follows.
[0111] (1) Input requirement: In the front-end application, the user inputs "Add another button named Register".
[0112] (2) Asynchronous dialogue and data processing:
[0113] 1. The user enters the requirement "Add another button named "Register" in the front-end application. The front-end application adds the user requirement to the session, retrieves the user requirement set (historical conversation) from the session, sorts the user requirement set by step, and sends it to the back-end control program.
[0114] 2. After receiving the user's request, the backend control program constructs a prompt as follows: [You are a page designer. The user's request is: "Step 1: Create a form page with an input field, a password field, and a button. Step 2: Add a button named Register." Find the minimum set of component names required to meet the user's requirements from the possible component names: 'image, paragraph, text field, title, xxx, etc.'. Simply return the required component names, separated by commas; no explanation is required.] Send this prompt to the LLM.
[0115] 3. After receiving the prompt, LLM generates a component set "{input box, password box, button}" that can meet user needs and sends the component set to the back-end control program.
[0116] 4. The back-end control program sends the component set to the knowledge base, traverses and queries the usage methods of individual components in the component set, and combines them into a component usage method set "{how to use the input box, how to use the password box, how to use the button}".
[0117] 5. After the backend control program generates the component usage method set, it constructs the prompt, which is as follows:
[0118]
You are a low-code JSON generator. The available components in the <Component Library> are {input box, password box, button}, and the usage methods are {usage method of input box, usage method of password box, usage method of button}. < / Component Library> Modify according to the <User Requirements> "Step 1: Create a form page containing an input box, a password box, and a button; Step 2: Add another button named Register". < / User Requirements> For properties not clearly defined in the <User Requirements>, you can set a default value. First, select the required components from the <Component Library> according to the <User Requirements>. Only select components from the <Component Library> (this is very important), without explaining the reason, and generate a complete JSON array.
[0119] 6. After the LLM receives the prompt, it implements the user requirements according to the component usage method set, generates JSON, and returns it to the backend control program.
[0120] 7. The backend control program sends the returned JSON to the frontend control program, and the frontend control program uses the schema to render the page.
[0121] (3) Page generation: The low-code engine analyzes these metadata, automatically converts them into source code, and stream-renders the page required by the user.
[0122] Furthermore, a method for regenerating a web page is provided. Since the answer of the large AI model is a probabilistic answer, the generated page has a certain degree of randomness. If it does not meet the expectations, in addition to continuing the conversation to modify, you can also click the regenerate button below the dialog box, and send the historical conversation requirements to the LLM again, so that the large model can understand and regenerate the page again. Specifically as follows.
[0123] (1) Input requirements: In the front-end application, the user inputs "Add a page containing a title, a picture, and a button".
[0124] (2) It is the same as the steps in Scenario 1. The large model conducts asynchronous conversation and data processing, and the low-code engine analyzes these returned metadata, automatically converts them into source code, and stream-renders the page required by the user.
[0125] (3) View the page effect. If there are differences from the expectations, click the regenerate button in the dialog box. The front-end application retrieves the user requirement set (historical conversation) from the session, sorts the user requirement set by steps, and sends it to the backend control program for asynchronous conversation and data processing again, and returns the schema for the engine to analyze.
[0126] (4) Check the page. If you are satisfied with the current effect, you can export the code and continue the AI dialogue to continuously improve the page function. If it still does not meet your expectations, you can continue to click the Regenerate button and repeat the above steps until you achieve the expected effect.
[0127] In summary, the embodiments of the present invention innovatively introduce large language models (LLM) and retrieval-augmented generation (RAG) technologies on the basis of a low-code development platform, aiming to change the traditional model of software development and content creation. Through the powerful natural language understanding and generation capabilities of LLM, users can define software logic and build application interfaces with more intuitive and natural language instructions, which greatly reduces the programming threshold and allows non-professional developers to get started quickly. The integration of RAG technology further enhances the intelligence and accuracy of the system, and can automatically retrieve relevant knowledge bases when processing requests, and combine the reasoning capabilities of LLM to generate more accurate and personalized responses or code snippets. This comprehensive solution not only accelerates the software development cycle, but also promotes the seamless integration of creativity and technology, bringing unprecedented innovation opportunities to low-code.
[0128] The present invention is described below in conjunction with another optional embodiment.
[0129] Example 2
[0130] A webpage generating device provided in this embodiment includes multiple implementation units, each implementation unit corresponding to each implementation step in the above-mentioned embodiment 1.
[0131] Figure 5 is a schematic diagram of an optional web page generating device according to an embodiment of the present invention, such as Figure 5 As shown, the device may include: a receiving unit 51, a searching unit 52, an input unit 53, and a parsing unit 54.
[0132] Among them, the receiving unit 51 is used to receive the user's demand information for the expected web page, and input the demand information into the target language model to obtain N component information in the expected web page, where N is a positive integer; the retrieval unit 52 is used to retrieve the target database based on the N component information to obtain the retrieval result, wherein the target database pre-records the standard component information of M components, and M is an integer greater than or equal to N; the input unit 53 is used to input the fusion demand information of the retrieval result and the demand information into the target language model to obtain the configuration code, wherein the configuration code is used to describe the page layout, component properties and application logic of the expected web page; the parsing unit 54 is used to parse the configuration code to obtain the corresponding source code, and render the page based on the source code to obtain the target web page corresponding to the expected web page.
[0133] The above-mentioned web page generation device can first receive the user's demand information for the expected web page through the receiving unit 51, and input the demand information into the target language model to obtain N component information in the expected web page, where N is a positive integer, and then search the target database based on the N component information through the retrieval unit 52 to obtain the retrieval result, where the target database pre-records the standard component information of M components, M is an integer greater than or equal to N, and then input the fusion demand information of the retrieval result and the demand information into the target language model through the input unit 53 to obtain the configuration code, where the configuration code is used to describe the page layout, component properties and application logic of the expected web page, and finally parse the configuration code through the parsing unit 54 to obtain the corresponding source code, and render the page based on the source code to obtain the target web page corresponding to the expected web page.
[0134] In an embodiment of the present invention, a method of deeply integrating a large language model (LLM) with a professional knowledge base is adopted, and the purpose of accurately capturing and converting the user's natural language description needs is achieved through the means of intelligent retrieval and generation technology. Specifically, the present invention first receives the user's target description of the expected web page, and then inputs it into a pre-trained LLM model. Based on the model's powerful understanding and generation capabilities, it parses the requirements and outputs the basic elements required for the expected web page. Through an efficient retrieval mechanism, it matches the most relevant standard component information in the target database to ensure that the required knowledge is accurately extracted from the huge data. Subsequently, the retrieved information is integrated with the user's needs to form integrated demand information rich in context and professional details, which is submitted to the LLM model again. Based on a full understanding of the context, the model generates configuration code that describes the web page layout, component properties and application logic. It not only covers the user's explicit needs, but also supplements possible implicit needs through the reasoning ability of LLM, making the generated web page more complete and closer to the user's intention. Finally, through the code parsing and rendering mechanism unique to the low-code platform, the configuration code is converted into actual source code, and then the target web page is rendered in real time, realizing a seamless transition from concept to visualization, thereby solving the technical problem that the low-code platform that integrates large language models in related technologies has understanding limitations, resulting in the generated web page not being consistent with the user's intention.
[0135] Furthermore, the receiving unit includes: an identification module for identifying keyword information in the demand information, wherein the keyword information is used to indicate the basic component type and layout requirements of the expected web page; a first generation module for generating a first model prompt word based on the keyword information and a preset standard prompt template, wherein the first model prompt word is used to describe the basic component type and layout requirements of the expected web page to the target language model; an input module for inputting the first model prompt word into the target language model, and the model outputs N component information based on the first model prompt word.
[0136] Furthermore, the retrieval unit includes: a conversion module, which is used to convert the component information in natural language form into a vector representation for each component information to obtain a query vector; a search module, which is used to search for a set of candidate vectors corresponding to the query vector in the target database, wherein the candidate vector set records R standard component vectors similar to the query vector, and R is a positive integer; a matching unit, which is used to match each standard component vector with the query vector one by one, and take the standard component vector with the highest matching degree as the matching vector; a first extraction unit, which is used to extract the standard component information corresponding to the matching vector in the target database to obtain a retrieval result.
[0137] Furthermore, the input unit includes: a second extraction unit, used to determine that the N standard component information recorded in the retrieval results meet the requirement information, and extract the first model prompt word corresponding to the requirement information; a fusion unit, used to fuse the N standard component information recorded in the retrieval results with the first model prompt word to obtain a second model prompt word; a second input unit, used to input the second model prompt word into the target language model, and the model outputs the configuration code according to the second model prompt word.
[0138] Furthermore, the parsing unit includes: a reading module, which is used to read the page layout information, component attribute information of each component and application logic information in the configuration code to obtain a reading result; a second generation module, which is used to generate application code fragments based on the reading result, wherein the application code includes the following types: HTML code, CSS code and JavaScript code; a first determination module, which is used to integrate all code fragments to obtain a code document, and when the code document passes the syntax check and integrity check, determine the code document as source code.
[0139] Furthermore, the input unit also includes: a loading module for loading the source code into the web page rendering engine; a third generation module for generating an initialization page frame based on the page layout information in the source code; an insertion module for inserting page elements into the initialization page frame based on the component attribute information and application logic information in the source code to obtain a preview page; a second determination module for determining that the preview page is the target web page when the preview result indicates that the visual effects and interaction logic are consistent with the user's demand information for the expected web page.
[0140] Furthermore, the first determination module includes: a generation submodule, which is used to generate a third model prompt word based on the code document and a preset standard prompt template when the code document fails the syntax check or integrity check, wherein the third model prompt word is used to describe the syntax error problem or content missing problem of the code document to the target language model; an input submodule, which is used to input the third model prompt word into the target language model, and the model outputs the adjusted code document according to the third model prompt word.
[0141] The web page generating device may further include a processor and a memory. The receiving unit 51, the searching unit 52, the input / output unit 53, the parsing unit 54, etc. are all stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions.
[0142] The processor includes a kernel that retrieves the corresponding program unit from memory. One or more kernels can be provided. By adjusting kernel parameters, the fusion of search results and demand information is input into a target language model to generate configuration code, which describes the page layout, component attributes, and application logic of the intended web page. The configuration code is parsed to obtain the corresponding source code, and the page is rendered based on the source code to obtain a target web page corresponding to the intended web page.
[0143] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0144] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialized program having the following method steps: receiving user demand information for an expected web page, and inputting the demand information into a target language model to obtain N component information in the expected web page, where N is a positive integer; searching a target database based on the N component information to obtain a retrieval result, where standard component information of M components is pre-recorded in the target database, where M is an integer greater than or equal to N; inputting the fusion demand information of the retrieval result and the demand information into the target language model to obtain a configuration code, where the configuration code is used to describe the page layout, component properties and application logic of the expected web page; parsing the configuration code to obtain the corresponding source code, and rendering the page based on the source code to obtain a target web page corresponding to the expected web page.
[0145] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored computer program. When the computer program is executed, the device containing the computer-readable storage medium is controlled to execute the webpage generation method of any one of the above-mentioned embodiments.
[0146] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the web page generation method of any one of the above-mentioned embodiments.
[0147] Figure 6 FIG is a hardware structure block diagram of an electronic device (or mobile device) that executes a webpage generation method according to an embodiment of the present invention. Figure 6 As shown, the electronic device may include one or more ( Figure 6 602a, 602b, ..., 602n are used to illustrate) a processor (the processor may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices), a memory 604 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 More or fewer components than shown, or with Figure 6 Different configurations shown.
[0148] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0149] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0150] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0151] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0152] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0153] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0154] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A web page generation method, characterized in that: include: Receiving user demand information for an expected webpage, and inputting the demand information into a target language model to obtain N component information in the expected webpage, where N is a positive integer; Searching a target database based on the N component information to obtain a search result, wherein the target database pre-records standard component information of M components, where M is an integer greater than or equal to N; Inputting the fusion requirement information of the search result and the requirement information into the target language model to obtain a configuration code, wherein the configuration code is used to describe the page layout, component properties and application logic of the expected webpage; The configuration code is parsed to obtain a corresponding source code, and a page is rendered based on the source code to obtain a target web page corresponding to the expected web page.
2. The webpage generation method according to claim 1, wherein: The step of receiving user demand information for an expected webpage and inputting the demand information into a target language model to obtain N component information in the expected webpage includes: Identifying keyword information in the requirement information, wherein the keyword information is used to indicate basic component types and layout requirements of the expected webpage; generating a first model prompt word according to the keyword information and a preset standard prompt template, wherein the first model prompt word is used to describe the basic component types and layout requirements of the expected webpage to the target language model; The first model prompt word is input into the target language model, and the model outputs the N component information according to the first model prompt word.
3. The webpage generation method according to claim 1, wherein: The step of searching the target database based on the N component information to obtain a search result includes: For each piece of component information, convert the component information in natural language form into a vector representation to obtain a query vector; Searching the target database for a set of candidate vectors corresponding to the query vector, wherein the set of candidate vectors records R standard component vectors similar to the query vector, where R is a positive integer; Matching each of the standard component vectors with the query vector one by one, and taking the standard component vector with the highest matching degree as the matching vector; The standard component information corresponding to the matching vector is extracted from the target database to obtain the search result.
4. The webpage generation method according to claim 1, wherein: The step of inputting the fusion requirement information of the search result and the requirement information into the target language model to obtain the configuration code includes: When it is determined that the N pieces of standard component information recorded in the search result meet the requirement information, extracting a first model prompt word corresponding to the requirement information; Fusing the N standard component information recorded in the search results with the first model prompt words to obtain a second model prompt word; The second model prompt word is input into the target language model, and the model outputs the configuration code according to the second model prompt word.
5. The webpage generation method according to claim 1, wherein: The step of parsing the configuration code to obtain the corresponding source code includes: Reading page layout information, component attribute information of each component, and application logic information in the configuration code to obtain a reading result; Generate an application code snippet based on the read result, wherein the application code includes the following types: HTML code, CSS code, and JavaScript code; All code snippets are integrated to obtain a code document, and if the code document passes a syntax check and an integrity check, the code document is determined to be the source code.
6. The webpage generation method according to claim 5, characterized in that: The step of rendering a page based on the source code to obtain a target webpage corresponding to the expected webpage includes: Loading the source code into a web page rendering engine; Generate an initialization page frame according to the page layout information in the source code; Inserting page elements into the initialization page frame according to the component attribute information and application logic information in the source code to obtain a preview page; When the preview result indicates that both the visual effect and the interaction logic are consistent with the user's requirement information for the expected web page, the preview page is determined to be the target web page.
7. The webpage generation method according to claim 5, characterized in that: Integrate all code snippets to get code documentation, including: If the code document fails the syntax check or the integrity check, generating a third model prompt word based on the code document and a preset standard prompt template, wherein the third model prompt word is used to describe the syntax error problem or content missing problem of the code document to the target language model; The third model prompt word is input into the target language model, and the model outputs the adjusted code document according to the third model prompt word.
8. A web page generating device, characterized in that: include: a receiving unit, configured to receive user demand information for an expected web page, and input the demand information into a target language model to obtain N component information in the expected web page, where N is a positive integer; a retrieval unit, configured to search a target database based on the N component information to obtain a retrieval result, wherein the target database pre-records standard component information of M components, where M is an integer greater than or equal to N; An input unit, configured to input the fusion requirement information of the search result and the requirement information into the target language model to obtain a configuration code, wherein the configuration code is used to describe the page layout, component properties, and application logic of the expected web page; The parsing unit is configured to parse the configuration code to obtain a corresponding source code, and render a page based on the source code to obtain a target web page corresponding to the expected web page.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the webpage generation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The method comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the web page generation method according to any one of claims 1 to 7.
Citation Information
Cited By
System and method for designing user interaction interface based on large language model
CN120929081A
Multi-agent collaborative interaction method and system for user preference modeling
CN121233853A
Application generation method and device, equipment, medium and product
CN121387958A
Page layout code generation method and device, storage medium and program product
CN121478278A
UI (User Interface) code generation method, electronic equipment and storage medium
CN121879764A