Dynamic template generation method and device based on business requirements and medium

Through natural language processing technology, analyze business needs, dynamically combine template configuration information of low-code platforms, and generate dynamic business code templates, solving the problem that existing low-code platform templates cannot adapt to complex business needs, and achieving efficient development and rapid expansion.

CN120218040APending Publication Date: 2025-06-27SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510350909.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The templates in existing low-code platforms mostly use static predefined structures, and cannot be customized to modify and expand according to actual business needs, resulting in poor adaptation of business scenarios.

Method used

Through natural language processing technology, analyze the business requirements description text entered by users, determine the template configuration information, including plug-in identification, module identification and extension point logic, dynamically combine the requirements plug-in, requirement module and extension point logic, and generate dynamic business code templates.

Benefits of technology

It realizes automatic loading and combining requirements plug-ins, requirements modules and extension point logic based on user needs, and generates dynamic business code templates, greatly reducing the developer's manual coding workload, improving development efficiency, and being able to adapt to complex business scenarios and business changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120218040A_ABST
    Figure CN120218040A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a dynamic template generation method and device based on business requirements and a medium, and relates to the technical field of low code, and the method comprises the steps: obtaining a business requirement description text input by a user, analyzing the business requirement description text through a natural language processing technology, determining template configuration information corresponding to the business requirements, and generating a dynamic template according to the template configuration information; comprising plug-in identification, module identification and extension point logic; loading in a pre-constructed storage library through the plug-in identifier and the module identifier to obtain a demand plug-in and a demand module corresponding to the business demand; analyzing the extension point logic to determine an insertion position corresponding to the extension point logic; and dynamically combining the demand plug-in, the demand module and the extension point logic through a preset template rendering engine to generate a dynamic business code template corresponding to the business demand. The demand plug-in, the demand module and the extension point logic can be loaded and combined according to the user demand, the template is flexibly combined and adjusted, and the customized business demand is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of low-code technology, and in particular, to a method, device, and medium for generating dynamic templates based on business requirements. Background Art

[0002] Currently, the low-code platform's mode of quickly generating application code and components through pre-set templates has significantly reduced the development threshold and improved the construction efficiency of basic functions. However, the existing template methods have certain limitations. Especially in scenarios where business requirements change rapidly or are complex, the templates cannot flexibly adapt to different requirements.

[0003] Currently, most of the templates provided by low-code platforms are static. That is to say, the existing templates mostly adopt static predefined structures, and their functional boundaries are solidified at the initialization stage and cannot be customized and extended according to actual requirements. Especially when facing specific business requirements, they cannot dynamically load and generate code according to the actual scenarios of users. For example, in the supply chain finance scenario, it is difficult for the same template to support dynamic function switches such as letter of credit verification and real-time exchange rate calculation at the same time, and developers need to manually intervene in code modification, resulting in poor business adaptation. Therefore, the existing templates in current low-code platforms mostly adopt static predefined structures, cannot be customized and extended according to actual business requirements, and have poor adaptation to business scenarios. Summary of the Invention

[0004] One or more embodiments of this specification provide a method, device, and medium for generating dynamic templates based on business requirements to solve the following technical problems: The existing templates in current low-code platforms mostly adopt static predefined structures, cannot be customized and extended according to actual business requirements, and have poor adaptation to business scenarios. One or more embodiments of this specification adopt the following technical solutions: One or more embodiments of this specification provide a method for generating dynamic templates based on business requirements. The method includes: obtaining a business requirement description text input by a user, and parsing the business requirement description text through natural language processing technology to determine template configuration information corresponding to the business requirements, where the template configuration information includes a plugin identifier, a module identifier, and extension point logic; loading in a pre-constructed repository through the plugin identifier and the module identifier to obtain a requirement plugin and a requirement module corresponding to the business requirements; parsing the extension point logic to determine an insertion position corresponding to the extension point logic; and dynamically combining the requirement plugin, the requirement module, and the extension point logic through a preset template rendering engine to generate a dynamic business code template corresponding to the business requirements.

[0005] One or more embodiments of this specification provide a device for generating dynamic templates based on business requirements, including: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0006] A non - volatile computer storage medium provided by one or more embodiments of this specification stores computer - executable instructions, and the computer - executable instructions are configured to: execute the above method.

