Code adding method, device, electronic device and computer readable storage medium

By converting the structured data of the low-code platform into native code and expanding, the problem of limited functions of the low-code platform components is solved, flexible expansion of components and diverse needs are achieved, and the ease of use of the development platform is improved. and flexibility.

CN112416351BActive Publication Date: 2024-11-26GUANGZHOU HUYA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011331967.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-24
Publication Date
2024-11-26
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

The component functions of the low-code development platform are limited and cannot meet the diverse needs of users, resulting in high development costs and low reusability, and users cannot customize component code to implement specific functions.

Method used

Through a predefined standard structure, structured data is converted into native code and expanded, and then the extended code is converted into structured data and stored in a custom module to realize the functions of low-code platform components. Expand.

Benefits of technology

Improves the ease of use and flexibility of low-code platforms, enables users to achieve diversified functions according to their needs, reduces development costs, and allows for flexible removal of extended code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112416351B_ABST
    Figure CN112416351B_ABST
Patent Text Reader

Abstract

The present application provides a code adding method, which includes: based on a predefined standard structure, converting the first structured data into corresponding first standard structured data; wherein the first standard structure is defined according to the data types contained in at least one application framework, and at least includes a data source data module, a view data module and a custom module, which are used to store the data source data, view data and extended native code in the structured data respectively; based on the application framework corresponding to the first structured data, converting the first standard structured data into a first native code; expanding the first native code to obtain a second native code; based on the standard structure, converting the second native code into a corresponding second standard structured data; according to the target application framework, converting the second standard structured data into a corresponding second structured data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication and computer technology, and in particular to a code adding method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the continuous development of computer science, many low-code platforms have emerged to improve the efficiency of application development and reduce development costs. Using the components packaged by the low-code platform, users can create web pages and mobile applications through a graphical user interface and use drag-and-drop components to achieve visual low-code or even zero-code development.

[0003] However, since user needs are often uncertain, and users cannot add customized code to the components packaged by the low-code platform, when users have special needs beyond the component functions, developers are required to redevelop the entire component. Since the redeveloped components are developed based on the specific needs of users, they have finer granularity and have disadvantages such as high development cost and low reusability. Summary of the invention

[0004] To overcome the problems existing in the related art, the present application provides a code adding method, device, electronic device and computer-readable storage medium.

[0005] According to a first aspect of an embodiment of the present application, a code conversion method is provided, the method being used to add code to a component of a low-code development platform, the component being composed of first structured data, the method comprising:

[0006] Based on a predefined standard structure, the first structured data is converted into corresponding first standard structured data; wherein the standard structure is defined according to the data types contained in at least one application framework, and at least includes a data source data module, a view data module and a custom module, which are used to respectively store the data source data, view data and extended native code in the structured data; based on the application framework corresponding to the first structured data, the first standard structured data is converted into a first native code; the first native code is expanded to obtain a second native code; based on the standard structure, the second native code is converted into corresponding second standard structured data; according to the target application framework, the second standard structured data is converted into corresponding second structured data.

[0007] According to a second aspect of an embodiment of the present application, there is provided a code adding device, the device being used to add code to a component of a low-code development platform, the component being composed of first structured data, the device comprising: a first conversion module, a second conversion module, an original code extension module, a third conversion module, and a fourth conversion module;

[0008] A first conversion module is used to convert the first structured data into corresponding first standard structured data based on a predefined standard structure; wherein the first standard structure is defined according to the data type contained in the application framework, and at least includes a data source data module, a view data module and a custom module, which are used to respectively store the data source data, view data and extended native code in the structured data; a second conversion module is used to convert the first standard structured data into a first native code based on the application framework corresponding to the first structured data; a native code extension module is used to extend the first native code to obtain a second native code; a third conversion module is used to convert the second native code into corresponding second standard structured data based on the standard structure; a fourth conversion module is used to convert the second standard structured data into corresponding second structured data according to the target application framework.

[0009] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of the first aspect of the embodiment of the present application when executing the computer program.

[0010] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method of the first aspect of the embodiment of the present application is implemented.

