Code generation method, low-code platform, equipment, medium and program product

By obtaining and parsing page description data, generating and mapping code files to multi-end framework templates, the problem that existing low-code platforms cannot generate multi-platform running code is solved, and efficient code generation and cross-platform compatibility is achieved.

CN119987762APending Publication Date: 2025-05-13ZEBRED NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411961505.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Existing low-code platforms cannot generate application code that can run on multiple platforms at the same time, resulting in reduced code generation efficiency.

Method used

By obtaining the page description data of the target page, parsing the page structure to generate a code file, and mapping the code file to multiple framework templates of the multi-end framework to generate a multi-end page code product. Different framework templates are associated with different platforms to ensure that the generated code runs consistently on each platform.

Benefits of technology

It realizes the generation of source code that can run on multiple platforms at the same time, improves the developer's reading and secondary development capabilities, and improves the code generation efficiency, and reduces compatibility problems caused by platform differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987762A_ABST
    Figure CN119987762A_ABST
Patent Text Reader

Abstract

The invention provides a code generation method, a low-code platform, equipment, a medium and a program product. Obtaining page description data of the target page, wherein the page description data of the target page is formed on the basis of configuration operation of the user on the at least one target component on the design interface; analyzing a page structure in the page description data to generate a code file of the target page; the code file is mapped into a plurality of frame templates of the multi-end frame to generate a multi-end page code product of the target page, different frame templates are associated with different platforms, and the platforms are used for running the multi-end page code product. According to the embodiment of the invention, the application codes running on a plurality of platforms can be generated at the same time, so that the code generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a code generation method, a low-code platform, a device, a medium, and a program product. Background Art

[0002] In recent years, low-code technology has maintained a rapid development trend. Low-code technology is a software development method that aims to enable developers to develop and build applications more quickly by minimizing manual coding. Currently, low-code platforms on the market can complete the production and release of applications with one click. However, current low-code platforms can produce specific types of applications, but cannot generate application code that can run on multiple platforms at the same time, which reduces the efficiency of code generation. Summary of the invention

[0003] The present disclosure provides a code generation method, a low-code platform, a device, a medium, and a program product, which can simultaneously generate code that runs on multiple platforms to improve code generation efficiency.

[0004] In a first aspect, the present disclosure provides a code generation method, which includes: obtaining page description data of a target page, the page description data of the target page being formed based on a user's configuration operation on at least one target component on a design interface; parsing a page structure in the page description data to generate a code file for the target page; mapping the code file to multiple framework templates of a multi-terminal framework to generate a multi-terminal page code product of the target page, wherein different framework templates are associated with different platforms, and the platforms are used to run the multi-terminal page code product.

[0005] In some embodiments, obtaining page description data of a target page includes: generating low-code description files of multiple candidate components based on source code of multiple candidate components, wherein the low-code description file of each candidate component includes configuration information of each candidate component; determining at least one target component from the multiple candidate components according to a user's configuration operations on the multiple candidate components on a design interface; and generating page description data according to the low-code description file of at least one target component.

[0006] In some embodiments, the method also includes: compiling the source code of multiple candidate components through a multi-end component compilation tool in a multi-end framework to generate multi-end component code products of multiple candidate components, wherein the component compilation tools of different ends are associated with different platforms, and the platform is also used to run the multi-end component code products.

[0007] In some embodiments, the page structure in the page description data is parsed to generate a code file for the target page, including: determining at least one code template based on the page attributes of the target page, different code templates are associated with different page attributes; filling in code for at least one code template based on the page description data to generate code blocks associated with different page attributes; assembling and packaging the code blocks to generate a code file.

[0008] In some embodiments, the method further includes: rendering the page description data through multiple renderers in a multi-end framework to generate a multi-end page view, wherein different renderers are associated with different platforms, and the platform is also used to display the multi-end page view.

[0009] In some embodiments, different platforms include: a system platform on which the application runs and an application platform on which the applet runs, and the system platform includes at least one of the following: a vehicle-mounted device; a mobile device; a personal computer (PC) device.

[0010] In the second aspect, the present disclosure provides a low-code platform, which includes: an acquisition module, used to acquire page description data of a target page, wherein the page description data of the target page is formed based on a user's configuration operation on at least one target component on a design interface; a parsing module, used to parse the page structure in the page description data to generate a code file for the target page; a generation module, used to map the code file to multiple framework templates of a multi-terminal framework to generate a multi-terminal page code product of the target page, wherein different framework templates are associated with different platforms, and the platforms are used to run the multi-terminal page code products.

[0011] In some embodiments, the acquisition module is also used to: generate low-code description files of multiple candidate components based on the source code of multiple candidate components, and the low-code description file of each candidate component includes configuration information of each candidate component; determine at least one target component from the multiple candidate components according to the user's configuration operations on the multiple candidate components on the design interface; and generate page description data according to the low-code description file of at least one target component.

[0012] In some embodiments, the low-code platform also includes: a compilation module, used to compile the source code of multiple candidate components through a multi-end component compilation tool in a multi-end framework to generate multi-end component code products of multiple candidate components, wherein the component compilation tools of different ends are associated with different platforms, and the platform is also used to run the multi-end component code products.

[0013] In some embodiments, the parsing module is also used to: determine at least one code template based on the page attributes of the target page, different code templates are associated with different page attributes; fill in code for at least one code template based on the page description data to generate code blocks associated with different page attributes; assemble and package the code blocks to generate a code file.

[0014] In some embodiments, the low-code platform also includes: a rendering module, used to render the page description data through multiple renderers in a multi-end framework to generate multi-end page views, wherein different renderers are associated with different platforms, and the platform is also used to display multi-end page views.

[0015] In some embodiments, different platforms include: a system platform on which the application runs and an application platform on which the mini-program runs, and the system platform includes at least one of the following: a vehicle-mounted device; a mobile device; a PC device.

[0016] In a third aspect, the present disclosure provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the above method when executing the program.

[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps in the above method when executed.

[0018] In a fifth aspect, the present disclosure provides a computer program product, comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program implements the steps in the above method when executed.

[0019] Compared with the prior art, the technical solution provided by the present disclosure has the following beneficial effects:

[0020] In the disclosed embodiment, the page description data of the target page is obtained, the page structure in the page description data is parsed to generate a code file of the target page, and then the code file is mapped to multiple framework templates in the multi-terminal framework to generate a multi-terminal page code product, that is, the disclosed embodiment can simultaneously generate source code that can run on multiple platforms, which is convenient for developers to read and perform secondary development, and improves code generation efficiency. Furthermore, since different framework templates are associated with different platforms, this can ensure that the generated multi-terminal page code products can be consistently run and displayed on each platform, reducing compatibility issues caused by platform differences.

[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0023] Figure 1 This is a schematic diagram of an implementation flow of the code generation method provided by an embodiment of the present disclosure;

[0024] Figure 2 It is a schematic diagram of generating a code product and a description file by a compilation tool provided by an embodiment of the present disclosure;

[0025] Figure 3 is another implementation flow diagram of the code generation method provided by the embodiment of the present disclosure;

[0026] Figure 4 It is a schematic diagram of the composition structure of the low-code platform provided by the embodiment of the present disclosure;

[0027] Figure 5 It is a schematic diagram of a composition structure of a system provided by an embodiment of the present disclosure;

[0028] Figure 6 It is another schematic diagram of the composition structure of the low-code platform provided in the embodiment of the present disclosure;

[0029] Figure 7 It is a hardware entity schematic diagram of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0031] Before explaining the code generation method provided by the embodiment of the present disclosure in detail, the application scenario of the embodiment of the present disclosure is first introduced.

[0032] In recent years, low-code technology has maintained a high development trend, and many low-code software or low-code platforms have emerged on the market, such as Yida, Weida, Artificial Intelligence (AI) Speed ​​​​and other low-code platforms. From the perspective of the technical link, these low-code platforms all use specific renderers to parse the description data formed based on user configuration at runtime to complete the rendering of the application, and support one-click completion of the application production and release. In this way, users can directly get a deployed and operational application, or an operational application code. Among them, Yida is a low-code enterprise application building platform that integrates three core capabilities: page design, business rule definition, and data collection and analysis, allowing users to complete the construction of business applications through simple drag and drop and configuration. Weida is a drag-and-drop low-code development platform that quickly generates applications through industry templates, drag-and-drop components, and visual configuration. As a commercial platform, AI Speed ​​​​supports visual page construction and private deployment. At the same time, combined with AI big models, it can help users quickly create some pages.

[0033] However, the applications created by the above low-code platforms can only produce specific types of applications, such as PC-side Web applications, but cannot generate multiple different types of applications at the same time. Moreover, the codes generated by the above low-code platforms can run normally, but the readability is very low for developers and is not suitable for secondary development.

[0034] Based on the above problems, an embodiment of the present disclosure provides a code generation method, which can generate source code that can run on multiple platforms, thus facilitating developers to read and perform secondary development.

[0035] Figure 1 1 is a schematic diagram of an implementation flow of the code generation method provided by the embodiment of the present disclosure. For example, the method can be executed by a computer device. Figure 1 As shown, the method includes the following steps S101 to S103.

[0036] In step S101, the page description data of the target page is obtained.

[0037] In some embodiments, the page description data of the target page is formed based on a configuration operation of the user on at least one target component on the design interface.

[0038] It can be understood that the target page is the page that the user ultimately expects to see, and the page content is composed of at least one target component configured by the user. The computer device can provide a visual design interface, and the user can perform various configuration operations on this design interface, such as dragging and dropping components, setting component properties, etc., so that the user's desired target page can be formed through the configuration operation of the component. Then the computer device records each operation of the user, such as adding a component, deleting a component, moving component settings, setting component properties, etc., to obtain configuration data, where the component properties can include component color, size, text content and other information.

[0039] In some embodiments, the computer device can capture each configuration operation of the user on the component on the design interface through an event monitoring mechanism, such as click, drag, input, etc.

[0040] In some embodiments, after obtaining the configuration data formed by the user's configuration operation, the computer device can store the configuration data through a data structure. Generally, the configuration of a component can be represented as an object, including information such as the type, properties, and location of the component. The configuration data can also be stored in a database or memory as required. If the design interface is a web application, the configuration information data can be stored through the browser's local storage (LocalStorage) or session storage (SessionStorage).

[0041] In some embodiments, after acquiring the configuration data, the computer device may serialize the configuration data into a data format that is easy to store and transmit, such as JSON. The serialized data is the page description data of the target page, which describes the status and properties of all components on the target page.

[0042] In some embodiments, the page description data may be JsonSchema data, which is a specification for describing JSON data structures, and which may define the structure, format, and constraints of JSON data objects. By defining JsonSchema data, the computer device may ensure that the received data is valid and complies with the requirements of the business logic. JsonSchema data is the source of data input for automatic code generation.

[0043] In some embodiments, the implementation process of step S101 may be: based on the source code of multiple candidate components, generate low-code description files of multiple candidate components, the low-code description file of each candidate component including the configuration information of each candidate component; according to the user's configuration operations on the multiple candidate components on the design interface, determine at least one target component from the multiple candidate components; according to the low-code description file of at least one target component, generate page description data.

[0044] It is understandable that the computer device can generate a low-code description file based on the source code of multiple candidate components, and determine the target component according to the configuration operation of the user on the design interface, and finally generate page description data. Among them, the low-code description file is used to describe the configuration information of the component. For example, the low-code description file can include information such as attribute default values, acceptable attribute value ranges, event trigger conditions, slot types, etc.

[0045] In some embodiments, the computer device may parse the source code of each candidate component and then construct a low-code description file. For example, the computer device may read the source code of each candidate component through a static code analysis tool or a custom parser, and extract key information of each candidate component, such as component name, properties, events, slots, styles, and other information. Then, based on the extracted information, a low-code description file is constructed for each candidate component. For example, the low-code description file may be a file in JSON format.

[0046] In some embodiments, the computer device may provide a user-friendly design interface and display an icon or preview of each candidate component on the design interface so that the user can select a target component from multiple candidate components. When the user selects and configures a candidate component on the design interface, the computer device records the user's configuration operation, including the component selected by the user, the set property values, the bound events, etc. Afterwards, the computer device may parse the component selected by the user and its configuration information according to the user's configuration operation, so as to obtain at least one target component.

[0047] In some embodiments, the computer device may construct a page description data structure for storing the overall layout, components and configuration information of the target page. The page description data is generated based on the low-code description file of the target component and the user's configuration information. The page description data may include the overall layout of the target page (e.g., grid system, flow layout, etc.), the type, location, attributes, event binding and other information of each target component.

[0048] In some embodiments, the computer device may also verify the generated page description data to ensure the integrity and correctness of the data. The page description data may also be optimized as needed, such as merging similar configurations, simplifying data structures, and other optimization operations.

[0049] In some embodiments, the computer device can also compile the source code of multiple candidate components through a multi-end component compilation tool in a multi-end framework to generate multi-end component code products of multiple candidate components, wherein the component compilation tools of different ends are associated with different platforms, and the platform is also used to run the multi-end component code products.

[0050] It can be understood that a multi-terminal framework is a development tool that allows developers to use the same set of code to write applications for multiple platforms. These frameworks usually provide a rich multi-terminal component library, allowing developers to build cross-platform applications more efficiently. Multi-terminal components are the core elements of these multi-terminal frameworks. They are reusable blocks of code that are used to implement specific functions or interface elements in the application. Multi-terminal components are cross-platform, that is, the same set of component codes can run on different platforms and present a consistent user interface and behavior. For example, the multi-terminal framework can be the Rax framework.

[0051] In some embodiments, the multi-terminal framework may include a multi-terminal component compilation tool, which is used to compile the source code of the components written by the developer into a multi-terminal component code product that can run on different platforms. The multi-terminal component compilation tool has the following characteristics: cross-platform support, the compilation tool can identify and handle the differences between different platforms to ensure that the generated code can run correctly on the target platform. Efficiency, the compilation tool improves the compilation speed and code quality by optimizing the compilation process, thereby shortening the development cycle. Scalability, the compilation tool supports custom compilation rules and plug-ins to meet the developer's needs for specific functions.

[0052] It can be understood that during the compilation process of multi-end components, component compilation tools at different ends are associated with different platforms. This association ensures that the generated code can be optimized and adapted for a specific platform.

[0053] In some embodiments, developers can use the language (e.g., React) and component library provided by the multi-terminal framework to write the source code of multiple candidate components, and then configure the corresponding compilation options and parameters in the compilation tool according to the requirements of each platform. Then, the multi-terminal component compilation tool compiles the source code according to the configuration to generate a multi-terminal component code product suitable for each platform. After the compilation is completed, the code products of the multi-terminal components can be generated, which can run on each platform and present a consistent user interface and behavior.

[0054] In some embodiments, different platforms include: a system platform on which an application runs and an application platform on which a mini-program runs, and the system platform includes at least one of the following: a vehicle-mounted device; a mobile device; a PC device.

[0055] It is understandable that the computer device in the disclosed embodiment ultimately generates applications and application codes for different platforms, and examples of applications may include Web, application programs (APPlication, APP) and mini-programs. Different platforms may include different hardware platforms and application platforms that provide hosts for mini-programs. Among them, hardware platforms may include vehicle-mounted devices, mobile devices, PC devices, etc. Since mini-programs need to rely on a specific host environment to run, the host environment of mini-programs refers to the application platform that provides running support for them. Taking WeChat mini-programs as an example, the application platform on which WeChat mini-programs run is the WeChat platform.

[0056] It is understandable that in-vehicle devices refer to various electronic devices installed in the vehicle, such as in-vehicle entertainment systems, navigation systems, in-vehicle interconnection systems, etc. These devices usually run specific operating systems to support the operation of various in-vehicle applications. Mobile devices may include mobile phones, tablet computers, laptops, wearable electronic devices, etc. PC devices may include desktop computers, all-in-one computers, etc.

[0057] In some embodiments, different platforms may also include different operating system platforms, such as Android system, Linux system, Windows system, Apple system, Harmony system and other operating system platforms.

[0058] Figure 2 Schematic diagram of generating code products and description files through a compilation tool provided by an embodiment of the present disclosure. Figure 2 As shown, the component source code can be compiled by a multi-terminal component compilation tool to generate a multi-terminal component code product package, wherein the multi-terminal component code product package may include, for example, a Web-end product package, a car-end APP product package, a WeChat applet product package, an Alipay applet product package, and a car-end applet product package. By way of example, the multi-terminal component compilation tool may be a Rax compilation tool. The component source code can be compiled by a low-code component compilation tool to generate a low-code description file. In this way, subsequent computer devices can generate page description data based on the low-code description file of the component and the user's configuration information.

[0059] In step S102, the page structure in the page description data is parsed to generate a code file of the target page.

[0060] It is understandable that the page description data includes information such as the structure of the page, the target components, styles and interaction logic included in the page. Therefore, the computer device can extract the key information of the page according to the page description data to design the page structure and determine the tags and attributes of each target component. Then, according to the style information in the page description data, the layout and appearance of the target page are defined. According to the interaction logic in the page description data, the dynamic behavior of the target page is implemented to ensure that the interaction logic is consistent with the page structure and style of the target page. Afterwards, the code of the page structure, page style, and interaction logic can be organized into a reasonable file structure, and a template engine or code generation tool can be used to automatically generate code files. Among them, the template engine can be exemplified by embedded JavaScript templates (Embedded JavaScript Templates, EJS) and Handlebars. The code generation tool can be exemplified by Yeoman.

[0061] In some embodiments, the computer device can design the HyperText Markup Language (HTML) structure of the page according to the page description data. The layout and appearance of the target page can be defined by Cascading Style Sheets (CSS) code according to the page description data. The dynamic behavior of the target page can be implemented by JavaScript according to the interactive logic in the page description data. Afterwards, the HTML, CSS and JavaScript codes can be organized into a reasonable file structure, that is, the basic code file of the target page is obtained.

[0062] In some embodiments, the implementation process of step S102 may be: determining at least one code template according to the page attributes of the target page, wherein different code templates are associated with different page attributes; filling in code for at least one code template according to the page description data to generate code blocks associated with different page attributes; and assembling and packaging the code blocks to generate a code file.

[0063] It is understandable that the target page includes multiple page attributes, and the computer device can determine multiple code templates based on these page attributes, and then fill these code templates according to the page description data, and finally generate the required code file. For example, the page attributes can include attributes such as the life cycle of the page and the skeleton structure of the page. The life cycle of the page can include information such as the loading order of the page, the initialization process, the timing of data acquisition and rendering, and the update logic after user interaction. The skeleton structure of the page can include information such as the overall layout of the page (for example, the header, the body, the footer), the arrangement of components, the existence of navigation and sidebars, and their styles. Based on this, the code template corresponding to the page attributes of the life cycle can be a JavaScript template, and the data acquisition, rendering and update logic can be processed through the JavaScript template. The code template corresponding to the page attributes of the skeleton structure can be an HTML template or a CSS template, and the layout and style of the page are defined by the HTML template or the CSS template.

[0064] In some embodiments, the computer device may pre-configure multiple code templates, and then parse the page description data, and fill in the placeholders in the code template associated with the life cycle according to the skeleton structure attributes in the page description data to define the layout and components of the target page, and define the appearance of the page. Then, according to the skeleton structure attributes in the page description data, the functions and event listeners in the code template associated with the skeleton structure may be filled in to process the data acquisition, rendering, and update logic of the target page. In this way, code blocks associated with different page attributes may be generated.

[0065] It is understandable that after obtaining the code blocks associated with different page attributes, the computer device can assemble the filled code blocks according to the overall structure of the page to ensure that they can work together to build a complete target page. The assembled code blocks can then be packaged into one or more optimized code files, which together constitute the complete code basis of the target page.

[0066] For example, when the code template associated with the life cycle is an HTML and CSS template, and when the code template associated with the skeleton structure is a JavaScript template, the computer device can fill in the placeholders in the HTML template according to the skeleton structure attributes in the page description data to define the layout and components of the target page. At the same time, fill in the CSS template according to the style requirements to define the appearance of the target page, so that the code block associated with the life cycle can be obtained. Afterwards, the computer device can fill in the functions and event listeners in the JavaScript template according to the skeleton structure attributes in the page description data to process the data acquisition, rendering and update logic of the target page, so that the code block associated with the skeleton structure can be obtained. Afterwards, the computer device can assemble and package the filled HTML, CSS and JavaScript code blocks according to the overall structure of the page to generate a code file.

[0067] In step S103, the code file is mapped to multiple framework templates of the multi-terminal framework to generate a multi-terminal page code product of the target page.

[0068] In some embodiments, different framework templates are associated with different platforms, and the platforms are used to run multi-terminal page code products.

[0069] It is understandable that the multi-end framework can support multiple front-end technology stacks (such as React, Vue, Angular, etc.) or multiple platforms (such as Web, mobile applications, applets, etc.). These frameworks usually provide a unified set of interfaces or tools, allowing developers to use the same code logic or component library to build pages for different platforms. Framework templates are a set of predefined code structures in the multi-end framework, which provide developers with the basis for building pages. Different framework templates correspond to different technology stacks or platforms. For example, a React framework template may contain React-specific components and lifecycle methods, while a Vue framework template contains Vue-specific instructions and components. Code file mapping is to convert the original code file (such as React components, Vue components, native JavaScript code, etc.) into code suitable for different framework templates. After mapping and converting the code file through multiple framework templates in the multi-end framework, page code suitable for different platforms can be generated. These code products can be directly deployed to the corresponding platform for operation without additional modification.

[0070] In some embodiments, after obtaining the code file, the computer device can input the code file into a pre-prepared multi-terminal framework. Since the multi-terminal framework includes different framework templates, the code file can be converted into a code product corresponding to each platform through different framework templates in the multi-terminal framework, so that a multi-terminal page code product can be obtained. The multi-terminal page code product formed in this way can be read by developers and can be used for secondary development by developers.

[0071] In some embodiments, the computer device may also render the page description data through multiple renderers in a multi-end framework to generate a multi-end page view, wherein different renderers are associated with different platforms, and the platform is also used to display the multi-end page view.

[0072] It is understandable that the embodiments of the present disclosure may allow developers to use the same page description data to generate page views suitable for different platforms through different renderers. The multi-terminal framework provides interfaces, component libraries, and renderers for building and rendering multi-terminal pages or multi-terminal applications. The renderer is used to convert page description data into a visual page view. Different renderers correspond to different platforms and technology stacks. For example, a Web renderer is used to render page description data into a Web page. A mobile application renderer is used to render page description data into a native mobile application page. A mini program renderer is used to render page description data into pages for platforms such as WeChat mini programs and Alipay mini programs.

[0073] In some embodiments, the computer device can parse the page description data through a renderer to extract the structure, style and interaction logic of the target page. Then, based on the parsed page description data, the renderer can build a virtual document object model (DOM), which is a tree-like data structure representing the page structure. The renderer can then convert the virtual DOM into a visual page view.

[0074] In some embodiments, when the multi-terminal framework is the Rax framework, the Rax framework supports a set of codes, multi-terminal operation and rendering, and the UI rendering effects of different terminals are consistent. The Rax renderer is based on the Rax framework and uses the Web terminal as the operating environment, supporting real-time rendering and real-time update capabilities in the low-code development process.

[0075] Figure 3 FIG. 1 is another implementation flow diagram of the code generation method provided by the embodiment of the present disclosure. Figure 3 As shown, the method includes the following steps S301 to S310.

[0076] In step S301, page description data is obtained.

[0077] It is understandable that the page description data is formed based on the configuration operation of at least one target component by the user on the design interface. The page description data may include information such as the structure of the page, the target components included in the page, the style and interaction logic.

[0078] In step S302 , the page description data is inserted into the slot code generator in the module generator 10 .

[0079] It can be understood that the slot code generator can be a code template, and these code templates are filled according to the page attributes in the page description data, such as filling the page's life cycle, skeleton structure and other attributes into the corresponding code templates.

[0080] In step S303, code blocks are assembled.

[0081] It can be understood that when the page description data is inserted into the slot code generator, multiple code blocks can be obtained, so the multiple code blocks can be assembled.

[0082] In some embodiments, step S303 may not be performed.

[0083] In step S304, a code block is generated.

[0084] In step S305, a module file is generated.

[0085] It can be understood that after obtaining the code block, the computer device can generate a module file based on the code block.

[0086] In step S306, the module file is inserted into the Rax framework slot.

[0087] In step S307, a dynamic file is generated.

[0088] As can be understood, the module file is inserted into the Rax framework slot and a dynamic file is generated based on the slot mechanism.

[0089] In step S308, for static content, the Rax framework static template is used to render the component into a string.

[0090] In step S309, a static file is generated.

[0091] It can be understood that after obtaining the string, the string can be saved as a static file.

[0092] In step S310, a project file tree is generated.

[0093] It can be understood that multi-terminal code products are generated based on dynamic files and static files.

[0094] In the disclosed embodiment, the page description data of the target page is obtained, the page structure in the page description data is parsed to generate a code file of the target page, and then the code file is mapped to multiple framework templates in the multi-terminal framework to generate a multi-terminal page code product, that is, the disclosed embodiment can simultaneously generate source code that can run on multiple platforms, which is convenient for developers to read and perform secondary development, and improves code generation efficiency. Furthermore, since different framework templates are associated with different platforms, this can ensure that the generated multi-terminal page code products can be consistently run and displayed on each platform, reducing compatibility issues caused by platform differences.

[0095] All the above optional technical solutions can be combined in any way to form optional embodiments of the present disclosure, and the embodiments of the present disclosure will not be described in detail one by one.

[0096] The present disclosure also provides a low-code platform. Figure 4 Schematic diagram of the composition structure of the low-code platform provided by the embodiment of the present disclosure. Figure 4 As shown, the low-code platform is based on the low-code engine and develops applications in a visual way. The low-code platform may include: an input module 401, an arrangement module 402, a rendering module 403, and a code output module 404.

[0097] The input module 401 is used to generate a low-code description file. It can be understood that materials (also known as components) are the basis of low-code development. Inputting materials means describing the materials in accordance with the "Low-code Material Protocol Specification", generating description files and registering them to the low-code engine for users to use. The layout module 402 is used to generate page description data. It can be understood that the layout is the user's layout, combination, and logical arrangement of materials in the editor, and finally saves them as page description data that complies with the "Low-code Construction Protocol Specification". In essence, the layout process is to continuously generate and update page description data through visual operations. The rendering module 403 is used to render the page description data and generate a page view. It can be understood that rendering generally acts on two stages, the application development stage and the application operation stage. The application development stage is a low-code WYSIWYG development experience, which performs view rendering in the editor in real time and updates the view in real time according to the user's modifications. In the application operation stage, the page description data is also parsed through rendering technology to complete the rendering of the view. The code generation module 404 is used to convert the page description data into application code through code generation technology.

[0098] In some embodiments, the input module 401 is also used to compile the source code of the component into a multi-terminal component code product through a multi-terminal component compilation tool in the multi-terminal framework.

[0099] In some embodiments, the rendering module 403 is further used to render the page description data through a multi-end renderer in a multi-end framework. The multi-end renderer may be, for example, a Rax renderer, which is based on the Rax framework and uses the Web end as the operating environment to support real-time rendering and real-time update capabilities in the low-code development process.

[0100] The present disclosure also provides a system, Figure 5 Schematic diagram of a system structure provided by an embodiment of the present disclosure. Figure 5 As shown, the system combines Rax cross-end technology and low-code engine, with customized materials, renderers, and Rax coding solutions as entry points to form a platform that can develop applications through low-code visual operations. The developed application code products support secondary development and maintenance, and support delivery to a variety of different platforms.

[0101] In some embodiments, the system includes a low-code protocol stack, underlying dependencies, a low-code ecosystem, application products, and multiple delivery platforms. Among them, the low-code protocol stack may include low-code material protocol specifications, low-code asset package protocol specifications, and low-code construction protocol specifications. The underlying dependencies may include a low-code engine and a Rax multi-terminal framework. The low-code ecosystem may include a Rax multi-terminal component system, a Rax renderer, plug-ins and setters, etc., as well as a Rax code output solution. Application products may include Web, applets, and APPs. Multiple platforms may include mobile terminals, PC terminals, and car terminals.

[0102] In some embodiments, the low-code ecosystem is expanded through the low-code engine and the Rax framework, and then the coding and editing into multiple application products are carried out through the Rax coding solution, and the multiple application products are delivered to multiple platforms.

[0103] The disclosed embodiment refers to the Alibaba low-code engine and follows the Alibaba low-code data protocol, so that the data saved by the user is JsonSchema data that complies with the protocol standard. Afterwards, through code generation technology, a combination of application framework templates and JsonSchema data parsing is adopted to generate application code with high readability. Furthermore, the disclosed embodiment combines low-code technology with multi-terminal framework technology and multi-terminal component technology, so that the generated code can run on multiple terminals and be delivered to different terminals such as car computers, mobile phones, PCs, and mini-programs.

[0104] Figure 6 is another schematic diagram of the composition structure of the low-code platform provided by the embodiment of the present disclosure. Figure 6 As shown, the low-code platform 600 includes: an acquisition module 601, a parsing module 602 and a generation module 603, wherein:

[0105] An acquisition module 601 is used to acquire page description data of a target page, where the page description data of the target page is formed based on a user's configuration operation on at least one target component on a design interface; a parsing module 602 is used to parse the page structure in the page description data to generate a code file for the target page; a generation module 603 is used to map the code file to a plurality of framework templates in a multi-terminal framework to generate a multi-terminal page code product for the target page, wherein different framework templates are associated with different platforms, and the platforms are used to run the multi-terminal page code product.

[0106] In some embodiments, the acquisition module 601 is also used to: generate low-code description files of multiple candidate components based on the source code of multiple candidate components, the low-code description file of each candidate component including the configuration information of each candidate component; determine at least one target component from the multiple candidate components according to the user's configuration operations on the multiple candidate components on the design interface; and generate page description data according to the low-code description file of at least one target component.

[0107] In some embodiments, the low-code platform also includes: a compilation module, used to compile the source code of multiple candidate components through a multi-end component compilation tool in a multi-end framework to generate multi-end component code products of multiple candidate components, wherein the component compilation tools of different ends are associated with different platforms, and the platform is also used to run the multi-end component code products.

[0108] In some embodiments, the parsing module 602 is also used to: determine at least one code template based on the page attributes of the target page, and different code templates are associated with different page attributes; fill in the at least one code template with code based on the page description data to generate code blocks associated with different page attributes; assemble and package the code blocks to generate a code file.

[0109] In some embodiments, the low-code platform also includes: a rendering module, used to render the page description data through multiple renderers in a multi-end framework to generate multi-end page views, wherein different renderers are associated with different platforms, and the platform is also used to display multi-end page views.

[0110] In some embodiments, different platforms include: a system platform on which the application runs and an application platform on which the mini-program runs, and the system platform includes at least one of the following: a vehicle-mounted device; a mobile device; a PC device.

[0111] The description of the above low-code platform embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the low-code platform provided in the embodiment of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the low-code platform embodiment of the present disclosure, please refer to the description of the method embodiment of the present disclosure for understanding.

[0112] It should be noted that in the embodiments of the present disclosure, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present disclosure is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiments of the present disclosure are not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.

[0113] Figure 7 Schematic diagram of a hardware entity of a computer device provided in an embodiment of the present disclosure. For example, the computer device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0114] Reference Figure 7 , the computer device 700 may include one or more of the following components: a processing component 701 , a memory 702 , a power component 703 , a multimedia component 704 , an audio component 705 , an input / output (I / O) interface 706 , a sensor component 707 , and a communication component 708 .

[0115] The processing component 701 generally controls the overall operation of the computer device 700, such as operations associated with at least one of display, phone calls, data communications, camera operations, and recording operations. The processing component 701 may include one or more processors 709 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 701 may include one or more modules to facilitate the interaction between the processing component 701 and other components. For example, the processing component 701 may include a multimedia module to facilitate the interaction between the multimedia component 704 and the processing component 701.

[0116] The memory 702 is configured to store various types of data to support operations on the computer device 700. Examples of such data include at least one of the following: instructions for any application or method operating on the computer device 700, contact data, phone book data, messages, pictures, and videos. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0117] The power supply component 703 provides power to various components of the computer device 700. The power supply component 703 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the computer device 700.

[0118] The multimedia component 704 includes a screen that provides an output interface between the computer device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 704 includes a front camera and / or a rear camera. When the computer device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0119] The audio component 705 is configured to output and / or input audio signals. For example, the audio component 705 includes a microphone (MIC), and when the computer device 700 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 702 or sent via the communication component 708. In some embodiments, the audio component 705 also includes a speaker for outputting audio signals.

[0120] I / O interface 706 provides an interface between processing component 701 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0121] The sensor assembly 707 includes one or more sensors for providing various aspects of status assessment for the computer device 700. For example, the sensor assembly 707 can detect the on / off state of the computer device 700, the relative positioning of components, such as the display and keypad of the computer device 700, and the sensor assembly 707 can also detect the position change of the computer device 700 or a component in the computer device 700, the presence or absence of user contact with the computer device 700, the orientation or acceleration / deceleration of the computer device 700, and the temperature change of the computer device 700. The sensor assembly 707 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 707 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 707 may also include, but is not limited to, at least one of the following: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.

[0122] The communication component 708 is configured to facilitate wired or wireless communication between the computer device 700 and other devices. The computer device 700 can access a wireless network based on a communication standard, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 708 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 708 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, UWB technology, Bluetooth (BT) technology and other technologies.

[0123] In an exemplary embodiment, the computer device 700 may be implemented by one or more application specific integrated circuits (ASIC), DSP, DSPD, programmable logic device (PLD), FPGA, controller, microcontroller, microprocessor or other electronic components.

[0124] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 702 including executable instructions or a computer program that can be executed by a processor 709 of a computer device 700 to perform the above method.

[0125] An embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0126] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.

[0127] An embodiment of the present disclosure provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0128] The present disclosure provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0129] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product disclosed in the present invention, please refer to the description of the method embodiment disclosed in the present invention for understanding.

[0130] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present disclosure, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution. The execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The serial numbers of the embodiments of the present disclosure are for description only and do not represent the advantages and disadvantages of the embodiments.

[0131] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0132] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0133] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected based on actual needs to achieve the purpose of the present embodiment.

[0134] In addition, all functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0135] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

[0136] Alternatively, if the above-mentioned integrated unit of the present disclosure is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0137] The above description is only an implementation mode of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure.

Claims

1. A code generation method, characterized in that: The method comprises: Acquire page description data of a target page, wherein the page description data of the target page is formed based on a configuration operation of at least one target component by a user on a design interface; Parsing the page structure in the page description data to generate a code file of the target page; The code file is mapped to multiple framework templates of a multi-terminal framework to generate a multi-terminal page code product of the target page, wherein different framework templates are associated with different platforms, and the platforms are used to run the multi-terminal page code product.

2. The method according to claim 1, characterized in that The step of obtaining the page description data of the target page includes: Based on the source codes of the plurality of candidate components, low-code description files of the plurality of candidate components are generated, wherein the low-code description file of each candidate component includes configuration information of each candidate component; Determining at least one target component from the multiple candidate components according to the configuration operation of the user on the design interface on the multiple candidate components; The page description data is generated according to a low-code description file of at least one target component.

3. The method according to claim 2, characterized in that The method further comprises: The source codes of the multiple candidate components are compiled by the multi-end component compilation tool in the multi-end framework to generate multi-end component code products of the multiple candidate components, wherein the component compilation tools of different ends are associated with different platforms, and the platforms are also used to run the multi-end component code products.

4. The method according to claim 1, characterized in that: The parsing of the page structure in the page description data to generate the code file of the target page includes: Determining at least one code template according to the page attributes of the target page, where different code templates are associated with different page attributes; Filling the at least one code template with code according to the page description data to generate code blocks associated with different page attributes; The code blocks are assembled and packaged to generate the code file.

5. The method according to claim 1, characterized in that The method further comprises: The page description data is rendered by multiple renderers in the multi-terminal framework to generate a multi-terminal page view, wherein different renderers are associated with different platforms, and the platform is also used to display the multi-terminal page view.

6. The method according to claim 1, characterized in that The different platforms include: a system platform for application operation and an application platform for applet operation, and the system platform includes at least one of the following: an in-vehicle device; a mobile device; a personal computer (PC) device.

7. A low-code platform, characterized in that: The low-code platform includes: An acquisition module, used to acquire page description data of a target page, wherein the page description data of the target page is formed based on a configuration operation of at least one target component by a user on a design interface; A parsing module, used for parsing the page structure in the page description data to generate a code file of the target page; A generation module is used to map the code file to multiple framework templates of a multi-terminal framework to generate a multi-terminal page code product of the target page, wherein different framework templates are associated with different platforms, and the platform is used to run the multi-terminal page code product.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instruction is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.