[0007] The above - mentioned at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: By parsing the text of the business requirement description input by the user through natural language processing technology, the template configuration information corresponding to the business requirements can be accurately determined, including plug - in identifiers, module identifiers, and extension - point logic. According to the specific business requirements of different users, the templates can be flexibly combined and adjusted to meet the customized business requirements. When facing specific business requirements, traditional static templates require developers to manually intervene in code modification, which is labor - intensive and error - prone. In the embodiments of this specification, through an automated method, the required plug - ins, required modules, and extension - point logic are automatically loaded and combined according to the user's requirements to generate a dynamic business code template, greatly reducing the manual coding workload of developers. Developers only need to provide the text of the business requirement description to automatically complete code generation, improving development efficiency. In the pre - constructed repository, various required plug - ins and required modules are stored, and these resources can be quickly loaded through plug - in identifiers and module identifiers, enabling the reuse of existing code and functions, avoiding repeated development, and further improving development efficiency. The required plug - ins, required modules, and extension - point logic are dynamically combined, and different plug - ins and modules can be flexibly matched according to business requirements to form different functional combinations, which can adapt to various complex business scenarios. Moreover, according to the development and changes of the business, plug - ins and modules can be added, deleted, or modified at any time to achieve the rapid expansion of the system. By parsing the extension - point logic and determining its insertion position, custom business logic can be dynamically inserted into the template. Users only need to input the text of the business requirement description, and through natural language processing technology, the corresponding dynamic business code template can be generated. The natural - language interaction method reduces the user's requirement for programming knowledge, enabling non - professional developers to use the low - code platform to implement their business requirements without writing complex code, thereby improving the enthusiasm and efficiency of business personnel participating in system development. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings: Figure 1 It is a schematic flowchart of a dynamic template generation method based on service requirements provided by an embodiment of this specification; Figure 2 It is a schematic structural diagram of a dynamic template generation device based on service requirements provided by an embodiment of this specification. Detailed implementation manners

[0009] To enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the drawings in the embodiments of this specification. Obviously, the described embodiments are only some embodiments of this specification, rather than all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.

[0010] An embodiment of this specification provides a dynamic template generation method based on service requirements. It should be noted that the execution subject in the embodiments of this specification can be a server or any device with data processing capabilities. Figure 1 It is a schematic flowchart of a dynamic template generation method based on service requirements provided by an embodiment of this specification. As Figure 1 shown, it mainly includes the following steps: Step S101: Obtain the service requirement description text input by the user, and parse the service requirement description text through natural language processing technology to determine the template configuration information corresponding to the service requirements.

[0011] Among them, the template configuration information includes a plug-in identifier, a module identifier, and an extension point logic; Through natural language processing technology, parse the text description of the business requirements to determine the template configuration information corresponding to the business requirements, specifically including: parse the text description of the business requirements through a pre-trained intent recognition model, extract key requirement parameters and extension point logic, where the key requirement parameters include business type, functional requirements, and performance indicators, and the extension point logic includes any one of custom code, event handling, or external API calls; construct a multi-dimensional feature vector according to the key requirement parameters to input into a predefined business scenario classification model, and map the key requirement parameters to standardized business labels; associate the standardized business labels with a pre-constructed knowledge graph to determine the template configuration information corresponding to the business requirements. Associate the standardized business labels with a pre-constructed knowledge graph to determine the template configuration information corresponding to the business requirements, specifically including: associate the standardized business labels with the knowledge graph, where the knowledge graph contains business label nodes, plugin nodes, and module nodes, and defines the dependency relationship through directed edges; match the corresponding business label nodes according to the standardized business labels to determine the plugin identifier and module identifier corresponding to the business requirements.

[0012] The process of generating template configuration information based on natural language processing (NLP) technology can automatically convert the user's requirement description into an executable template configuration, which is specifically implemented through the following steps: First, use a pre-trained intent recognition model (such as BERT or a domain-specific model) to parse the natural language text input by the user, and extract key parameters through word segmentation, entity recognition, and intent classification, including business type (such as "medical consultation"), functional requirements (such as "paged form"), and performance indicators (such as "data encryption"), and standardize fuzzy expressions, such as mapping "fast loading" to "first screen time < 2 seconds". Specifically, in the process of key parameter extraction, the business type extracts industry keywords (such as "medical consultation", "e-commerce promotion") through named entity recognition, the functional requirements extract action verbs and functional descriptions (such as "need a paged form", "integrate payment interface"), and the performance indicators identify performance constraints (such as "support for thousands of concurrent users", "response time < 1 second"). For example, when the user inputs "We need a medical consultation form that supports paging to fill in the patient's medical history and needs to pass HIPAA compliance verification.", the parsing results are as follows: the business type is medical, the functional requirements are paged form and compliance verification, and the performance indicator is data encryption (implied HIPAA requirements). In addition, clarify fuzzy expressions (such as mapping "fast loading" to "first screen time < 2 seconds") and unify terms through a preset synonym table.