[0011] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0012] In the embodiments of the present application, the visually edited structured data and native code can be decoupled through a predefined standard structure, and the conversion between the visually edited structured data and the native code can be realized. After converting the structured data into native code, the user can expand the original code according to the needs, and convert the expanded native code into the visually edited structured data, which can realize the functions that the existing components in the low-code platform cannot realize, and the extended code made by the user according to the needs is stored in the custom module and can be removed when it is not needed. Through the above method, the usability and flexibility of the low-code platform can be improved at the same time to meet the diverse needs of users.

[0013] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 It is a flowchart of a code adding method shown in the present application according to an exemplary embodiment.

[0016] Figure 2 It is a structural diagram of standard structure data shown in the present application according to an exemplary embodiment.

[0017] Figure 3 It is a structural diagram of another type of standard structure data shown in the present application according to an exemplary embodiment.

[0018] Figure 4A This application is a schematic diagram showing binding data source data on a low-code development platform according to an exemplary embodiment.

[0019] Figure 4B This application is a schematic diagram showing binding view data in a low-code development platform according to an exemplary embodiment.

[0020] Figure 4C This application is a schematic diagram showing a method for binding data in a low-code development platform according to an exemplary embodiment.

[0021] Figure 5 This application shows a schematic diagram of a visual editing panel for application development based on the Vue framework on a low-code development platform according to an exemplary embodiment.

[0022] Figure 6 It is a structural block diagram of a code adding device shown in the present application according to an exemplary embodiment.

[0023] Figure 7 It is a structural block diagram of an electronic device for adding code according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0024] 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 implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0025] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0026] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0027] With the rapid development of computer science, the demand for applications is increasing, and the pressure on developers is also increasing. If you develop applications in the traditional way, you need to write a lot of code, the development cycle is long, and the cost is high.

[0028] In order to reduce the amount of manual coding and speed up application development, low-code development platforms (LCDP) came into being. Low-code development platforms are development platforms that can quickly generate applications without coding or with a small amount of code, and can provide developers with packaged components consisting of structured data. Since low-code development platforms provide developers with a graphical user interface, developers with different experience levels can create web pages and mobile applications simply by using visual operations such as drag-and-drop components and model-driven logic, which greatly reduces the coding requirements for developers and has a certain ease of use.

[0029] Although the componentization of low-code development platforms has a certain ease of use, the difficulty in building low-code platforms lies in how to balance ease of use and flexibility. During the process of visual editing by developers, if the entire low-code development platform is fully componentized, then when developers are developing applications for some conventional functions, they only need to drag components and model-driven logic to develop applications. However, since the low-code development platform is fully componentized and its functions are limited, the upper limit of the functions that can be achieved by the application developed by the developer depends entirely on the functions that can be achieved by the encapsulated components themselves, and functions outside the components cannot be achieved.

[0030] However, the reality is that users’ needs are diverse, especially in today’s increasingly competitive product environment. Users may need to implement applications with their own characteristics while also hoping to reduce the cost and cycle of code development. When using a low-code development platform to achieve the above needs, there are two solutions: one is to wait for the low-code platform to produce components that meet the needs, and the other is for developers to redevelop the entire component. The first method has obvious disadvantages. The time it takes for the platform to produce components that meet the needs is uncertain, and the cost of customizing components to the platform is very high. For the second method, the redeveloped components are developed based on the specific needs of users, so they have finer granularity, and have disadvantages such as high development cost and low reusability.

[0031] In response to the defects of the above-mentioned related technologies, in order to simultaneously improve the usability and flexibility of the low-code platform, the present application proposes a code adding method, which is used to add user-defined code to the components of the low-code development platform to meet the user's diverse application development needs.

[0032] Next, the embodiments of the present application are described in detail.

[0033] like Figure 1 As shown, Figure 1 The present application is a flowchart of a method for adding code according to an exemplary embodiment, wherein the method is used to add code to a component of a low-code development platform, wherein the component is composed of first structured data, and the method comprises the following steps:

[0034] In step 102, based on a predefined standard structure, first structured data constituting a low-code development platform component is converted into corresponding first standard structure data.

[0035] In step 104, based on the application framework corresponding to the first structured data of the low-code development platform component, the first standard structure data converted in step 102 is converted into a first native code.

[0036] In step 106, the converted first native code is expanded to obtain a second native code.

[0037] In step 108, based on a predefined standard structure, the second native code is converted into corresponding second standard structure data.

[0038] In step 110, the second standard structure data converted in step 108 is converted into corresponding second structured data according to the target application framework.

[0039] The first standard structure data is data conforming to the standard structure generated according to a predefined standard structure. The predefined standard structure is defined according to the data type contained in at least one application framework. The application framework may include a Web-side framework, such as a framework based on data-driven pages such as Vue, React, Angular, etc., and may also include various mini-program frameworks, etc.

[0040] The low-code development platform provides users with a visual editing panel to enable them to develop programs. The application framework used is a data-driven view mode. Taking the Vue framework as an example, Vue is a framework based on the MVVM (Model-View-ViewModel, data-driven view) mode. The data part (Model) and the view (View) part of the MVVM framework communicate through Viewmodel to bind the relationship between data and view, thereby driving changes in the view. In vue.js, when the data changes, the user view changes accordingly.

[0041] In some embodiments, the predefined standard structure is defined according to the data type contained in at least one application framework. Based on the characteristics of the application framework "data-driven view", the predefined standard structure includes at least a data source data module and a view data module, which are used to respectively store the data source data and view data in the structured data constituting the component. In addition, according to the purpose of the invention of the present invention, that is, the user adds custom code to the component, and the custom code can be flexibly removed after adding, so the predefined standard structure also includes at least a custom module for storing the native code extended by the user. Figure 2 As shown, a schematic diagram of a predefined standard structure is given.

[0042] In some embodiments, the standard structure includes not only a data source data module, a view data module and a custom module, but also a style data module and a method data module, as shown in the schematic diagram. Figure 3 The style data module is used to store the style data in the structured data constituting the component, and the method module is used to store the method data in the structured data constituting the component.

[0043] For example, when a user wants to implement a data table function based on the Vue framework with the help of a low-code development platform, he can implement common data table functions by visually editing and adding table components (i.e., view data) on the low-code platform, and then binding data source data, style data, and method data. Figure 4A , 4BAs shown in Figures 4 and 4C, specific schematic diagrams of using visual editing to bind data source data, style data, and method data in a low-code development platform are given when a user wants to implement the function of a data table. Figure 4A The data source data bound in is local data. Figure 4B The style data bound in sets the width, height, inner and outer margins of the table. Figure 4C The method data bound in defines the data generated by a specific function. In this application scenario, the data types contained in the Vue framework include data source data, view data, style data, and method data. Therefore, the pre-defined standard structure should include a data source data module, a view data module, a style data module, and a method data module. In addition, in order to implement the code addition to the component, an additional custom module is required to store the added native code. Therefore, the pre-defined standard structure should be as follows Figure 3 shown.

[0044] Those skilled in the art should understand that in addition to the specific Web frameworks (such as Vue, React, Angular, etc.) and mini-program frameworks listed above, the application framework can also be other frameworks based on data-driven views (MVVM), and this application does not impose any restrictions on this.

[0045] In some embodiments, the predefined standard structure can be defined according to the data types included in various application frameworks, thereby covering all data types included in various application frameworks. The standard structure can also include other data modules, each data module is used to store a type of data in the application framework.

[0046] Optionally, other types of data in the application framework may also be stored in custom modules in the predefined standard structure.

[0047] Through the above embodiments, it can be seen that according to the data types contained in at least one application framework, a standard structure is predefined, and different types of data in the structured data can be extracted, and then the first structured data can be converted into the first native data. Since the standard structure is defined based on multiple application frameworks, it can ensure the subsequent generation of native code for diversified frameworks, further improving the flexibility of the low-code development platform.

[0048] In some embodiments, the first structured data is split into a plurality of sub-data sets according to data types, each sub-data set corresponds to a module in the predefined standard structure, thereby obtaining the first standard structure data corresponding to the first structured data.

[0049] For the first structured data, a traversal method can be adopted to extract data from the first structured data. The extracted data is classified according to a predefined standard structure, so that multiple sub-data sets can be obtained, each of which corresponds to a module in the predefined standard structure. When the standard structure is defined as Figure 3 The structure shown can obtain the data source sub-dataset, view sub-dataset, style sub-dataset, and method sub-dataset respectively after data splitting, and store them in the data source data module, view data module, style data module, and method data module of the standard structure respectively.

[0050] Of course, those skilled in the art should understand that in addition to the above-mentioned method of splitting the first structured data by data type to obtain the first standard structured data corresponding to the first structured data, the first structured data can also be parsed with the help of a code analysis tool to obtain the first standard structured data corresponding to it. In addition, it can also be a code module additionally written by the developer to realize the conversion of the first structured data constituting the component into the first standard structured data, and the present application does not impose any restrictions on this.

[0051] By adopting the data splitting method to generate the first standard structure data, the first standard structure data extracts the data type of at least one application framework, which can serve as a bridge for the conversion of structured data and native code, realize the decoupling of structured data and native code, and thus lay the foundation for the high scalability of the low-code platform.

[0052] In some embodiments, after converting the first structured data into the first standard structured data, a corresponding syntax format can be generated according to the application framework corresponding to the first structured data, and the sub-data sets obtained in the above embodiments can be traversed and filled in the syntax format to convert the first standard structured data into the first native code.

[0053] Since the standard structure is defined in advance according to the data type of at least one application framework, the standard structure can abstract the structured data constituting the component, covering various data types in the structured data. In addition, by splitting the data types contained in the first structured data, the data in the first structured data can be modularly stored according to the data type. Based on this preprocessing, the grammatical format corresponding to the framework can be generated according to the framework corresponding to the first structured data itself, and then the data modularly stored according to the data type can be traversed, and the traversed data is filled into the corresponding position of the grammatical format to generate the first native code of the corresponding framework.

[0054] Next, combine Figure 5 Give exemplary descriptions. Figure 5It is a visual editing panel for application development based on the Vue framework through a low-code development platform. The Vue framework includes view data, data source data, method data, and style data. When users develop applications based on this visual editing panel, they can design a data table by simply dragging components on the panel or entering a string in the input box on the panel. The designed data table is as follows: Figure 5 However, since the components of the low-code development platform are encapsulated, users cannot expand their functions. When users want to personalize the data table, this cannot be achieved. In the embodiments of the present application, it can be based on Figure 3 The predefined standard structure shown converts the first structured data into first standard structured data by data splitting, wherein part of the view data of the first standard structured data is as follows:

[0055]

[0056]

[0057] Other data in the first standard structure data, such as data source data, view data, and method data, are not shown here.

[0058] Then, according to the Vue framework corresponding to the component itself, a grammatical format corresponding to the framework is generated, the first standard structure data is traversed, and the first native code of the corresponding framework is generated. A part of the generated first native code is as follows:

[0059]

[0060] Of course, those skilled in the art should understand that in addition to the above-mentioned method of generating the corresponding syntax format according to the application framework, traversing the data, and converting the first standard structure data into the first native code, the developer can also pre-write a plug-in for the corresponding framework and use the plug-in to quickly generate the first native code corresponding to the first standard structure data. In addition, the first native code can also be generated by pre-writing a configuration file, and this application does not limit this.

[0061] Through the above embodiment, with the help of the predefined standard structure, the first structured data can be converted into the first standard structured data, and then converted into the first native code, so that the user can customize the additional code to provide an implementable interface for the expansion of component functions.

[0062] In some embodiments, after the user expands the native code converted from the first structured data to obtain the second native code, the second native code can also be parsed into an abstract syntax tree through code analysis, and the second standard structure data corresponding to the second native code can be extracted based on the parsed abstract syntax tree (AST).

