CN116126347B - File compiling system and method for low-code application program - Google Patents

File compiling system and method for low-code application program Download PDF

Info

Publication number
CN116126347B
CN116126347B CN202310408472.XA CN202310408472A CN116126347B CN 116126347 B CN116126347 B CN 116126347B CN 202310408472 A CN202310408472 A CN 202310408472A CN 116126347 B CN116126347 B CN 116126347B
Authority
CN
China
Prior art keywords
target
data structure
structural feature
data
component instance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310408472.XA
Other languages
Chinese (zh)
Other versions
CN116126347A (en
Inventor
陆继恒
蒋耀锴
欧阳超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Functor Technology Hangzhou Co ltd
Original Assignee
Functor Technology Hangzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Functor Technology Hangzhou Co ltd filed Critical Functor Technology Hangzhou Co ltd
Priority to CN202310408472.XA priority Critical patent/CN116126347B/en
Publication of CN116126347A publication Critical patent/CN116126347A/en
Application granted granted Critical
Publication of CN116126347B publication Critical patent/CN116126347B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/47Retargetable compilers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The application discloses a file compiling system of a low-code application program, which comprises a node service module, a translator module and a browser module; when a node service module receives a user request, acquiring a target Schema file of a low-code application program corresponding to the user request; the translator module translates the original data structure of the document into a target data structure to obtain translated target application data; the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module; and the browser module interprets and executes the HTML text to generate a final compiling result. According to the method and the device, a unified compiling system is set for the files of the low-code application, so that the files of the low-code application can be compiled independently on any equipment provided with the compiling system on the premise of not depending on a third-party tool, cross-platform compiling is achieved, and compiling efficiency of the files of the low-code application is improved.

Description

File compiling system and method for low-code application program
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a system and a method for compiling a file of a low-code application program, which may be used for compiling a file generated by a low-code development platform.
Background
The Schema file is a structured description file corresponding to a low-code application program developed by a low-code platform, for example, the low-code development platform is a Zion platform, which is a low-code application development and operation platform obtained by a user, and based on an automatic code generation technology, non-technicians (product manager, designer and the like) can autonomously complete the realization and iteration of a complete cross-platform product without the participation of engineers. The user can edit the Zion Schema file corresponding to the product to be online in the Zed platform. The Zed platform is a visual editor facing to a terminal in a Zion product framework, the Zion Schema file is metadata describing the Zion application, and finally a compiling result can be obtained after compiling based on the Zion Schema file.
Different runtime environments are required for any programming language, such as the one shown in FIG. 1, for the Java programming language developed file, the runtime environment is V8/QuickJs, and for the Java programming language developed Java.class file, the runtime environment is JRE (JVM). Then, how to compile the Zion Schema file for the low code developed in Zed is a solution for the developer when there is no runtime environment.
In the prior art, the Zion Schema file is only one description file and does not have operation capability, so that at present, when compiling is performed based on the Zion Schema file, the Zion Schema file needs to be processed through a third party tool (such as ZType), an intermediate engineering code is generated after a processing result is combined with a preset project template, and a final operable operation time code can be generated after the intermediate engineering code is constructed.
Disclosure of Invention
The embodiment of the application provides a file compiling system of a low-code application program. The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview and is intended to neither identify key/critical elements nor delineate the scope of such embodiments. Its sole purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is presented later.
In a first aspect, an embodiment of the present application provides a file compiling system for a low-code application, the system including:
the system comprises a node service module, a translator module and a browser module; wherein,,
the node service module, the translator module and the browser module are in communication connection; wherein,,
the node service module is used for acquiring a target Schema file of a low-code application program corresponding to the user request through a pre-called service interface when the user request is received; the target Schema file is a structured description file of a low-code application program edited on a low-code platform;
the translator module is used for translating the original data structure of the target Schema file into a target data structure to obtain translated target application data;
the node service module is also used for performing hypertext markup language rendering according to the target application data to obtain an HTML text and sending the HTML text to the browser module;
and the browser module is used for performing interpretation and execution on the HTML text, generating a final compiling result and displaying the final compiling result.
Optionally, translating the original data structure of the target Schema file into the target data structure to obtain translated target application data includes:
acquiring description of component meta information of a target Schema file to obtain an adjacency list of a low-code application program; adjacency tables describe dependency information between program components;
recursively rendering the adjacency list into a component instance tree;
determining the data structure of each component instance in the component instance tree by adopting a subsequent traversal mode;
the data structure of each component instance is input into a pre-generated data structure converter, outputting translated target application data for each component instance.
Optionally, determining the data structure of each component instance in the component instance tree by adopting a subsequent traversal mode includes:
traversing and obtaining each component instance in the component instance tree in a subsequent traversing mode;
loading a mapping relation between a pre-stored component instance and a data storage path;
acquiring a component data storage path corresponding to each component instance in the mapping relation to obtain the data storage path of each component instance;
acquiring data description corresponding to each component instance based on the data storage path of each component instance;
and determining a data structure corresponding to each component instance according to the data description corresponding to each component instance.
Optionally, the pre-generated data structure converter includes a standard template analysis module, a structural feature comparison module and a structural conversion module;
inputting the data structure of each component instance into a pre-generated data structure converter, outputting translated target application data for each component instance, comprising:
the standard template analysis module acquires a target template of a preset target data structure, and extracts each first structural feature of the data structure in the target template according to a top-down sequence to obtain a first structural feature sequence;
extracting each second structural feature of the data structure of each component example by the structural feature comparison module according to the sequence from top to bottom to obtain a second structural feature sequence, calculating a correlation value between the first structural feature sequence and the second structural feature sequence, and taking an average value of the calculated correlation values to obtain a target correlation value;
and when the target correlation value is smaller than or equal to a preset correlation threshold value, the structure conversion module converts the data structure of each component instance into the data structure of the target template to obtain translated target application data of each component instance.
Optionally, calculating a correlation value between the first structural feature sequence and the second structural feature sequence includes:
acquiring a first structural feature, wherein the first structural feature is any structural feature in a first structural feature sequence;
determining a second structural feature corresponding to the first structural feature in the second structural feature sequence;
vector encoding is carried out on the first structural feature to obtain a first feature vector;
vector encoding is carried out on the second structural feature corresponding to the first structural feature, and a second feature vector is obtained;
calculating the similar distance between the first feature vector and the second feature vector, and determining each calculated similar distance as a correlation value between the first structural feature sequence and the second structural feature sequence; the similarity distance calculation formula is:
Figure SMS_1
wherein,,
Figure SMS_2
for any one of the first sequence of structural features,/i>
Figure SMS_3
For the determination of the and in the second structural feature sequence>
Figure SMS_4
And the corresponding second structural feature, p, is the first structural feature number in the first structural feature sequence.
Optionally, performing hypertext markup language rendering according to the target application data to obtain HTML text, and sending the HTML text to the browser module, including:
requesting a static resource link for the low code application;
executing target application data to request corresponding service data to a user;
performing HTML rendering based on the static resource links and the service data to obtain HTML text based on the hypertext markup language;
the HTML text is sent to the browser module.
Optionally, HTML rendering based on the static resource links and the service data includes:
requesting page static resource data corresponding to the static resource link;
grabbing in service data by using a preset JavaScript script to obtain grabbed key data;
analyzing the captured key data to obtain target elements stored in a Json character string format;
and performing front-end page rendering operation according to the static resource data and the target element.
Optionally, the method includes performing interpretation and execution on the HTML text, generating a final compiling result, and displaying the final compiling result, including:
acquiring information of an HTML text, and determining a target type of the HTML text based on the acquired information;
docking a browser kernel conforming to the HTML text according to the target type;
processing the HTML text according to the browser kernel to generate a final compiling result;
and displaying the final compiling result.
Optionally, interfacing the browser kernel conforming to the HTML text according to the target type includes:
selecting a browser kernel provided by a browser developer under the condition that the target type is WAP type;
if the target type is not WAP type, judging whether the beginning of the head line code of the HTML text is the beginning of a preset identifier; when the beginning of the head line code of the HTML text is the beginning of a preset identifier, selecting a browser kernel provided by a browser developer; when the beginning of the head line code of the HTML text is not the beginning of the preset identifier, judging whether the terminal where the browser is positioned is in a web proxy mode or not; if the mode is the proxy mode, selecting background transfer; if the mode is not the proxy mode, selecting a browser kernel provided by a terminal where the browser is located.
In a second aspect, an embodiment of the present application provides a method for compiling a file of a low-code application, where the method includes:
when a node service module receives a user request, acquiring a target Schema file of a low-code application program corresponding to the user request through a pre-called service interface; the target Schema file is a structured description file of a low-code application program edited on a low-code platform;
the translator module translates the original data structure of the target Schema file into a target data structure to obtain translated target application data;
the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module;
and the browser module interprets and executes the HTML text, and generates a final compiling result for display.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
in the file compiling system of the low-code application program provided by the embodiment of the application, when a node service module receives a user request, a target Schema file of the low-code application program corresponding to the user request is obtained; the translator module translates the original data structure of the document into a target data structure to obtain translated target application data; the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module; and the browser module interprets and executes the HTML text to generate a final compiling result. Because the unified compiling system is arranged for the files of the low-code application, the files of the low-code application can be compiled independently on any equipment provided with the compiling system on the premise of not depending on a third-party tool, so that cross-platform compiling is realized, and the compiling efficiency of the files of the low-code application is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram of a corresponding relation between operating environments of a programming language according to an embodiment of the present application;
FIG. 2 is a system diagram of a file compilation system for a low-code application according to an embodiment of the present application;
FIG. 3 is a component traversal diagram provided by an embodiment of the present application;
fig. 4 is a flowchart of a file compiling method of a low-code application according to an embodiment of the present application.
Detailed Description
The following description and the drawings illustrate specific embodiments of the application sufficiently to enable those skilled in the art to practice them.
It should be understood that the described embodiments are merely some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of systems and methods that are consistent with aspects of the present application, as detailed in the accompanying claims.
In the description of the present application, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context. Furthermore, in the description of the present application, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
So far, because the Zion Schema file of the low-code application program is only one description file and does not have the operation capability, at present, when compiling is performed based on the Zion Schema file, the Zion Schema file needs to be processed through a third party tool (such as ZType), an intermediate engineering code is generated after the processing result is combined with a preset project template, and the final executable operation time code can be generated after the intermediate engineering code is constructed. For this reason, the present application provides a file compiling system and method for a low-code application program to solve the problems existing in the related art. In the file compiling system of the low-code application program provided by the embodiment of the application, when a node service module receives a user request, a target Schema file of the low-code application program corresponding to the user request is obtained; the translator module translates the original data structure of the document into a target data structure to obtain translated target application data; the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module; and the browser module interprets and executes the HTML text to generate a final compiling result. Because the unified compiling system is set for the files of the low-code application, the files of the low-code application can be compiled independently on any equipment provided with the compiling system on the premise of not depending on a third-party tool, so that cross-platform compiling is realized, the compiling efficiency of the files of the low-code application is improved, and the following detailed description is given by adopting an exemplary embodiment.
Referring to fig. 2, fig. 2 is a schematic system structure diagram of a file compiling system for a low-code application program according to an embodiment of the present application, where the system includes a node service module, a translator module, and a browser module; the node service module, the translator module and the browser module are in communication connection; the node service module is used for acquiring a target Schema file of a low-code application program corresponding to a user request through a pre-called service interface when the user request is received; the target Schema file is a structured description file of a low-code application program edited on a low-code platform; the translator module is used for translating the original data structure of the target Schema file into a target data structure to obtain translated target application data; the node service module is also used for performing hypertext markup language rendering according to the target application data to obtain an HTML text and sending the HTML text to the browser module; and the browser module is used for performing interpretation and execution on the HTML text, generating a final compiling result and displaying the final compiling result.
In the embodiment of the application, when the original data structure of the target Schema file is translated into the target data structure to obtain translated target application data, firstly, the description of component meta information of the target Schema file is obtained to obtain an adjacency list of the low-code application program; the adjacency list describes the subordinate information among program components, then the adjacency list is recursively rendered into a component instance tree, then the data structure of each component instance in the component instance tree is determined in a subsequent traversing mode, and finally the data structure of each component instance is input into a pre-generated data structure converter to output the translated target application data of each component instance.
Specifically, the subsequent traversing mode can be understood as a bottom-up traversing mode, in a specific code implementation, a specific type of component can provide a method for modifying the state of the target component by the controllable post-related component in advance, and when the post-related component processes, information is supplemented to the target component. For example, as shown in fig. 3, the adjacency list is traversed sequentially, and the C component finishes processing the D and E components after processing, but at this time, if the information of the C component is not complete, the supplementing of the information required by the C component can be completed when traversing to the F and G components. In fact, even after F, G completes the processing, the C component cannot confirm whether the state is complete, because it cannot confirm whether the post component still has the information required by C. The computer language may syntactically guarantee this, corresponding to the traversal process of the LR (k) Parser, but the component disorder and design-time information discreteness of the Schema file, resulting in that some components must complete the translation after the entire Schema file has been traversed.
It should be noted that, the component is a package for a series of views and interactions, and the state is a description of the current form of the component, where the state is generated by a data interface, a user interaction event, environmental data (pages, routes, etc.), and other triggers (timers, etc.), and the state determines the view status and possible interaction behavior of a component.
In the embodiment of the application, when the data structure of each component instance in the component instance tree is determined by adopting a subsequent traversing mode, firstly, traversing and acquiring each component instance in the component instance tree by adopting the subsequent traversing mode, then loading a mapping relation between a prestored component instance and a data storage path, secondly, acquiring the component data storage path corresponding to each component instance in the mapping relation to obtain the data storage path of each component instance, then acquiring the data description corresponding to each component instance based on the data storage path of each component instance, and finally determining the data structure corresponding to each component instance according to the data description corresponding to each component instance.
In the embodiment of the application, the pre-generated data structure converter comprises a standard template analysis module, a structural feature comparison module and a structural conversion module.
Specifically, when the data structure of each component instance is input into a pre-generated data structure converter, and translated target application data of each component instance is output, firstly, a standard template analysis module acquires a target template of a pre-set target data structure, extracts each first structural feature of the data structure in the target template according to a top-down sequence to obtain a first structural feature sequence, then a structural feature comparison module extracts each second structural feature of the data structure of each component instance according to the top-down sequence to obtain a second structural feature sequence, calculates a correlation value between the first structural feature sequence and the second structural feature sequence, averages the calculated correlation value to obtain a target correlation value, and secondly, when the target correlation value is smaller than or equal to a preset correlation threshold, the structural conversion module converts the data structure of each component instance into the data structure of the target template to obtain the translated target application data of each component instance.
In the embodiment of the application, when calculating the correlation value between the first structural feature sequence and the second structural feature sequence, first acquiring a first structural feature, wherein the first structural feature is any one structural feature in the first structural feature sequence, then determining a second structural feature corresponding to the first structural feature in the second structural feature sequence, then vector encoding the first structural feature to obtain a first feature vector, vector encoding the second structural feature corresponding to the first structural feature to obtain a second feature vector, finally calculating the similarity distance between the first feature vector and the second feature vector, and determining each calculated similarity distance as the correlation value between the first structural feature sequence and the second structural feature sequence; the similarity distance calculation formula is:
Figure SMS_5
wherein,,
Figure SMS_6
for any one of the first sequence of structural features,/i>
Figure SMS_7
For the determination of the and in the second structural feature sequence>
Figure SMS_8
And the corresponding second structural feature, p, is the first structural feature number in the first structural feature sequence.
In one possible implementation, when performing a specific translation, it is essential that the data structure of the target Schema file is converted from one specific data structure to another specific data structure, so that the specific algorithm of the translation can be packaged into a getMeta () method of a Transpiler class, where the Schema file needs to be imported into the Transpiler class constructor, and the Transpiler class provides a generic type as an input of the translation, and the sub-class can specify the target structure of the self-translation through the generic type. the transfile asynchronous abstract method is a method that each sub-class must implement, which must return a generic structure at the time of sub-class declaration. The timing of the specific execution of the transfile method depends on when the holder of the class instance invokes the transfile by calling the getMeta () method in a lazy execution manner, performing the translation, resulting in the final target data structure.
In the embodiment of the application, after the target data structure is obtained, the node service module is required to perform hypertext markup language rendering according to the target application data to obtain the HTML text, and the HTML text is sent to the browser module. Firstly requesting static resource links of low-code application programs, then executing target application data to request corresponding service data to a user, secondly performing HTML rendering based on the static resource links and the service data to obtain HTML text based on a hypertext markup language, and finally sending the HTML text to a browser module.
Specifically, when HTML rendering is performed based on a static resource link and service data, static resource data of a page corresponding to the static resource link is requested first, then a preset JavaScript script is utilized to capture in the service data, captured key data are obtained, the captured key data are analyzed to obtain target elements stored in a Json character string format, and finally front-end page rendering operation is performed according to the static resource data and the target elements.
In the embodiment of the application, after the browser module obtains the HTML text, firstly, information of the HTML text is obtained, the target type of the HTML text is determined based on the obtained information, then a browser kernel conforming to the HTML text is docked according to the target type, secondly, the HTML text is processed according to the browser kernel, a final compiling result is generated, and finally, the final compiling result is displayed.
Specifically, when the browser kernel conforming to the HTML text is docked according to the target type, firstly, selecting the browser kernel provided by a browser developer under the condition that the target type is WAP type, and then judging whether the beginning of the head line code of the HTML text is the beginning of a preset identifier under the condition that the target type is not WAP type; when the beginning of the head line code of the HTML text is the beginning of a preset identifier, selecting a browser kernel provided by a browser developer; when the beginning of the head line code of the HTML text is not the beginning of the preset identifier, judging whether the terminal where the browser is positioned is in a web proxy mode or not; if the mode is the proxy mode, selecting background transfer; if the mode is not the proxy mode, selecting a browser kernel provided by a terminal where the browser is located.
In the file compiling system of the low-code application program provided by the embodiment of the application, when a node service module receives a user request, a target Schema file of the low-code application program corresponding to the user request is obtained; the translator module translates the original data structure of the document into a target data structure to obtain translated target application data; the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module; and the browser module interprets and executes the HTML text to generate a final compiling result. Because the unified compiling system is arranged for the files of the low-code application, the files of the low-code application can be compiled independently on any equipment provided with the compiling system on the premise of not depending on a third-party tool, so that cross-platform compiling is realized, and the compiling efficiency of the files of the low-code application is improved.
Referring to fig. 4, a flowchart of a method for compiling a file of a low-code application program applied to a file compiling system of the low-code application program is provided in an embodiment of the present application. As shown in fig. 4, the detection method of the embodiment of the present application may include the following steps:
s101, when a node service module receives a user request, acquiring a target Schema file of a low-code application program corresponding to the user request through a pre-called service interface;
the target Schema file is a structured description file of a low-code application program edited on a low-code platform; the file is edited by the user in the Zed platform.
S102, a translator module translates an original data structure of a target Schema file into a target data structure to obtain translated target application data;
in one possible implementation manner, when the original data structure of the target Schema file is translated into the target data structure to obtain translated target application data, firstly, obtaining a description of component meta information of the target Schema file to obtain an adjacency list of the low-code application program; the adjacency list describes the subordinate information among program components, then the adjacency list is recursively rendered into a component instance tree, then the data structure of each component instance in the component instance tree is determined in a subsequent traversing mode, and finally the data structure of each component instance is input into a pre-generated data structure converter to output the translated target application data of each component instance.
Specifically, when determining the data structure of each component instance in the component instance tree by adopting a subsequent traversing mode, traversing and acquiring each component instance in the component instance tree by adopting the subsequent traversing mode, loading the mapping relation between the prestored component instance and the data storage path, acquiring the component data storage path corresponding to each component instance in the mapping relation to obtain the data storage path of each component instance, acquiring the data description corresponding to each component instance based on the data storage path of each component instance, and finally determining the data structure corresponding to each component instance according to the data description corresponding to each component instance.
Specifically, the pre-generated data structure converter comprises a standard template analysis module, a structural feature comparison module and a structural conversion module.
Specifically, when inputting the data structure of each component instance into a pre-generated data structure converter and outputting translated target application data of each component instance, a standard template analysis module acquires a target template of a pre-set target data structure, and extracts each first structural feature of the data structure in the target template according to a top-down sequence to obtain a first structural feature sequence; extracting each second structural feature of the data structure of each component example by the structural feature comparison module according to the sequence from top to bottom to obtain a second structural feature sequence, calculating a correlation value between the first structural feature sequence and the second structural feature sequence, and taking an average value of the calculated correlation values to obtain a target correlation value; and when the target correlation value is smaller than or equal to a preset correlation threshold value, the structure conversion module converts the data structure of each component instance into the data structure of the target template to obtain translated target application data of each component instance.
Specifically, when calculating a correlation value between a first structural feature sequence and a second structural feature sequence, firstly acquiring a first structural feature, wherein the first structural feature is any one structural feature in the first structural feature sequence, then determining a second structural feature corresponding to the first structural feature in the second structural feature sequence, secondly vector encoding the first structural feature to obtain a first feature vector, vector encoding the second structural feature corresponding to the first structural feature to obtain a second feature vector, finally calculating a similar distance between the first feature vector and the second feature vector, and determining each calculated similar distance as the correlation value between the first structural feature sequence and the second structural feature sequence; the similarity distance calculation formula is:
Figure SMS_9
wherein,,
Figure SMS_10
for any one of the first sequence of structural features,/i>
Figure SMS_11
For the determination of the and in the second structural feature sequence>
Figure SMS_12
And the corresponding second structural feature, p, is the first structural feature number in the first structural feature sequence.
S103, the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module;
in the embodiment of the application, when performing hypertext markup language rendering according to target application data to obtain an HTML text and sending the HTML text to a browser module, firstly requesting a static resource link of a low-code application program, then executing the target application data to request service data corresponding to a user request, then performing HTML rendering based on the static resource link and the service data to obtain the HTML text based on the hypertext markup language, and finally sending the HTML text to the browser module.
Specifically, when HTML rendering is performed based on a static resource link and service data, static resource data of a page corresponding to the static resource link is requested first, then a preset JavaScript script is utilized to capture in the service data, captured key data are obtained, the captured key data are analyzed to obtain target elements stored in a Json character string format, and finally front-end page rendering operation is performed according to the static resource data and the target elements.
S104, the browser module interprets and executes the HTML text, and generates a final compiling result to display.
In the embodiment of the application, when the HTML text is interpreted and executed to generate a final compiling result for displaying, firstly, information of the HTML text is acquired, a target type of the HTML text is determined based on the acquired information, then a browser kernel conforming to the HTML text is docked according to the target type, the HTML text is processed according to the browser kernel, the final compiling result is generated, and finally, the final compiling result is displayed.
Specifically, when the browser kernel conforming to the HTML text is docked according to the target type, firstly, selecting the browser kernel provided by the browser developer under the condition that the target type is WAP type; or if the target type is not WAP type, judging whether the beginning of the head line code of the HTML text is the beginning of a preset identifier; when the beginning of the head line code of the HTML text is the beginning of a preset identifier, selecting a browser kernel provided by a browser developer; when the beginning of the head line code of the HTML text is not the beginning of the preset identifier, judging whether the terminal where the browser is positioned is in a web proxy mode or not; if the mode is the proxy mode, selecting background transfer; if the mode is not the proxy mode, selecting a browser kernel provided by a terminal where the browser is located.
In the file compiling system of the low-code application program provided by the embodiment of the application, when a node service module receives a user request, a target Schema file of the low-code application program corresponding to the user request is obtained; the translator module translates the original data structure of the document into a target data structure to obtain translated target application data; the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text, and sends the HTML text to the browser module; and the browser module interprets and executes the HTML text to generate a final compiling result. Because the unified compiling system is arranged for the files of the low-code application, the files of the low-code application can be compiled independently on any equipment provided with the compiling system on the premise of not depending on a third-party tool, so that cross-platform compiling is realized, and the compiling efficiency of the files of the low-code application is improved.
The present application also provides a computer readable medium having stored thereon program instructions which, when executed by a processor, implement the file compiling method of the low code application provided by the above respective method embodiments.
The present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of compiling a file for a low code application of the above-described method embodiments.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiment methods may be accomplished by computer programs to instruct the associated hardware, and that the programs for compiling the files of the low-code application program may be stored in a computer readable storage medium, which when executed may comprise the embodiment methods as described above. The storage medium for compiling the file of the low-code application program can be a magnetic disk, an optical disk, a read-only memory, a random access memory or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (9)

1. A file compilation system for a low code application, the system comprising:
the system comprises a node service module, a translator module and a browser module; wherein,,
the node service module, the translator module and the browser module are in communication connection; wherein,,
the node service module is used for acquiring a target Schema file of a low-code application program corresponding to a user request through a pre-called service interface when the user request is received; the target Schema file is a structured description file of a low-code application program edited on a low-code platform;
the translator module is configured to translate the original data structure of the target Schema file into a target data structure, so as to obtain translated target application data; wherein,,
the translating the original data structure of the target Schema file into a target data structure to obtain translated target application data includes:
acquiring the description of the component meta information of the target Schema file to obtain an adjacency list of the low-code application program; the adjacency table describes dependency information between program components;
recursively rendering the adjacency list into a component instance tree;
determining the data structure of each component instance in the component instance tree by adopting a subsequent traversal mode;
inputting the data structure of each component instance into a pre-generated data structure converter, and outputting translated target application data of each component instance; wherein,,
the pre-generated data structure converter is used for acquiring a target template of a pre-set target data structure and converting the data structure of each component instance into the data structure of the target template by adopting a pre-set correlation threshold;
the node service module is also used for performing hypertext markup language rendering according to the target application data to obtain an HTML text and sending the HTML text to the browser module;
and the browser module is used for performing interpretation and execution on the HTML text, generating a final compiling result and displaying the final compiling result.
2. The system of claim 1, wherein determining the data structure of each component instance in the tree of component instances in a subsequent traversal manner comprises:
traversing and obtaining each component instance in the component instance tree in a subsequent traversing mode;
loading a mapping relation between a pre-stored component instance and a data storage path;
acquiring a component data storage path corresponding to each component instance in the mapping relation to obtain the data storage path of each component instance;
acquiring data description corresponding to each component instance based on the data storage path of each component instance;
and determining a data structure corresponding to each component instance according to the data description corresponding to each component instance.
3. The system of claim 1, wherein the pre-generated data structure converter comprises a standard template analysis module, a structural feature comparison module, and a structural conversion module;
inputting the data structure of each component instance into a pre-generated data structure converter, and outputting the translated target application data of each component instance, wherein the method comprises the following steps:
the standard template analysis module acquires a target template of a preset target data structure, and extracts each first structural feature of the data structure in the target template according to a top-down sequence to obtain a first structural feature sequence;
extracting each second structural feature of the data structure of each component example by the structural feature comparison module according to the sequence from top to bottom to obtain a second structural feature sequence, calculating a correlation value between the first structural feature sequence and the second structural feature sequence, and averaging the calculated correlation values to obtain a target correlation value;
and when the target correlation value is smaller than or equal to a preset correlation threshold value, the structure conversion module converts the data structure of each component instance into the data structure of the target template to obtain translated target application data of each component instance.
4. A file compilation system for a low-code application according to claim 3 wherein said calculating a correlation value between said first and second structural feature sequences comprises:
acquiring a first structural feature, wherein the first structural feature is any structural feature in the first structural feature sequence;
determining a second structural feature corresponding to the first structural feature in the second structural feature sequence;
vector encoding is carried out on the first structural feature to obtain a first feature vector;
vector encoding is carried out on a second structural feature corresponding to the first structural feature, and a second feature vector is obtained;
calculating the similar distance between the first feature vector and the second feature vector, and determining each calculated similar distance as a correlation value between the first structural feature sequence and the second structural feature sequence; the similarity distance calculation formula is as follows:
Figure QLYQS_1
wherein,,
Figure QLYQS_2
for any one of the first sequence of structural features,/for the first sequence of structural features>
Figure QLYQS_3
For the and +.>
Figure QLYQS_4
And the corresponding second structural feature, p, is the first structural feature number in the first structural feature sequence.
5. The system of claim 1, wherein the performing hypertext markup language rendering according to the target application data to obtain HTML text, and transmitting the HTML text to the browser module comprises:
requesting a static resource link for the low code application;
executing the target application data to request corresponding service data to the user;
performing HTML rendering based on the static resource links and the service data to obtain HTML text based on a hypertext markup language;
and sending the HTML text to a browser module.
6. The system for compiling a file for a low-code application of claim 5 wherein said HTML rendering based on said static resource links and said business data comprises:
requesting page static resource data corresponding to the static resource link;
grabbing in the service data by using a preset JavaScript script to obtain grabbed key data;
analyzing the captured key data to obtain target elements stored in a Json character string format;
and performing front-end page rendering operation according to the static resource data and the target element.
7. The system for compiling a file for a low-code application according to claim 1, wherein said executing said HTML text to interpret and execute said HTML text to generate a final compiling result to be displayed comprises:
acquiring information of the HTML text, and determining a target type of the HTML text based on the acquired information;
docking a browser kernel conforming to the HTML text according to the target type;
processing the HTML text according to the browser kernel to generate a final compiling result;
and displaying the final compiling result.
8. The system of claim 7, wherein said interfacing browser kernels conforming to said HTML text according to said object type comprises:
selecting a browser kernel provided by a browser developer under the condition that the target type is WAP type;
if the target type is not WAP type, judging whether the beginning of the head line code of the HTML text is the beginning of a preset identifier; when the beginning of the first line code of the HTML text is the beginning of a preset identifier, selecting a browser kernel provided by a browser developer; when the beginning of the head line code of the HTML text is not the beginning of a preset identifier, judging whether the terminal where the browser is located is in a web proxy mode or not; if the mode is the proxy mode, selecting background transfer; and if the mode is not the proxy mode, selecting a browser kernel provided by the terminal where the browser is located.
9. A method for compiling a file for a low-code application, the method comprising:
when a node service module receives a user request, acquiring a target Schema file of a low-code application program corresponding to the user request through a pre-called service interface; the target Schema file is a structured description file of a low-code application program edited on a low-code platform;
the translator module translates the original data structure of the target Schema file into a target data structure to obtain translated target application data; wherein,,
the translating the original data structure of the target Schema file into a target data structure to obtain translated target application data includes:
acquiring the description of the component meta information of the target Schema file to obtain an adjacency list of the low-code application program; the adjacency table describes dependency information between program components;
recursively rendering the adjacency list into a component instance tree;
determining the data structure of each component instance in the component instance tree by adopting a subsequent traversal mode;
inputting the data structure of each component instance into a pre-generated data structure converter, and outputting translated target application data of each component instance; wherein,,
the pre-generated data structure converter is used for acquiring a target template of a pre-set target data structure and converting the data structure of each component instance into the data structure of the target template by adopting a pre-set correlation threshold;
the node service module performs hypertext markup language rendering according to the target application data to obtain an HTML text and sends the HTML text to the browser module;
and the browser module interprets and executes the HTML text, and generates a final compiling result for display.
CN202310408472.XA 2023-04-17 2023-04-17 File compiling system and method for low-code application program Active CN116126347B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310408472.XA CN116126347B (en) 2023-04-17 2023-04-17 File compiling system and method for low-code application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310408472.XA CN116126347B (en) 2023-04-17 2023-04-17 File compiling system and method for low-code application program

Publications (2)

Publication Number Publication Date
CN116126347A CN116126347A (en) 2023-05-16
CN116126347B true CN116126347B (en) 2023-07-07

Family

ID=86299468

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310408472.XA Active CN116126347B (en) 2023-04-17 2023-04-17 File compiling system and method for low-code application program

Country Status (1)

Country Link
CN (1) CN116126347B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112394942A (en) * 2020-11-24 2021-02-23 季明 Distributed software development compiling method and software development platform based on cloud computing
CN115061678A (en) * 2022-06-20 2022-09-16 四创科技有限公司 Code compiling method and client based on browser proxy service

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7707547B2 (en) * 2005-03-11 2010-04-27 Aptana, Inc. System and method for creating target byte code
CN111708539B (en) * 2020-06-17 2021-07-06 腾讯科技(深圳)有限公司 Application program code conversion method and device, electronic equipment and storage medium
CN112199556A (en) * 2020-10-14 2021-01-08 深圳市元征科技股份有限公司 Automatic XML Schema file format conversion method, system and related equipment
CN114691139A (en) * 2020-12-25 2022-07-01 中移动信息技术有限公司 Compiling method, device, storage medium and electronic equipment
CN114035805A (en) * 2021-11-16 2022-02-11 北京字节跳动网络技术有限公司 Code conversion method, apparatus, medium, and device for pre-compiler
CN115113869A (en) * 2022-06-14 2022-09-27 厦门稿定股份有限公司 Online webpage development method and device based on browser

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112394942A (en) * 2020-11-24 2021-02-23 季明 Distributed software development compiling method and software development platform based on cloud computing
CN115061678A (en) * 2022-06-20 2022-09-16 四创科技有限公司 Code compiling method and client based on browser proxy service

Also Published As

Publication number Publication date
CN116126347A (en) 2023-05-16

Similar Documents

Publication Publication Date Title
US8490050B2 (en) Automatic generation of user interfaces
US9043766B2 (en) Language translation using preprocessor macros
CN112579097B (en) Software project construction method and device, storage medium and electronic equipment
US8615750B1 (en) Optimizing application compiling
US20100023926A1 (en) Call graph dependency extraction by static source code analysis
Wu et al. Grammar‐driven generation of domain‐specific language debuggers
WO2019214539A1 (en) Document display method and apparatus
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN111831384B (en) Language switching method, device, equipment and storage medium
CN111913741B (en) Object interception method, device, medium and electronic equipment
CN111488573A (en) Link library detection method and device, electronic equipment and computer readable storage medium
CN111427583A (en) Component compiling method and device, electronic equipment and computer readable storage medium
CN110109671B (en) Webpack label size and style conversion method and device
US20140165038A1 (en) Analysis of propagated information using annotated forests
CN114153459A (en) Interface document generation method and device
JP2004341671A (en) Information processing system, control method, control program and recording medium
CN107526679A (en) Automated test frame, the automated testing method based on thereon, storage medium and computer equipment
CN114443041A (en) Method for parsing abstract syntax tree and computer program product
CN113031932A (en) Project development method and device, electronic equipment and storage medium
CN113434147A (en) ProtoBuf protocol-based message analysis method and device
CN116126347B (en) File compiling system and method for low-code application program
CN115061678A (en) Code compiling method and client based on browser proxy service
CN116126348B (en) File compiling method for low-code application program of real-time preview
CN109359055B (en) Data testing method and device
CN114489653A (en) Compiler-based data processing method, compiler-based data processing device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant