Low-code operation method and device, equipment and medium

By generating abstract syntax tree parsing of page layout metadata and full business logic code, the problem of handling complex business logic on low-code platforms is solved, achieving efficient code writing and execution.

CN121742841APending Publication Date: 2026-03-27太保科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing low-code development platforms cannot effectively handle complex business logic such as recursive algorithms and asynchronous concurrency, forcing developers to abandon low-code platforms and revert to manual code writing, which reduces development efficiency.

Method used

Generate page layout metadata, write all business logic code, and add function code segments to the corresponding UI component nodes in the layout metadata through abstract syntax tree parsing and preset naming rules. The corresponding function code segments are loaded and executed when the page runs.

Benefits of technology

It allows complex business logic to be written on low-code platforms, improving code writing and execution efficiency while maintaining the high-efficiency building advantages of low-code platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121742841A_ABST
    Figure CN121742841A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a low-code operation method and device, equipment and a medium, and relates to the technical field of software development. The method comprises the following steps: generating layout metadata of a page; compiling full business logic codes of the page; carrying out abstract syntax tree analysis on the full business logic code, determining a function code segment corresponding to the UI component according to a preset naming rule, and adding the function code segment to a node corresponding to the UI component in the layout metadata; and when the page runs, loading the layout metadata and the total business logic code, and in response to an event executed on the UI component, determining and executing a function code segment corresponding to the UI component from a node corresponding to the UI component. Therefore, according to the low-code operation method provided by the invention, the complex business logic is allowed to be written by using full-amount business logic codes, so that the advantage of efficient construction of a low-code platform can be kept in the face of the complex business logic, and the code writing and operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software development, and in particular to a low-code running method and device, equipment and medium. BACKGROUND

[0002] A low-code development platform (LCDP) is gradually becoming a core tool for building enterprise-level applications. The core principle of the LCDP is to replace the traditional manual code writing with visual configuration of the user interface (UI) structure, thereby reducing the development threshold and cost of enterprise-level applications and improving development efficiency.

[0003] However, many complex business logic, such as recursive algorithms and asynchronous concurrency, cannot be implemented through visual configuration, which leads to the abandonment of the LCDP and the return to manual code writing when facing complex business logic, thereby violating the original intention of the LCDP high-efficiency building advantage and reducing the efficiency of code writing and running. SUMMARY

[0004] Based on the above problems, the present application provides a low-code running method, device, equipment and medium, which can improve the efficiency of code writing and running.

[0005] The present application discloses the following technical solutions:

[0006] In a first aspect, the present application discloses a low-code running method, which comprises:

[0007] Generating layout metadata of a page; the layout metadata is used to describe the user interface (UI) structure of the page and indicate a UI component with a unique identifier;

[0008] Writing full business logic code of the page;

[0009] Performing abstract syntax tree analysis on the full business logic code, determining a function code segment corresponding to the UI component according to a preset naming rule, and adding the function code segment to the layout metadata under a node corresponding to the UI component;

[0010] When the page runs, loading the layout metadata and the full business logic code, and determining and executing the function code segment corresponding to the UI component from the node corresponding to the UI component in response to an event performed on the UI component.

[0011] Optionally, the method further comprises:

[0012] When the unique identifier of the UI component in the layout metadata is modified, a name of a function code segment corresponding to the UI component in the full-service-logic code is updated according to the modified unique identifier and the preset naming rule.

[0013] Optionally, the determining, according to the preset naming rule, of the function code segment corresponding to the UI component comprises:

[0014] The function code segment including the unique identifier of the UI component is determined as the function code segment corresponding to the UI component.

[0015] Optionally, the method further comprises:

[0016] The function code segment that does not conform to the preset naming rule is determined as a page-level common code.

[0017] The page-level common code is added under a page root node of the layout metadata.

[0018] Optionally, when the page is running, the full-service-logic code is loaded in a JavaScript sandbox to run.

[0019] In a second aspect, the present application discloses a low-code running device, which comprises a data generation module, a code writing module, a code adding module, and a code execution module.

[0020] The data generation module is configured to generate layout metadata of a page, wherein the layout metadata is used to describe a user interface (UI) structure of the page and indicate a UI component with a unique identifier.

[0021] The code writing module is configured to write full-service-logic code of the page.

[0022] The code adding module is configured to perform abstract syntax tree analysis on the full-service-logic code, determine a function code segment corresponding to the UI component according to a preset naming rule, and add the function code segment to the layout metadata under a node corresponding to the UI component.

[0023] The code execution module is configured to load the layout metadata and the full-service-logic code when the page is running, and determine and execute the function code segment corresponding to the UI component from the node corresponding to the UI component in response to an event performed on the UI component.

[0024] Optionally, the device further comprises a name updating module.

[0025] The name update module is used to update the name of the function code segment corresponding to the UI component in the full business logic code according to the modified unique identifier and the preset naming rules when the unique identifier of the UI component in the layout metadata is modified.

[0026] Optionally, the code addition module is specifically used to: determine the function code segment including the unique identifier of the UI component as the function code segment corresponding to the UI component.

[0027] Optionally, the code adding module is further configured to: determine that function code segments that do not conform to the preset naming rules are page-level common code; and add the page-level common code under the page root node of the layout metadata.

[0028] Optionally, when the page is running, the full business logic code is loaded and run in a JavaScript sandbox.

[0029] Thirdly, this application discloses a low-code operating device, the device comprising: a memory and a processor;

[0030] The memory is used to store programs;

[0031] The processor is configured to execute the program, implementing the steps of the low-code execution method as described in the first aspect.

[0032] Fourthly, this application discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the low-code execution method as described in the first aspect.

[0033] Compared with the prior art, this application has the following beneficial effects:

[0034] This application discloses a low-code execution method, apparatus, device, and medium. The method includes: generating layout metadata for a page; the layout metadata describes the user interface (UI) structure of the page and indicates UI components with unique identifiers; writing all business logic code for the page; performing abstract syntax tree parsing on the all-business logic code, determining the function code segments corresponding to the UI components according to preset naming rules, and adding the function code segments to the layout metadata under the node corresponding to the UI component; when the page runs, loading the layout metadata and all-business logic code, and in response to events executed on the UI components, determining and executing the function code segments corresponding to the UI components from the node corresponding to the UI components. Therefore, the low-code execution method provided by this application allows the use of all-business logic code to write complex business logic such as recursive algorithms and asynchronous concurrency, thus maintaining the high-efficiency construction advantages of low-code platforms even when facing complex business logic, and improving the efficiency of code writing and execution. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 A flowchart illustrating a low-code execution method provided in this application embodiment;

[0037] Figure 2 A schematic diagram of a low-code operating device provided in an embodiment of this application;

[0038] Figure 3 This is a schematic diagram of a computer-readable medium provided in an embodiment of this application. Detailed Implementation

[0039] As described earlier, many complex business logics, such as recursive algorithms and asynchronous concurrency, cannot be implemented through visual configuration. This forces developers to abandon LCDP and revert to manual code writing when faced with complex business logic, thus violating the original intention of LCDP's efficient construction advantages and reducing the efficiency of code writing and running.

[0040] The inventors have disclosed a low-code execution method, apparatus, device, and medium. The method includes: generating layout metadata for a page; the layout metadata describing the page's user interface (UI) structure and indicating uniquely identified UI components; writing all business logic code for the page; parsing the full business logic code using an abstract syntax tree, determining the function code segments corresponding to the UI components according to preset naming rules, and adding these function code segments to the layout metadata under the corresponding node of the UI component; when the page runs, loading the layout metadata and the full business logic code, and responding to events executed on the UI components, determining and executing the function code segments corresponding to the UI components from the corresponding nodes. Therefore, the low-code execution method provided by this application allows the use of full business logic code to write complex business logic such as recursive algorithms and asynchronous concurrency, thus maintaining the high-efficiency construction advantages of a low-code platform even when facing complex business logic, and improving the efficiency of code writing and execution.

[0041] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0042] See Figure 1 This figure is a flowchart of a low-code execution method provided in an embodiment of this application. The method includes:

[0043] S101: Generate layout metadata for the page; layout metadata describes the user interface (UI) structure of the page and indicates UI components with unique identifiers.

[0044] Layout metadata refers to data that describes the UI structure of a page, without containing specific business logic or implementation code. For example, layout metadata includes: the tree structure between UI components (i.e., nested relationships, such as a form container containing input boxes and buttons) and the properties of UI components. The properties of UI components include: the unique identifier of the UI component, its type (e.g., button, table, input box), its position (e.g., coordinates, size, alignment), and its style (e.g., color, font, border, spacing).

[0045] Specifically, after product managers, operations personnel, and other non-technical staff open the visual layout editor, they can drag and drop the required UI components from the pre-built component library and adjust the position and style of the UI components through the property panel. The visual layout editor can then convert these operations into layout metadata. For example, the layout metadata is usually in JSON Schema format.

[0046] Understandably, the S101 step allows non-technical personnel to design pages without writing code, thus lowering the barrier to entry for UI development.

[0047] S102: Write all the business logic code for the page.

[0048] Full business logic code refers to the collection of native code that implements all business functions of a page. Business behaviors can include event handling behaviors (such as multi-level validation when submitting a form, or a chain reaction of multiple components triggered by a button click), complex calculation behaviors (such as multi-dimensional data analysis and calculation, or algorithm-intensive operations), asynchronous interaction behaviors (such as communication with backend / third-party services, or asynchronous task scheduling), and style enhancement behaviors (such as complex animations and transition effects, or fine-grained control over theme switching).

[0049] Specifically, after opening the full-featured code editor, developers can write corresponding JavaScript (or TypeScript) and CSS code files for the page, which serve as the page's full business logic code.

[0050] Understandably, through step S102, all business logic code is no longer limited to the visual layout editor, completely breaking the "capability ceiling" limitation of traditional low-code platforms that rely on the "visual configuration box" for business logic, allowing developers to write native code to deal with complex business logic.

[0051] S103: Perform abstract syntax tree parsing on all business logic code, determine the function code segment corresponding to the UI component according to the preset naming rules, and add the function code segment to the layout metadata under the node corresponding to the UI component.

[0052] First, the bidirectional synchronization engine performs Abstract Syntax Tree (AST) parsing on the full business logic code of step S102, thereby converting the linear full business logic code into a tree-like, machine-understandable structured data representation.

[0053] Subsequently, based on preset naming rules, the AST parsing results are classified using regular expression matching algorithms or string inclusion judgment algorithms:

[0054] In one specific implementation, if a function code segment includes a unique identifier for a UI component, then that function code segment is determined to be the function code segment corresponding to that UI component (component-level logic). For example, if a button component with the ID btn_submit is defined in the layout metadata, then the functions named onClick_btn_submit and onMouseEnter_btn_submit are the function code segments corresponding to that UI component, respectively indicating the "click" and "mouse entry" event handling logic for the button.

[0055] In another specific implementation, if a function code segment does not contain any unique identifier for a UI component, then that function code segment is determined to be page-level common code (e.g., utility functions, public utility classes, page state variables, constant definitions, initialization logic of third-party libraries, etc.). For example, functions named formatDate, validateForm, and apiClient are identified as page-level common code because they do not contain any unique identifier for a UI component.

[0056] Finally, based on the code's classification results, the code is reorganized and written into the layout metadata:

[0057] In one specific implementation, if the code's classification result is component-level logic, the function code segment is added to the node corresponding to the UI component in the layout metadata. For example, the `onClick_btn_submit` function is extracted and written back to the corresponding attribute (e.g., `eventHandlers.click`) under the node corresponding to the component with the ID `btn_submit` in the layout metadata. Thus, each UI component's metadata node not only includes its position and style attributes but also stores all the business logic code snippets that interact with it.

[0058] In another specific implementation, if the code is categorized as page-level common code, then after aggregating all the page-level common code, it is stored as a whole under an independent attribute field (e.g., globalLogic) of the page root node in the layout metadata. This allows for centralized management of page-level common logic, avoiding scattered storage.