[0013] Next, based on a predefined business scenario classification model, map the extracted key parameters to standardized business tags (such as "Medical - HIPAA"), and associate the corresponding plugins, modules, and extension points in the knowledge graph. The model inputs a feature vector composed of business type, functional requirements, and performance metrics. The classification outputs standardized business tags (such as Medical - HIPAA, E - commerce - High Concurrency). Decision trees or rule engines (such as Drools) can be used to match the tags, or classification models (such as SVM, Random Forest) can be trained to predict the tags. Construct an association graph between business tags and configuration items, where the nodes include business tags, plugins, modules, and extension point logics. The edges represent the dependency relationships between tags and configuration items (such as Medical - HIPAA → Encryption Storage Module, Risk Control Plugin). Different business tag - configuration item dependency relationships are defined in the knowledge graph. For example, the "Medical - HIPAA" tag will be associated with mandatory encryption plugins, paging layout modules, and compliance check extension points.

[0014] Dynamically generate template configuration information through a rule engine and intelligent recommendation algorithms. Rule - driven can load mandatory plugins from the knowledge graph according to business tags. The intelligent recommendation algorithm can recommend plugins based on collaborative filtering according to the historical selections of similar business scenarios (such as ocrMedicalRecordPlugin commonly selected by other medical users). If the user requests "low latency", then high - energy - consuming plugins are filtered out, such as disabling 3DChartPlugin. Plugin identifiers are recommended according to the mandatory rules and performance constraints of business tags. For example, high - energy - consuming plugins are filtered in high - concurrency scenarios. Module identifiers are dynamically replaced by combining core functions and scenario requirements. For example, the layout module is replaced for mobile adaptation. Extension point logics are triggered by rules or injected through user - defined scripts. For example, a compliance API is called before submission.

[0015] Finally, it is integrated into a structured JSON or YAML configuration file, which contains the complete definitions of plugins, modules, and extension point logics. During the process, plugin compatibility issues are avoided through conflict detection, and a fallback strategy is set. For example, when parsing fails, a general configuration and interpretability feedback are loaded to ensure the rationality and user controllability of the configuration. It realizes the full automation from natural - language requirements to precise template configuration, significantly reducing the configuration complexity of the low - code platform, while supporting flexible expansion and multi - scenario adaptation.

[0016] Through the above technical solution, parsing the business requirement description text through the pre-trained intent recognition model can accurately extract key requirement parameters and extension point logic, avoiding misunderstandings and omissions that may occur in manual interpretation, and improving the efficiency and accuracy of requirement parsing; constructing a multi-dimensional feature vector based on the extracted key requirement parameters and inputting it into the predefined business scenario classification model to map the key requirement parameters to standardized business labels and systematically classify complex and diverse user requirements; the pre-constructed knowledge graph contains business label nodes, plugin nodes and module nodes, and defines the dependency relationship through directed edges, forming a structured knowledge network, which can clearly show the association and dependency between different business elements; associating the standardized business labels with the knowledge graph, matching the corresponding business label nodes according to the labels, thereby determining the plugin identifier and module identifier corresponding to the business requirements, and then determining the template configuration information, realizing the intelligent mapping from user requirements to specific technical implementation elements (plugins and modules), and being able to quickly and accurately configure the corresponding template according to user requirements; by determining the plugin identifier and module identifier, different plugins and modules can be flexibly loaded and combined according to business requirements. The modular design method enables the system to have good scalability and can easily add new functions or modify existing functions without large-scale reconstruction of the entire system; the existence of the knowledge graph makes the relationship between business knowledge and technical elements clearer, facilitating the update and maintenance of knowledge. When business requirements change or new plugins and modules appear, these changes can be reflected by updating the knowledge graph to ensure that the system can always adapt to the changing business environment; mapping user requirements to standardized business labels enables different user requirements to be processed and managed in a unified manner, improving the consistency of business processing and reducing errors and problems caused by inconsistent requirement understanding.

[0017] Step S102, load in the pre-constructed repository through the plugin identifier and the module identifier to obtain the requirement plugin and requirement module corresponding to the business requirement.

[0018] In one embodiment of this specification, a plug-in interface is designed in the template. Users can load custom plug-ins through the plug-in mechanism and add corresponding plug-ins during the template generation process according to their needs. The design of the plug-ins allows for dynamic loading and unloading, ensuring the scalability and flexibility of the template. For example, if a certain business requirement needs additional chart display functions, the user only needs to install a chart plug-in, and the template engine will automatically load the plug-in and integrate it into the generated code. The template is split into multiple functional modules, and each module is responsible for a specific function. For example, a field module, a form layout module, a validation module, a permission control module, etc. Each module can be developed and tested independently, allowing developers to insert new functions or modify existing functions between different modules, greatly improving the flexibility and maintainability of the template. The modules interact through interfaces to ensure low coupling and high cohesion. In addition, extension points are reserved in the template to allow users to customize the code. For example, users can insert custom API calls, event handling logic, or custom UI components into the generated code. The extension points can be implemented by injecting configurations or writing scripts, and the template engine loads the corresponding extension point content according to the user's configuration during rendering.

[0019] Through this plug-in identifier and this module identifier, load in a pre-built repository to obtain the required plug-in and required module corresponding to this business requirement, specifically including: obtaining the plug-in library and module library in this repository; according to this plug-in identifier, load the corresponding required plug-in from this plug-in library, and this required plug-in includes at least one of predefined business logic, UI components, or function extension interfaces; according to this module identifier, load the independently developed required module from this module library, where this required module includes at least one of a field management module, a layout module, and a validation module.

[0020] In one embodiment of this specification, through the determined plug-in identifier and module identifier, load the required plug-in and required module corresponding to a specific business requirement from a pre-set repository for subsequent use of these plug-ins and modules to generate business code. The repository includes a plug-in library and a module library. The plug-in library stores various plug-ins, and the module library stores various modules. The plug-in identifier is information used to uniquely identify a certain plug-in. According to this identifier, search for and load the corresponding required plug-in from the plug-in library. The required plug-in includes at least predefined business logic, UI components, function extension interfaces, etc. The predefined business logic is the code logic for processing business processes already written in the plug-in, such as processing the generation of orders, payment processes, etc. UI components are user interface components, such as buttons, text boxes, drop-down menus, etc., and these components can be used to build the interface for users to interact with the system. The function extension interface allows external code to extend the functions of the plug-in without modifying the core code of the plug-in, such as adding new calculation functions, etc.

[0021] The module identifier is used to uniquely identify a certain module. According to this identifier, the independently developed requirement modules are loaded from the module library. The requirement modules include a field management module, a layout module, a verification module, etc. The field management module is used to manage data fields, such as adding, deleting, modifying fields, and setting the attributes of fields such as data type, length, etc. The layout module is used to manage the layout of the interface, such as setting the positions, sizes, arrangement methods, etc. of each UI component to achieve a beautiful and reasonable user interface. The verification module verifies the input data to ensure the legality and integrity of the data, such as verifying whether the format of the email address entered by the user is correct, whether the password meets the strength requirements, etc.

[0022] Through the above technical solutions, the plugin library and the module library are already stored in the pre-constructed repository. Developers do not need to write a large amount of basic function code from scratch. When a new business function needs to be implemented, if there is a requirement plugin containing the corresponding predefined business logic, it can be directly loaded from the plugin library according to the plugin identifier, reducing repetitive development work; for common function modules, such as the field management module, the layout module, etc., they can be directly loaded from the module library according to the module identifier, avoiding the repetitive development of these general modules; when the system needs to add new functions or expand existing functions, it can be achieved by loading appropriate plugins; the independently developed requirement modules can be flexibly combined and replaced according to business requirements. When the business rules change and the data verification method needs to be adjusted, a new verification module can be loaded from the module library without large-scale modification of the entire system, enabling the system to easily adapt to the changes and development of the business; the update and maintenance of plugins and modules are relatively independent. When the business logic of a certain plugin needs to be updated or a vulnerability in the module needs to be fixed, only the corresponding plugin or module needs to be operated without causing too much impact on the entire system, reducing the difficulty and cost of system maintenance; the plugins and modules in the repository can be reused in multiple projects. Different projects may have some identical or similar functional requirements. By sharing these plugins and modules, the repetitive writing of code is avoided, and the utilization rate of code and the degree of resource sharing are improved.

[0023] Step S103, parse the extension point logic to determine the insertion position corresponding to the extension point logic.

[0024] Parse the extension point logic to determine the insertion position corresponding to the extension point logic, specifically including: predefining extension anchors in the template and marking the marked positions corresponding to the extension anchors, where the types of the extension anchors include event trigger type and function injection type; parse the extension point logic to determine the corresponding extension logic type; through the extension logic type corresponding to the extension point logic, perform type matching in the extension anchor to determine the matching extension anchor, and determine the insertion position corresponding to the extension point logic based on the marked position corresponding to the matching extension anchor.

[0025] In one embodiment of the present specification, extension anchors are defined in advance in the template, and the mark position corresponding to each extension anchor is marked. Extension anchors are divided into event-triggered type and function injection type. Event-triggered type extension anchors are associated with specific events, such as events such as a user clicking a button and page loading completion. When these events are triggered, the corresponding extension logic will be executed. For example, in a web page template, when a user clicks the "Submit" button, specific extension logic is triggered to perform additional data verification. Function injection type extension anchors are used to insert additional logic into specific functional processes of the template. For example, in a data calculation step of a data processing template, custom calculation logic is injected to achieve special business needs.

[0026] Detailed analysis of the input extension point logic is performed to identify the extension logic type to which it belongs. Here, natural language processing technology or code analysis tools can be used to determine whether the extension point logic is related to event triggering or used for function injection. For example, if the extension point logic performs some additional operations after the user successfully logs in, it belongs to the event triggering type; if it adds additional encryption processing during data storage, it belongs to the function injection type.

[0027] According to the extension logic type corresponding to the extension point logic, match it in the pre-defined extension anchor points. Find the extension anchor point that matches the extension point logic type, and this anchor point is called the matching extension anchor point. Finally, the mark position corresponding to the matching extension anchor point is used as the insertion position of the extension point logic. For example, if the extension point logic is an event trigger type, and it matches the extension anchor point of the event trigger type "user clicks the save button" in the template, then the extension point logic is inserted into the mark position corresponding to this anchor point.

[0028] Through the above technical solution, by predefining the extended anchor points and marked positions, the possible insertion positions of the extended point logic are clarified. Then, by matching according to the extended logic type, the extended point logic can be accurately inserted into the appropriate position in the template, realizing the precise extension of the template function and meeting specific business requirements. When developers perform function extension, they do not need to blindly search for the insertion point in the entire template code. They only need to focus on the extended anchor points that match the extended point logic type, reducing the search and positioning time during development and improving development efficiency. Associating the extended point logic with specific positions in the template makes the structure clearer. When maintenance or modification of the extended function is required, the corresponding extended point logic and its insertion position can be quickly located, reducing the difficulty and cost of maintenance. Supporting multiple types of extended anchor points can adapt to different types of extension requirements. Whether it is an extension based on event triggering or function injection, it can be flexibly processed through the corresponding extended anchor points, facilitating the easy addition of new extended functions without changing the overall architecture, and having better flexibility and scalability.

[0029] Step S104, through a preset template rendering engine, dynamically combines the requirement plug-ins, requirement modules, and extended point logic to generate a dynamic business code template corresponding to the business requirements.

[0030] The embodiment of this specification supports the dynamic loading and rendering of plug-ins and modular components through the template rendering engine. The rendering engine can automatically adjust the structure and content of the template according to the plug-ins and modules defined in the configuration file to ensure that the generated code meets the current business requirements, so as to support the dynamic adaptation to multiple business scenarios and requirements, reducing the manual intervention of developers. In addition, the plug-ins and modules in the template can be updated according to actual business requirements to ensure that the generated code always remains the latest or most compliant with the requirements.

[0031] Through a preset template rendering engine, the requirement plugin, the requirement module, and the extension point logic are dynamically combined to generate a dynamic business code template corresponding to the business requirement, specifically including: obtaining environment parameters corresponding to the target operating environment, where the environment parameters include platform type, hardware performance metrics, network status, and security policies; through the preset template rendering engine, the requirement plugin, the requirement module, and the extension point logic are dynamically combined to generate a dynamic business code template corresponding to the business requirement. According to the environment parameters, environment-differentiated code is generated. According to the environment parameters, environment-differentiated code is generated, specifically including: according to the environment parameters, matching adaptation rules from a predefined policy library, where the adaptation rules include platform adaptation rules, performance optimization rules, and security compliance rules; parsing the template code into an abstract syntax tree, and based on the adaptation rules, performing addition, deletion, and modification operations on the nodes of the abstract syntax tree to determine the adjusted nodes after the operation; converting the adjusted nodes into executable code corresponding to the platform type, and dynamically injecting an offline fallback or caching policy according to the network status to generate environment-differentiated code.

[0032] In an embodiment of the present specification, through a preset template rendering engine, plugins, modules, and extension logics related to business requirements are dynamically combined to form a dynamic business code template, and executable code highly adapted to the specific environment is generated in combination with the parameters of the target operating environment. The dynamic code template is not the final code, but an intermediate description layer between the environment and the business logic, and needs to be converted into specific code through the rendering engine.

[0033] Using the template rendering engine to dynamically combine the requirement plugin, the requirement module, and the extension point logic, the obtained dynamic business code template includes basic template code, plugin / module slots, extension point logic, and environment policy markers. The basic template code is a predefined business logic skeleton (such as a form structure, an API call process), and the variable parts are marked by placeholders ({{}}), supporting runtime replacement. The plugin / module slots are reserved standardized interfaces, declaring plugins (such as a chart engine) and modules (such as a paging logic) that can be dynamically loaded. The slots are decoupled from the specific implementation, and the adapted version is bound according to the environment parameters during rendering, such as a lightweight chart plugin for mobile devices. The extension point logic is a user-defined business rule, embedded in the template in the form of a script or a configuration fragment, supporting runtime dynamic injection, and restricting the execution permission according to the security policy. The environment policy marker is a conditional marker associated with the policy library (such as #if low-performance device), guiding the rendering engine to generate differentiated code, and automatically enabling / disabling the marker branch according to the environment parameters (CPU, memory).

[0034] The key parameters of the target running environment can be reported through the client probe or obtained through the server-side policy distribution. They include the platform type, hardware performance, network status, and security policy. The platform type is used to identify the target running environment (Web, iOS, Android, embedded devices, etc.); the hardware performance refers to the computing power of the CPU / GPU, memory capacity, storage space, etc.; the network status includes latency, bandwidth, stability, etc.; the security policy can be data desensitization rules, permission whitelists, and compliance requirements. Match the adaptation rules according to the environmental parameters, adjust the code structure by operating on the Abstract Syntax Tree (AST), and finally generate executable code adapted to the environment.

[0035] In the policy library, the platform adaptation rules are used to define the code conversion logic for different platforms, the performance optimization rules are used to dynamically degrade functions according to the hardware performance, and the security compliance rules are used to inject encryption logic or desensitization modules according to the policy. The matching logic uses a rule engine (such as Drools) to match the environmental parameters with the policy priorities. Convert the template code into a tree structure, where each node represents a syntax unit (such as a variable, function call). The AST provides a structured code representation for precise modification. Add, delete, or modify AST nodes according to the matched rules. For example, if the performance optimization rule requires simplifying the calculation logic, complex loop nodes can be deleted or replaced with more efficient algorithms. On low-performance devices, replace complex real-time rendering algorithms with pre-computed cache strategies. The transformed and adjusted AST is the target code, and restore the modified AST to the executable code of the target platform. For example, convert the adjusted AST into Java or Swift code. Add an offline fallback or caching mechanism according to the network status. For example, when the network is unstable, inject local caching logic into the code to reduce dependence on the server; if the network is disconnected, trigger the offline mode.

[0036] Through the above technical solution, by obtaining the key parameters of the target operating environment, the dynamic template can use the platform adaptation rules to define the code conversion logic for different platforms and generate executable code highly adaptable to the specific environment. In contrast, the static template is usually fixed and difficult to adapt to multiple different operating environments. The plug-ins and module slots are reserved standardized interfaces that declare dynamically loadable plug-ins and modules. The slots are decoupled from the specific implementation and are bound to the adapted version according to the environmental parameters during rendering. When new functions need to be added, only the corresponding plug-ins or modules need to be loaded, without modifying the core code of the template. The extension point logic is embedded in the template in the form of scripts or configuration fragments, supports runtime dynamic injection, and restricts the execution permissions according to the security policy, enabling users to flexibly customize business rules according to specific business requirements. The structure and function of the static template are relatively fixed and difficult to be flexibly extended and modified. The dynamic template can automatically perform performance optimization according to environmental parameters, such as dynamically degrading functions according to hardware performance and adding offline fallback or caching mechanisms according to network status, thereby improving the performance of the system in different environments. The static template lacks the ability to automatically optimize according to the environment.

[0037] Before generating the dynamic business code template corresponding to the service requirement through dynamic combination of the requirement plug-in, the requirement module, and the extension point logic by means of a preset template rendering engine, the method further includes: parsing the requirement plug-in and the requirement module to determine the corresponding attribute information, where the attribute information includes a version identifier and an interface definition; performing version compatibility verification on the requirement plug-in and the requirement module through the version identifier, and comparing the interface definitions of the requirement plug-in and the requirement module to perform interface compatibility verification; and generating the service code corresponding to the service requirement after the version compatibility verification and the interface compatibility verification are passed.

[0038] In one embodiment of this specification, the parsing requirement plug-in and requirement module are parsed to determine attribute information, and the content of the attribute information includes a version identifier and an interface definition. The version identifier is used to clarify the specific version of the plug-in or module, and the interface definition stipulates the ways and rules for the plug-in or module to interact with other components. According to the parsed version identifier, version compatibility checks are performed on the requirement plug-in and requirement module. Different versions of plug-ins or modules may have differences in function implementation, data structure, etc. If the versions are not compatible, errors may occur during code operation. Ensure that the versions of the requirement plug-in and requirement module are compatible with each other to avoid compatibility problems caused by version mismatches and improve the stability and reliability of the code. For example, a plug-in with a new function may depend on a specific version of a module. If the versions are not compatible, the plug-in may not be able to call the functions of the module normally. Compare the interface definitions of the requirement plug-in and the requirement module to check whether they are consistent in terms of interface parameters, return values, call methods, etc. If the interfaces are not compatible, problems such as parameter passing errors and inability to find appropriate methods will occur when the plug-in calls the functions of the module, so as to ensure that the requirement plug-in and the requirement module can interact and communicate correctly. When both the version compatibility verification and the interface compatibility verification pass, it indicates that the requirement plug-in and the requirement module can cooperate with each other in terms of version and interface. Only then will subsequent dynamic composition operations be performed to generate the business code corresponding to the business requirements. The business code generated on the basis of passing the verification can avoid runtime errors caused by version and interface incompatibilities, improve the quality and development efficiency of the code, and reduce the time and cost of debugging and fixing compatibility problems.

[0039] The following is an example provided by the embodiments of this specification. Suppose a form is generated for a customer information management system, and the form contains fields such as name, phone number, and email. Users may need to use custom field validations, special layout components, and integrate external APIs in the form.

[0040] First, define a template plug-in. The template pre-defines a "field validation plug-in", a "layout plug-in", and an "API call plug-in". These plug-ins handle the validation of fields, the layout method of the form, and the call of external data respectively. In the template configuration file, users can define the required plug-ins and modules. For example, users can choose to enable the "custom date validation plug-in" and configure it on the "date" field of the form, or enable the "form paging plug-in" to display the form content step by step.

[0041] { "formName": "CustomerForm", "fields": { "name": "name", "type": "text", "validation": "required" }, { "name": "phone", "type": "text", "validation": "phone", "plugins": ["phone-validation-plugin"] }, { "name": "email", "type": "email", "validation": "email" } , "layout": "custom-pagination-layout", "plugins": ["api-integration-plugin"] } The template engine will dynamically load the corresponding plugin code according to the plugin and module information in the configuration file and embed it into the generated form code. For the "phone" field, the template engine loads the phone-validation-plugin plugin and adds validation logic to the field. For the entire form, the template engine loads and applies the custom-pagination-layout module to generate a paginated form interface.

[0042] Output the final code: The generated front-end code example is as follows: <form id="customer-form"> <label for="name">Name:< / label> <input type="text" id="name" name="name" required> <label for="phone">Phone:< / label> <input type="text" id="phone" name="phone" pattern="^[0-9]{10}$" required> <label for="email">Email:< / label> <input type="email" id="email" name="email" required> <button type="submit">Submit< / button> < / form> Through plugin-based extension and modular component design, the flexibility and scalability of the template are greatly improved. Users can customize plugins and modules according to specific needs, supporting dynamic loading and custom business logic. The content of the template is no longer fixed but can be dynamically adjusted according to business requirements, thus significantly enhancing the adaptability of the low-code platform in complex business scenarios.

[0043] Through the embodiments of this specification, by parsing the business requirement description text input by the user through natural language processing technology, the template configuration information corresponding to the business requirements can be accurately determined, including plug-in identifiers, module identifiers, and extension point logics. According to the specific business requirements of different users, the templates can be flexibly combined and adjusted to meet the customized business requirements. When facing specific business requirements, traditional static templates require developers to manually intervene in code modification, which is laborious and error-prone. Through an automated method, the embodiments of this specification automatically load and combine requirement plug-ins, requirement modules, and extension point logics according to the user's requirements to generate dynamic business code templates, greatly reducing the manual coding workload of developers. Developers only need to provide the business requirement description text to automatically complete code generation, improving development efficiency. Various requirement plug-ins and requirement modules are stored in a pre-constructed repository, and these resources can be quickly loaded through plug-in identifiers and module identifiers. Existing code and functions can be reused, avoiding repeated development and further improving development efficiency. By dynamically combining requirement plug-ins, requirement modules, and extension point logics, different plug-ins and modules can be flexibly matched according to business requirements to form different function combinations, which can adapt to various complex business scenarios. Moreover, according to the development and changes of the business, plug-ins and modules can be added, deleted, or modified at any time to achieve rapid system expansion. By parsing the extension point logic and determining its insertion position, custom business logic can be dynamically inserted into the template. Users only need to input the business requirement description text, which can be parsed through natural language processing technology to generate the corresponding dynamic business code template. The natural language interaction method reduces the user's requirements for programming knowledge, enabling non-professional developers to use the low-code platform to implement their business requirements without writing complex code, thus improving the enthusiasm and efficiency of business personnel in system development.

[0044] The embodiments of this specification also provide a dynamic template generation device based on business requirements, as Figure 2 shown. The device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0045] The embodiments of this specification also provide a non-volatile computer storage medium storing computer-executable instructions, and the computer-executable instructions are set to: execute the above method.