[0063] After converting the first structured data into the first standard structured data, and then converting the first standard structured data into the corresponding first native code according to the application framework corresponding to the component, the developer can use the traditional code development method to add code to the native code to achieve specific needs. Still taking the implementation of the function of a data table on a low-code development platform as an example, after obtaining the native code, the developer can add additional table attributes through coding, such as personalized border style. The native code with additional table attributes added is the second native code. For the second native code, the second native code can be parsed into an abstract syntax tree through code analysis tools, such as babel plug-ins. According to the abstract syntax tree, combined with the framework of the target application, data extraction is performed on the second native code to obtain the second standard structured data corresponding to the second native code.

[0064] The predefined standard structure includes a custom module that can be used to store code data with new functions added by users. In other words, the native code with additional functions that users extend on the native code will be extracted and stored in the custom module of the standard structure, and the custom code segment will be fully saved with corresponding location marks.

[0065] Taking the above-mentioned adding code to the data table to personalize the border style as an example, the custom module in the second standard structure data can be as follows:

[0066]

[0067] Of course, in addition to adding code data with new functions to the first native code obtained by converting the first structured data, operations such as adding, modifying and deleting data of original functions contained in the first native code can also be performed. For example, style data can be added to the first native code:

[0068]

[0069] The above operations on the data of the original function contained in the first native code are equivalent to the operations on the visual editing panel. When the user operates the data of the original function contained in the first native code and adds code with new functions to the first native code, after obtaining the second native code, in the process of converting the second native code into the second standard structure data, the operation on the data of the original function causes the data of the data source data module, style module, method module and view module of the standard structure to change accordingly, and the added code with new functions will be stored in the predefined module of the standard structure.

[0070] Those skilled in the art should understand that, in addition to the above-mentioned code analysis to parse the second native code into an abstract syntax tree, and extract the second standard structure data corresponding to the second native code based on the parsed abstract syntax tree, the developer may also design a plug-in that can implement the conversion function or write a corresponding configuration file to convert the second native code into the corresponding second standard structure data, and the present application does not impose any specific restrictions on this.

[0071] In some embodiments, for the second standard structure data converted according to the second native code, a corresponding syntax format can be generated according to the target application framework, and a traversal method is adopted to extract corresponding data from the second standard structure data obtained by the conversion and fill it into the generated syntax format, thereby obtaining the second structured data corresponding to the target application framework.

[0072] According to the predefined standard structure, the second native code obtained after the expansion can be converted into the second standard structure data. According to the target application framework, the corresponding syntax format is generated. The target application framework can be the same as the application framework of the initial structured data constituting the component, or it can be different. For example, the application framework of the initial structured data constituting the component is the Vue framework, and the target application framework can be the React framework, the Angular framework, and a variety of small program frameworks, etc. As long as the predefined standard structure includes all data types of these frameworks, the change of the application framework can be achieved. After the corresponding syntax format is generated according to the target application framework, since the data constituting the application has been stored according to the data type in the second standard structure data, the second structured data corresponding to the target application framework can be obtained by traversing the corresponding data from the second standard structure data and filling it into the generated syntax format.

[0073] Similarly, those skilled in the art should understand that in addition to generating the corresponding syntax format according to the target application framework, extracting data from the second standard structure data in a traversal manner, and converting the second standard structure data into the corresponding second structured data, the second standard structure data can also be converted into the corresponding second structured data by writing a plug-in or configuration file, and the present application does not impose any restrictions on this.

[0074] Through the above-mentioned embodiments, the first structured data can be converted into the first native code, the user can perform code expansion on the native code to obtain the second native code, and the second native code can be converted into the second standard structured data, and then converted into the corresponding second structured data to form a component with custom functions for users to perform visual editing. It can be used for UI editing by non-professional front-end users, and due to the existence of the code conversion mechanism, professional front-end users can also write complex logic on the low-code development platform to realize customized functions. When the pre-defined standard structure covers a variety of application framework data types, it can be realized to generate various framework code products on the low-code platform. It can be seen that the embodiments of the present application can simultaneously improve the ease of use and flexibility of the low-code development platform.

[0075] The above is a code adding method provided in an embodiment of the present application. Based on the same idea, the present application also provides a corresponding device, an electronic device and a computer-readable storage medium.

[0076] Figure 6 A schematic diagram of the structure of a code adding device provided in an embodiment of the present application, wherein the device is used to add code to a component of a low-code development platform, wherein the component is composed of first structured data, and the device includes:

[0077] A first conversion module 602, configured to convert the first structured data into corresponding first standard structured data based on a predefined standard structure; wherein the first standard structure is defined according to a data type included in at least one application framework, and includes at least a data source data module, a view data module, and a custom module, configured to respectively store the data source data, the view data, and the extended native code in the structured data;

[0078] A second conversion module 604 is configured to convert the first standard structure data into a first native code based on an application framework corresponding to the first structured data;

[0079] An expansion module 606, configured to expand the first native code to obtain a second native code;

[0080] A third conversion module 608, configured to convert the second native code into corresponding second standard structure data based on the standard structure;

[0081] The fourth conversion module 610 is used to convert the second standard structure data into corresponding second structured data according to the target application framework.

[0082] In some embodiments, the predefined standard structure can be defined according to the data types included in various application frameworks, thereby covering all data types included in various application frameworks. The standard structure can also include other data modules, each data module is used to store a type of data in the application framework.

[0083] Optionally, other types of data in the application framework may also be stored in custom modules in the predefined standard structure.

[0084] Through the above embodiments, it can be seen that by pre-defining a standard structure according to the data type contained in at least one application framework, it is possible to extract data from components composed of structured data, and then convert structured data into native data. When the standard structure is defined based on multiple application frameworks, it can ensure the subsequent generation of native code for diversified frameworks, further improving the flexibility of the low-code development platform.

[0085] In some embodiments, the first conversion module further includes a data splitting module and a first conversion submodule. The data splitting module is used to split the first structured data constituting the component into a plurality of sub-data sets according to data types, each sub-data set corresponding to a module in the predefined standard structure. The first conversion submodule is used to obtain the first standard structure data corresponding to the first structured data according to the data set.

[0086] In some embodiments, the second conversion module further includes a first syntax format generation module and a first traversal module. The first syntax format generation module is used to generate a corresponding syntax format according to the application framework corresponding to the first structured data. The first traversal module is used to traverse each module of the standard structure data obtained in the above embodiment and convert the first standard structure data into the first native code.

[0087] In some embodiments, the third conversion module includes a code parsing module and a code extraction module. The code parsing module is used to parse the second native code obtained after the first native code is expanded into an abstract syntax tree through code analysis. The code extraction module is used to extract the second standard structure data corresponding to the second native code obtained after the expansion according to the parsed abstract syntax tree.

[0088] In some embodiments, the fourth conversion module includes a second syntax format generation module and a second traversal module. The second syntax format generation module is used to generate a corresponding syntax format according to the target application framework. The second traversal module is used to extract corresponding data from the second standard structure data obtained by the conversion by traversal, and then obtain the second structured data corresponding to the target application framework.

[0089] The specific implementation methods of the above-mentioned devices correspond to the various method embodiments described above and will not be repeated here.

[0090] Through the above-mentioned embodiments, the first structured data can be converted into the first native code, and the user can perform code expansion on the first native code to obtain the second native code. The expanded second native code can be converted into the second standard structured data, and then converted into the corresponding second structured data to form a component with customized functions for users to perform visual editing. It can be used for UI editing by non-professional front-end users, and due to the existence of the code conversion mechanism, professional front-end users can also write complex logic on the low-code development platform to realize customized functions. When the pre-defined standard structure covers a variety of application framework data types, it can generate products of various framework codes on the low-code platform. It can be seen that the embodiments of the present application can simultaneously improve the ease of use and flexibility of the low-code development platform.

[0091] Corresponding to the above-mentioned method embodiments, the present application also provides an embodiment of an electronic device. The electronic device may be a server or a terminal device, etc.

[0092] See also Figure 7 , is a hardware structure diagram of an electronic device embodiment of the present application, and the electronic device may include a memory 701 and a processor 702. The memory 701 may be an internal storage unit of the electronic device, such as a hard disk or memory of the device. The memory 701 may also be an external storage device of the device, such as a plug-in hard disk equipped on the device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 701 may also include both an internal storage unit of the device and an external storage device. The memory is used to store the computer program and other programs and data required by the device. The memory can also be used to temporarily store data that has been output or is to be output. When the program stored in the memory is executed, the processor 702 calls the program stored in the memory 701 to execute the methods of the aforementioned embodiments, which have been described in detail in the previous text and will not be repeated here.

[0093] Of course, those skilled in the art should understand that, generally, other hardware may be included according to the actual functions of the electronic device, such as a network interface, etc., which will not be described in detail in this application.

[0094] In an embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all embodiments of the above method of the present application are implemented, which will not be described in detail here.

[0095] The computer-readable storage medium may be an internal storage unit of the device described in any of the foregoing embodiments, such as a hard disk or memory of the device. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0096] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0097] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0098] Those skilled in the art will readily appreciate other embodiments of the present application after considering the application and practicing the inventions claimed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not claimed in the present application. The application and embodiments are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0099] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

[0100] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A code adding method, characterized in that: The method is used to add code to a component of a low-code development platform, wherein the component is composed of first structured data, and the method includes: Based on a predefined standard structure, converting the first structured data into corresponding first standard structured data; the standard structure is defined according to a data type included in at least one application framework, and at least includes a data source data module, a view data module, and a custom module, which are used to store the data source data, view data, and extended native code in the structured data, respectively; Based on the application framework corresponding to the first structured data, converting the first standard structured data into a first native code; Expanding the first native code to obtain a second native code; Based on the standard structure, converting the second native code into corresponding second standard structure data; According to the target application framework, the second standard structure data is converted into corresponding second structured data.

2. The method according to claim 1, characterized in that The standard structure also includes a style data module and a method data module; The style data module is used to store the style data in the first structured data; The method data module is used to store the method data in the first structured data.

3. The method according to claim 1, characterized in that The converting the first structured data into corresponding first standard structured data includes: The first structured data is divided into a plurality of sub-data sets according to data types, and each sub-data set corresponds to a module in the standard structure.

4. The method according to claim 3, characterized in that The converting the first standard structure data into a first native code comprises: According to the application framework corresponding to the first structured data, a corresponding grammatical format is generated, the sub-data sets are traversed and the grammatical format is filled in, and the first standard structured data is converted into a first native code.

5. The method according to claim 1, characterized in that Converting the second native code into corresponding second standard structure data includes: Parsing the second native code into an abstract syntax tree through code analysis; The second standard structure data corresponding to the second native code is extracted according to the parsed abstract syntax tree.

6. The method according to claim 1, characterized in that The converting the second standard structure data into corresponding second structured data includes: According to the target application framework, a corresponding grammatical format is generated, and corresponding data is extracted from the second standardized structure data in a traversal manner and filled into the generated grammatical format to obtain second structured data corresponding to the target application framework.

7. A code adding device, characterized in that: The device is used to add code to a component of a low-code development platform, the component being composed of first structured data, the device comprising: a first conversion module, a second conversion module, an original code extension module, a third conversion module, and a fourth conversion module; A first conversion module, configured to convert the first structured data into corresponding first standard structured data based on a predefined standard structure; wherein the first standard structure is defined according to a data type included in at least one application framework, and includes at least a data source data module, a view data module, and a custom module, configured to respectively store the data source data, the view data, and the extended native code in the structured data; A second conversion module, configured to convert the first standard structure data into a first native code based on an application framework corresponding to the first structured data; A native code extension module, used for extending the first native code to obtain a second native code; A third conversion module, configured to convert the second native code into corresponding second standard structure data based on the standard structure; The fourth conversion module is used to convert the second standard structure data into corresponding second structured data according to the target application framework.

8. An electronic device, characterized in that: The electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when executing the program.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for compiling and processing native application program and terminal

    CN109032606A

  • Code generation method and device, storage medium and electronic equipment

    CN110580158A

  • Software visualization rapid development system

    CN111831276A

  • Programming language transformations with abstract syntax tree extensions

    US20140282444A1