[0059] It's worth noting that when the unique identifier of a UI component in the layout metadata is modified (e.g., changing `btn_submit` to `btn_confirm`), the name of the function code segment corresponding to the UI component in all business logic code can be updated based on the modified unique identifier and preset naming rules (e.g., renaming `onClick_btn_submit` to `onClick_btn_confirm`). This solves the pain point of R&D collaboration where code becomes invalid due to UI component adjustments.

[0060] Understandably, step S103 allows the business logic indicated by the function code segment to be "pre-associated" with the layout metadata. This provides crucial data preparation for the subsequent bidirectional synchronization engine to quickly and accurately match and execute the business logic indicated by the function code segment during page runtime. Furthermore, the association between the business logic indicated by the function code segment and the UI components relies entirely on a pre-defined, clear naming convention (i.e., pre-defined naming rules). This greatly reduces configuration workload, eliminates human configuration errors, and makes the association relationship immediately clear at the code level.

[0061] S104: When the page runs, load the layout metadata and all business logic code, and respond to events executed on the UI components, determine and execute the function code segment corresponding to the UI component from the node corresponding to the UI component.

[0062] When the page runs, the lightweight runtime engine embedded in the page loads both the layout metadata and the full business logic code.

[0063] Once resources are loaded, the runtime engine first creates a secure JavaScript sandbox and executes all business logic code within it. Understandably, the runtime engine injects a specific context object (e.g., `this.refs`) into the sandbox. During subsequent rendering, this context object will be dynamically populated with reference mappings to various UI component instances, allowing developers to directly access and manipulate the corresponding UI components in their code using `this.refs.[component ID]`.

[0064] After performing the above initialization, the runtime engine parses the layout metadata and leverages the rendering capabilities of modern front-end frameworks (such as Vue or React) to convert the layout metadata into a browser-understandable Virtual DOM. This Virtual DOM is then efficiently rendered into the actual page DOM tree, presenting a complete user interface. Furthermore, when rendering each UI component (e.g., btn_submit), the runtime engine automatically searches the sandbox for the corresponding function code segment (e.g., onClick_btn_submit) based on preset naming rules. If found, in response to an event executed on the UI component (e.g., a click event), the runtime engine identifies and executes the function code segment corresponding to the UI component from its corresponding node.

[0065] It's important to note that if the runtime engine detects changes to the full business logic code file while the page is running, it will re-inject the modified full business logic code file into the sandbox, overwriting the original one. Subsequent user-triggered events (such as clicking a button) will execute the latest logic. This process does not require refreshing the entire page, ensuring the full business logic code file takes effect immediately.

[0066] It should also be noted that if the runtime engine detects changes to the layout metadata while the page is running, it will re-parse the metadata nodes involved in the changes and, through a virtual DOM comparison algorithm, only perform partial updates and re-renders on the affected UI components on the page. The rest of the page remains unchanged, and the user experience is not affected.

[0067] In summary, this application discloses a low-code execution method. The low-code execution method provided by this application allows the use of full business logic code to write complex business logic such as recursive algorithms and asynchronous concurrency, thereby maintaining the high-efficiency construction advantage of the low-code platform when facing complex business logic, and improving the efficiency of code writing and execution.

[0068] See Figure 2The figure is a schematic diagram of a low-code execution device provided in an embodiment of this application. The low-code execution device 200 includes: a data generation module 201, a code writing module 202, a code adding module 203, and a code execution module 204.

[0069] The data generation module 201 is used to generate layout metadata for the page; the layout metadata describes the user interface (UI) structure of the page and indicates the UI components with unique identifiers.

[0070] Module 202, for writing all business logic code for the page;

[0071] The code addition module 203 is used to perform abstract syntax tree parsing on all business logic code, determine the function code segment corresponding to the UI component according to the preset naming rules, and add the function code segment to the layout metadata under the node corresponding to the UI component;

[0072] The code execution module 204 is used to load layout metadata and full business logic code when the page is running, and in response to events executed on UI components, determine and execute the function code segment corresponding to the UI component from the node corresponding to the UI component.

[0073] In one specific implementation, the low-code runtime device 200 further includes: a name update module;

[0074] The name update module is used to update the name of the function code segment corresponding to the UI component in all business logic code when the unique identifier of the UI component in the layout metadata is modified, based on the modified unique identifier and the preset naming rules.