[0046] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of devices, equipment, and non-volatile computer storage media, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.

[0047] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0048] The devices and media provided in the embodiments of this specification correspond one-to-one with the methods. Therefore, the devices and media also have beneficial technical effects similar to those of their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be elaborated here.

[0049] Those skilled in the art should understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0050] This specification is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0051] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks specified in a block or multiple blocks.

[0052] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks specified in a block or multiple blocks.

[0053] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0054] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0055] Computer-readable media include permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0056] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising said element.

[0057] The above description is only for one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various changes and modifications can be made to one or more embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of one or more embodiments of this specification shall be included within the scope of the claims of this specification.

Claims

1. A method for generating a dynamic template based on business needs, characterized in that: The method comprises: Obtaining a business requirement description text input by a user, parsing the business requirement description text through natural language processing technology, and determining template configuration information corresponding to the business requirement, wherein the template configuration information includes a plug-in identifier, a module identifier, and an extension point logic; Loading the plug-in identifier and the module identifier in a pre-built repository to obtain the requirement plug-in and the requirement module corresponding to the business requirement; Parsing the extension point logic to determine an insertion position corresponding to the extension point logic; The requirement plug-in, the requirement module and the extension point logic are dynamically combined through a preset template rendering engine to generate a dynamic business code template corresponding to the business requirement.

2. A method for generating a dynamic template based on business needs according to claim 1, characterized in that: The business requirement description text is parsed through natural language processing technology to determine the template configuration information corresponding to the business requirement, specifically including: The business requirement description text is parsed through a pre-trained intent recognition model to extract key requirement parameters and extension point logic, wherein the key requirement parameters include business type, functional requirements and performance indicators, and the extension point logic includes any one of custom code, event processing or external API call; According to the key requirement parameters, a multi-dimensional feature vector is constructed to be input into a predefined business scenario classification model to map the key requirement parameters to standardized business labels; The standardized business tags are associated with the pre-built knowledge graph to determine the template configuration information corresponding to the business requirements.

3. A method for generating a dynamic template based on business needs according to claim 2, characterized in that: Associating the standardized business tag with the pre-built knowledge graph to determine the template configuration information corresponding to the business requirement specifically includes: Associating the standardized business label with the knowledge graph, wherein the knowledge graph includes business label nodes, plug-in nodes, and module nodes, and defines dependency relationships through directed edges; The corresponding business label node is matched according to the standardized business label to determine the plug-in identifier and the module identifier corresponding to the business requirement.

4. The method for generating a dynamic template based on business needs according to claim 1, characterized in that: By using the plug-in identifier and the module identifier, loading is performed in a pre-built repository to obtain a requirement plug-in and a requirement module corresponding to the business requirement, specifically including: Obtain the plug-in library and the module library in the repository; According to the plug-in identifier, a corresponding demand plug-in is loaded from the plug-in library, where the demand plug-in includes at least one of a predefined business logic, a UI component, or a function extension interface; According to the module identifier, an independently developed requirement module is loaded from the module library, wherein the requirement module includes at least one of a field management module, a layout module, and a verification module.

5. The method for generating a dynamic template based on business needs according to claim 1, characterized in that: Parsing the extension point logic to determine an insertion position corresponding to the extension point logic specifically includes: Predefine an extension anchor point in the template, and mark a mark position corresponding to the extension anchor point, wherein the type of the extension anchor point includes an event trigger type and a function injection type; Parsing the extension point logic to determine the corresponding extension logic type; According to the extended logic type corresponding to the extension point logic, type matching is performed in the extension anchor point to determine the matching extension anchor point, and the insertion position corresponding to the extension point logic is determined according to the mark position corresponding to the matching extension anchor point.

6. A method for generating a dynamic template based on business needs according to claim 1, characterized in that: The requirement plug-in, the requirement module and the extension point logic are dynamically combined through a preset template rendering engine to generate a dynamic business code template corresponding to the business requirement, specifically including: Obtaining environment parameters corresponding to the target operating environment, wherein the environment parameters include platform type, hardware performance indicators, network status, and security policies; The demand plug-in, the demand module and the extension point logic are dynamically combined through a preset template rendering engine to generate a dynamic business code template corresponding to the business demand, so as to generate environment differentiation code according to the environment parameters.

7. A method for generating a dynamic template based on business needs according to claim 6, characterized in that: Generate an environment differentiation code according to the environment parameters, specifically including: According to the environmental parameters, matching adaptation rules from a predefined policy library, the adaptation rules including platform adaptation rules, performance optimization rules and security compliance rules; Parsing the template code into an abstract syntax tree, performing addition, deletion and modification operations on nodes of the abstract syntax tree based on the adaptation rule, and determining the adjusted nodes after the operation; The adjustment node is converted into an executable code corresponding to the platform type, and an offline fallback or cache strategy is dynamically injected according to the network status to generate an environment differentiation code.

8. A method for generating a dynamic template based on business needs according to claim 4, characterized in that: Before dynamically combining the requirement plug-in, the requirement module and the extension point logic to generate a dynamic business code template corresponding to the business requirement through a preset template rendering engine, the method further includes: Parsing the requirement plug-in and the requirement module to determine corresponding attribute information, wherein the attribute information includes a version identifier and an interface definition; By using the version identifier, version compatibility verification is performed on the requirement plug-in and the requirement module, and interface compatibility verification is performed by comparing the interface definitions of the requirement plug-in and the requirement module; When the version compatibility verification and the interface compatibility verification are passed, a business code corresponding to the business requirement is generated.

9. A dynamic template generation device based on business needs, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 8.

10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to execute the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Front-end form generation method, product, equipment and storage medium

    CN120560655A

  • Electronic specification generation method and system based on identification analysis

    CN120633591A

  • Module linking method and device based on identifier analysis and medium

    CN120856758A

  • Code-free platform development method based on closed-loop management

    CN121680804A

  • Demand analysis report automatic generation method for aluminum electrolysis intelligent factory engineering design

    CN122366403A