[0075] In one specific implementation, the code addition module 203 is specifically used to: determine the function code segment containing the unique identifier of the UI component as the function code segment corresponding to the UI component.

[0076] In one specific implementation, the code addition module 203 is also used to: determine that function code segments that do not conform to the preset naming rules are page-level common code; and add the page-level common code under the page root node of the layout metadata.

[0077] In one specific implementation, when the page runs, all business logic code is loaded and executed in a JavaScript sandbox.

[0078] In summary, this application discloses a low-code execution device. The low-code execution device provided by this application allows the use of full business logic code to write complex business logic such as recursive algorithms and asynchronous concurrency, thereby maintaining the high-efficiency construction advantage of the low-code platform when facing complex business logic, and improving the efficiency of code writing and running.

[0079] This application also provides corresponding low-code execution devices and computer-readable media for implementing the low-code execution method provided in this application.

[0080] The low-code running device includes a memory and a processor. The memory stores instructions or code, and the processor executes the instructions or code to enable the device to perform the aforementioned tasks. Figure 1 The steps of the low-code running method.

[0081] See Figure 3 This figure is a schematic diagram of a computer-readable medium provided in an embodiment of this application. The computer-readable medium 300 stores a computer program 311, which, when executed by a processor, implements the above-described... Figure 1 The steps of the low-code running method.

[0082] It should be noted that, in the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0083] It should be noted that the machine-readable medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0084] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0085] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

[0086] While several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0087] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A low-code execution method, characterized in that, The method includes: Generate layout metadata for the page; the layout metadata is used to describe the user interface (UI) structure of the page and to indicate UI components with unique identifiers; Write all the business logic code for the page; The entire business logic code is parsed using an abstract syntax tree. Based on a preset naming rule, the function code segment corresponding to the UI component is determined and added to the layout metadata under the node corresponding to the UI component. When the page is running, the layout metadata and the full business logic code are loaded, and in response to events executed on the UI component, the function code segment corresponding to the UI component is determined and executed from the node corresponding to the UI component.

2. The method according to claim 1, characterized in that, The method further includes: When the unique identifier of the UI component in the layout metadata is modified, the name of the function code segment corresponding to the UI component in the full business logic code is updated according to the modified unique identifier and the preset naming rules.

3. The method according to claim 1, characterized in that, The step of determining the function code segment corresponding to the UI component according to the preset naming rules includes: The function code segment containing the unique identifier of the UI component is identified as the function code segment corresponding to the UI component.

4. The method according to claim 1, characterized in that, The method further includes: Function code segments that do not conform to the preset naming rules are identified as page-level public code; Add the page-level common code under the page root node of the layout metadata.

5. The method according to claim 1, characterized in that, When the page is running, all the business logic code is loaded and executed in a JavaScript sandbox.

6. A low-code operating device, characterized in that, The device includes: a data generation module, a code writing module, a code adding module, and a code execution module; The data generation module is used to generate layout metadata for the page; the layout metadata is used to describe the user interface (UI) structure of the page and to indicate UI components with unique identifiers. The code writing module is used to write all the business logic code for the page; The code addition module is used to perform abstract syntax tree parsing on the full business logic code, determine the function code segment corresponding to the UI component according to the preset naming rules, and add the function code segment to the layout metadata under the node corresponding to the UI component; The code execution module is used to load the layout metadata and the full business logic code when the page is running, and in response to the event executed on the UI component, determine and execute the function code segment corresponding to the UI component from the node corresponding to the UI component.

7. The apparatus according to claim 6, characterized in that, The device further includes: a name update module; The name update module is used to update the name of the function code segment corresponding to the UI component in the full business logic code according to the modified unique identifier and the preset naming rules when the unique identifier of the UI component in the layout metadata is modified.

8. The apparatus according to claim 6, characterized in that, The code addition module is specifically used to: determine the function code segment containing the unique identifier of the UI component as the function code segment corresponding to the UI component.

9. A low-code operating device, characterized in that, The device includes: a memory and a processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the low-code running method as described in any one of claims 1 to 5.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the low-code running method as described in any one of claims 1 to 5.