A method and system for compiling and generating multi-terminal source code on a low-code platform
By extracting and generating SFC page templates and scripts, combined with nodes, services and contexts, the compatibility and scalability issues of low-code platform DSL language in multi-platform source code generation are solved, and cross-platform homogeneous reuse is achieved. and improved market coverage.
Patent Information
- Application Number
- CN202410811077.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Low-code platform DSL languages are prone to problems such as insufficient platform compatibility, high maintenance costs, poor scalability, and limited market coverage when generating multi-platform source code.
By obtaining the low-code platform DSL language set by the user, extracting view element data and interactive logic data, using the preset SFC markup language generator and SFC script language generator to generate SFC page templates and scripts, and combining nodes, services and contexts Generate SFC unit templates and finally combine them into the source code of the corresponding platform to achieve cross-platform differential isomorphism.
It achieves efficient, reliable and homogeneous reuse between DSL languages and cross-platforms, reduces maintenance costs and improves scalability and market coverage.
Smart Images

Figure CN118394347B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and more specifically, to a method and system for compiling and generating multi-terminal source code on a low-code platform. Background Art
[0002] Low-code platform DSL (domain-specific language, description language) language is prone to defects when generating multi-platform source code, such as insufficient platform compatibility, high maintenance costs, poor scalability and limited market coverage.
[0003] Therefore, the prior art has defects and needs to be improved urgently. Summary of the invention
[0004] In view of the above problems, the purpose of the present invention is to provide a low-code platform multi-terminal source code compilation generation method and system, which can efficiently and reliably isomorphize the differences between DSL language and cross-platform to achieve homogeneous reuse.
[0005] A first aspect of the present invention provides a method for compiling and generating multi-terminal source code on a low-code platform, comprising:
[0006] Get the low-code platform DSL language set by the user;
[0007] Extract view element data and interaction logic data in the low-code platform DSL language;
[0008] Based on the preset SFC markup language generator, generate SFC page templates according to view element data, and record the nodes, services and contexts required in the generation process;
[0009] Based on the preset SFC script language generator, the corresponding SFC page script is matched according to the interactive logic data;
[0010] Parse the low-code platform DSL language and generate an SFC unit template by combining nodes, services, and contexts;
[0011] The SFC page template, the SFC page script and the SFC unit template are combined to obtain the source code of the corresponding platform.
[0012] In this solution, the step of generating an SFC page template according to the view element data specifically includes:
[0013] Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes;
[0014] Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes;
[0015] The number of nodes, services and contexts with different attributes are combined to obtain the SFC page template.
[0016] In this solution, after the SFC page script is generated, it specifically includes:
[0017] Verify the execution function in the SFC page script and obtain the verification result;
[0018] Extract features and corresponding eigenvalues from verification results;
[0019] Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features;
[0020] Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature;
[0021] The weight scores of different features are accumulated to obtain the weight score of the SFC page script;
[0022] When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified;
[0023] If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information.
[0024] In this solution, the step of generating SFC page script adjustment information specifically includes:
[0025] Compare and analyze the weight scores of the features to obtain the minimum weight score and the corresponding features;
[0026] Determine the preset standard weight score of the corresponding feature according to the minimum weight score and the corresponding feature;
[0027] Subtract the minimum weight score from the preset standard weight score of the corresponding feature to obtain the adjusted weight score of the corresponding feature;
[0028] The adjustment weight score of the corresponding feature is multiplied by the preset precision weight coefficient to obtain the precision adjustment value of the corresponding feature rule generated by the SFC script language;
[0029] Generate a precision adjustment value corresponding to the feature rule according to the SFC script language, and obtain corresponding SFC page script adjustment information.
[0030] In this solution, the steps of parsing the low-code platform DSL language and generating an SFC unit template in combination with nodes, services, and contexts specifically include:
[0031] Based on the preset DSL syntax parsing rules, the low-code platform DSL language is parsed to obtain the parsed DSL language rules;
[0032] Combine nodes, services and contexts according to the parsed DSL language rules to obtain the SFC unit template.
[0033] In this solution, after obtaining the parsed DSL language rules, the following steps are also included:
[0034] According to the words in the DSL language rules, the words are constructed into a word sequence in order;
[0035] Extracting syntax and semantics of word sequences;
[0036] Compare and analyze the grammar of the word sequence with the word sequence in the preset grammar compilation error list. If they are consistent, the grammar error index of the corresponding word sequence is set to 1; if they are inconsistent, the grammar error index of the corresponding word sequence is set to 0;
[0037] Compare and analyze the semantics of a word sequence with the semantics of adjacent word sequences to obtain the degree of association;
[0038] If the correlation is greater than or equal to the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 0; if the correlation is less than the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 1;
[0039] Multiplying the grammatical error index of the word sequence by a preset grammatical error weight coefficient to obtain a first value;
[0040] Multiplying the semantic error index of the word sequence by a preset semantic error weight coefficient to obtain a second value;
[0041] The first value and the second value are accumulated to obtain an error index of the corresponding word sequence;
[0042] When the error index of the word sequence is greater than or equal to a preset second error index threshold, corresponding word sequence error information is generated.
[0043] In this solution, after generating the corresponding word sequence error information, the method further includes:
[0044] Extract words from DSL language rules;
[0045] According to the words in the DSL language rules, determine the corresponding word type;
[0046] Compare and analyze the word type with the word type in the preset type compilation error list, and if they are consistent, extract the probability value of the corresponding word type in the preset compilation error list and set it as the first probability value;
[0047] Extract the position of a word in a sequence of words;
[0048] Compare and analyze the position of the word in the word sequence with the word position in the preset position compilation error list, and if they are consistent, extract the probability value of the corresponding word position in the preset compilation error list and set it as the second probability value;
[0049] Multiplying the first probability value by a preset first probability weight coefficient to obtain a first error index value of the corresponding word;
[0050] Multiplying the second probability value by a preset second probability weight coefficient to obtain a second error index value of the corresponding word;
[0051] Accumulate the first error index value and the second error index value of the word to obtain the error index value of the corresponding word;
[0052] If the error index value of a word is greater than a preset first error index threshold, the corresponding word will be deleted and a warning message will be triggered.
[0053] A second aspect of the present invention provides a low-code platform multi-terminal source code compilation generation system, including a memory and a processor, wherein the memory stores a low-code platform multi-terminal source code compilation generation method program, and when the low-code platform multi-terminal source code compilation generation method program is executed by the processor, the following steps are implemented:
[0054] Get the low-code platform DSL language set by the user;
[0055] Extract view element data and interaction logic data in the low-code platform DSL language;
[0056] Based on the preset SFC markup language generator, generate SFC page templates according to view element data, and record the nodes, services and contexts required in the generation process;
[0057] Based on the preset SFC script language generator, the corresponding SFC page script is matched according to the interactive logic data;
[0058] Parse the low-code platform DSL language and generate an SFC unit template by combining nodes, services, and contexts;
[0059] The SFC page template, the SFC page script and the SFC unit template are combined to obtain the source code of the corresponding platform.
[0060] In this solution, the step of generating an SFC page template according to the view element data specifically includes:
[0061] Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes;
[0062] Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes;
[0063] The number of nodes, services and contexts with different attributes are combined to obtain the SFC page template.
[0064] In this solution, after the SFC page script is generated, it specifically includes:
[0065] Verify the execution function in the SFC page script and obtain the verification result;
[0066] Extract features and corresponding eigenvalues from verification results;
[0067] Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features;
[0068] Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature;
[0069] The weight scores of different features are accumulated to obtain the weight score of the SFC page script;
[0070] When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified;
[0071] If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information.
[0072] The present invention discloses a low-code platform multi-terminal source code compilation generation method and system, which can efficiently and reliably isomorphize the differences between DSL language and cross-platforms through a DSL-based SFC source code generation algorithm to achieve homogeneous reuse. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 A flowchart of a method for compiling and generating multi-terminal source code on a low-code platform of the present invention is shown;
[0074] Figure 2 A block diagram of SFCMake of the present invention is shown.
[0075] Figure 3 A block diagram of a low-code platform multi-terminal source code compilation and generation system of the present invention is shown. DETAILED DESCRIPTION
[0076] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0077] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0078] Figure 1 A flow chart of a method for compiling and generating multi-terminal source code on a low-code platform of the present invention is shown.
[0079] like Figure 1 As shown, the present invention discloses a method for compiling and generating multi-terminal source code on a low-code platform, comprising:
[0080] S101, obtaining the low-code platform DSL language set by the user end;
[0081] S102, extracting view element data and interaction logic data in the low-code platform DSL language;
[0082] S103, based on a preset SFC markup language generator, generate an SFC page template according to the view element data, and record the nodes, services and contexts required in the generation process;
[0083] S104, matching a corresponding SFC page script according to the interactive logic data based on a preset SFC script language generator;
[0084] S105, parse the low-code platform DSL language, and generate an SFC unit template by combining nodes, services, and contexts;
[0085] S106, combining the SFC page template, the SFC page script and the SFC unit template to obtain source code of the corresponding platform.
[0086] According to an embodiment of the present invention, based on the DSL language, DSL syntax parsing rules and compilation algorithms of the required compilation platform are designed, wherein the preset SFC markup language generator and SFC script language generator are provided with corresponding compilation algorithms, and multiple segments of differentiated and isomorphic SFC page scripts and SFC page templates are written; the low-code platform DSL language is parsed through the DSL syntax parsing rules to obtain the parsed DSL language rules, and the SFC units are generated according to the parsed DSL language rules in combination with the nodes, services and contexts.
[0087] According to an embodiment of the present invention, the step of generating an SFC page template according to view element data specifically includes:
[0088] Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes;
[0089] Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes;
[0090] The number of nodes, services and contexts with different attributes are combined to obtain the SFC page template.
[0091] It should be noted that different SFC page templates adapt to different view element data in the low-code platform DSL language, and are compiled according to the page elements in the view element data in the low-code platform DSL language to determine the corresponding SFC page template.
[0092] According to an embodiment of the present invention, after the SFC page script is generated, the following steps are specifically included:
[0093] Verify the execution function in the SFC page script and obtain the verification result;
[0094] Extract features and corresponding eigenvalues from verification results;
[0095] Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features;
[0096] Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature;
[0097] The weight scores of different features are accumulated to obtain the weight score of the SFC page script;
[0098] When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified;
[0099] If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information.
[0100] It should be noted that after the SFC page script is generated, the SFC page script is verified, and the features in the verification result, such as accuracy, calculation time, etc., are stored in the preset scoring rules with different features and corresponding feature value ranges, and different feature value ranges correspond to different scores.
[0101] According to an embodiment of the present invention, the step of generating SFC page script adjustment information specifically includes:
[0102] Compare and analyze the weight scores of the features to obtain the minimum weight score and the corresponding features;
[0103] Determine the preset standard weight score of the corresponding feature according to the minimum weight score and the corresponding feature;
[0104] Subtract the minimum weight score from the preset standard weight score of the corresponding feature to obtain the adjusted weight score of the corresponding feature;
[0105] The adjustment weight score of the corresponding feature is multiplied by the preset precision weight coefficient to obtain the precision adjustment value of the corresponding feature rule generated by the SFC script language;
[0106] Generate a precision adjustment value corresponding to the feature rule according to the SFC script language, and obtain corresponding SFC page script adjustment information.
[0107] It should be noted that the feature corresponding to the minimum weight score is set as the priority adjustment object of the SFC page script. After the feature corresponding to the minimum weight score is adjusted, if the weight score of the SFC page script is still less than the preset score threshold, the feature corresponding to the second smallest weight score is adjusted, and so on, until the weight score of the SFC page script is greater than or equal to the preset score threshold; the compilation algorithm in the SFC script language generator includes a plurality of SFC script language generation rules; the SFC script language generation rule of the feature is adjusted according to the precision adjustment value of the SFC script language generation corresponding feature rule to achieve the effect of adjusting the SFC page script.
[0108] According to an embodiment of the present invention, the step of parsing the low-code platform DSL language and generating an SFC unit template in combination with nodes, services and contexts specifically includes:
[0109] Based on the preset DSL syntax parsing rules, the low-code platform DSL language is parsed to obtain the parsed DSL language rules;
[0110] Combine nodes, services and contexts according to the parsed DSL language rules to obtain the SFC unit template.
[0111] According to an embodiment of the present invention, after obtaining the parsed DSL language rules, the method further includes:
[0112] According to the words in the DSL language rules, the words are constructed into a word sequence in order;
[0113] Extracting syntax and semantics of word sequences;
[0114] Compare and analyze the grammar of the word sequence with the word sequence in the preset grammar compilation error list. If they are consistent, the grammar error index of the corresponding word sequence is set to 1; if they are inconsistent, the grammar error index of the corresponding word sequence is set to 0;
[0115] Compare and analyze the semantics of a word sequence with the semantics of adjacent word sequences to obtain the degree of association;
[0116] If the correlation is greater than or equal to the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 0; if the correlation is less than the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 1;
[0117] Multiplying the grammatical error index of the word sequence by a preset grammatical error weight coefficient to obtain a first value;
[0118] Multiplying the semantic error index of the word sequence by a preset semantic error weight coefficient to obtain a second value;
[0119] The first value and the second value are accumulated to obtain an error index of the corresponding word sequence;
[0120] When the error index of the word sequence is greater than or equal to a preset second error index threshold, corresponding word sequence error information is generated.
[0121] It should be noted that after obtaining the parsed DSL language rules, the parsed DSL language rules are optimized through Tailor (modified middleware), the parsed DSL language rules are divided into multiple word sequences, and the error index of the word sequence is calculated, and the error index of the word sequence is determined by a preset second error index threshold; the preset syntax compilation error list includes incorrect syntax applications of multiple word sequences; when a word sequence has only one adjacent word sequence, the corresponding correlation is the correlation between the corresponding two adjacent word sequences; when a word sequence has two adjacent word sequences, the corresponding correlation is the maximum correlation between the corresponding word sequence and the two adjacent word sequences.
[0122] According to an embodiment of the present invention, after generating the corresponding word sequence error information, the method further includes:
[0123] Extract words from DSL language rules;
[0124] According to the words in the DSL language rules, determine the corresponding word type;
[0125] Compare and analyze the word type with the word type in the preset type compilation error list, and if they are consistent, extract the probability value of the corresponding word type in the preset compilation error list and set it as the first probability value;
[0126] Extract the position of a word in a sequence of words;
[0127] Compare and analyze the position of the word in the word sequence with the word position in the preset position compilation error list, and if they are consistent, extract the probability value of the corresponding word position in the preset compilation error list and set it as the second probability value;
[0128] Multiplying the first probability value by a preset first probability weight coefficient to obtain a first error index value of the corresponding word;
[0129] Multiplying the second probability value by a preset second probability weight coefficient to obtain a second error index value of the corresponding word;
[0130] Accumulate the first error index value and the second error index value of the word to obtain the error index value of the corresponding word;
[0131] If the error index value of a word is greater than a preset first error index threshold, the corresponding word will be deleted and a warning message will be triggered.
[0132] It should be noted that the preset type compilation error list contains various word types and probability values of errors in the word types; the preset position compilation error list contains various word positions and probability values of errors in the word positions. The word is judged by calculating the error index value of the word and the preset first error index threshold. If the error index value of the word is greater than the preset first error index threshold, it means that there is an error in the corresponding word. Therefore, the corresponding word is deleted, and the triggered warning message is sent to the preset management terminal for display. The warning message includes the position of the corresponding error word.
[0133] Figure 2 A block diagram of SFCMake of the present invention is shown.
[0134] like Figure 2As shown, SFCMake (SFC generator) includes HTMLMake (SFC markup language generator), ScriptMake (SFC script language generator), Builder (compilation algorithm) and Tailor (modification middleware), among which SFCMake is responsible for generating complete SFC source code, including template and script parts, and can construct source code with different syntaxes, such as: js, js-setup; HTMLMake is responsible for generating low-code platform DSL view element data into SFC page templates; ScriptMake is responsible for generating low-code platform DSL interactive logic data into SFC page scripts; Builder is the core part of the algorithm; it is used to parse DSL language and generate SFC unit templates in combination with nodes, services and contexts in HTML; Tailor can remove sensitive information in DSL, optimize data structure and reduce source code volume.
[0135] Figure 3 A block diagram of a low-code platform multi-terminal source code compilation and generation system of the present invention is shown.
[0136] like Figure 3 As shown, the second aspect of the present invention provides a low-code platform multi-terminal source code compilation generation system 3, including a memory 31 and a processor 32, wherein the memory stores a low-code platform multi-terminal source code compilation generation method program, and the low-code platform multi-terminal source code compilation generation method program is executed by the processor to implement the following steps:
[0137] Get the low-code platform DSL language set by the user;
[0138] Extract view element data and interaction logic data in the low-code platform DSL language;
[0139] Based on the preset SFC markup language generator, generate SFC page templates according to view element data, and record the nodes, services and contexts required in the generation process;
[0140] Based on the preset SFC script language generator, the corresponding SFC page script is matched according to the interactive logic data;
[0141] Parse the low-code platform DSL language and generate an SFC unit template by combining nodes, services, and contexts;
[0142] The SFC page template, the SFC page script and the SFC unit template are combined to obtain the source code of the corresponding platform.
[0143] According to an embodiment of the present invention, the step of generating an SFC page template according to view element data specifically includes:
[0144] Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes;
[0145] Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes;
[0146] The number of nodes, services and contexts with different attributes are combined to obtain the SFC page template.
[0147] According to an embodiment of the present invention, after the SFC page script is generated, the following steps are specifically included:
[0148] Verify the execution function in the SFC page script and obtain the verification result;
[0149] Extract features and corresponding eigenvalues from verification results;
[0150] Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features;
[0151] Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature;
[0152] The weight scores of different features are accumulated to obtain the weight score of the SFC page script;
[0153] When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified;
[0154] If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information.
[0155] The present invention discloses a low-code platform multi-terminal source code compilation generation method and system, which can efficiently and reliably isomorphize the differences between DSL language and cross-platforms through a DSL-based SFC source code generation algorithm to achieve homogeneous reuse.
[0156] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0157] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0158] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0159] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0160] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A method for compiling and generating multi-terminal source code on a low-code platform, characterized in that: include: Get the low-code platform DSL language set by the user; Extract view element data and interaction logic data in the low-code platform DSL language; Based on the preset SFC markup language generator, generate SFC page templates according to view element data, and record the nodes, services and contexts required in the generation process; Based on the preset SFC script language generator, the corresponding SFC page script is matched according to the interactive logic data; Parse the low-code platform DSL language and generate an SFC unit template by combining nodes, services, and contexts; Combine the SFC page template, SFC page script and SFC unit template to obtain the source code of the corresponding platform; After the SFC page script is generated, it includes: Verify the execution function in the SFC page script and obtain the verification result; Extract features and corresponding eigenvalues from verification results; Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features; Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature; The weight scores of different features are accumulated to obtain the weight score of the SFC page script; When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified; If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information; The step of generating SFC page script adjustment information specifically includes: Compare and analyze the weight scores of the features to obtain the minimum weight score and the corresponding features; Determine the preset standard weight score of the corresponding feature according to the minimum weight score and the corresponding feature; Subtract the minimum weight score from the preset standard weight score of the corresponding feature to obtain the adjusted weight score of the corresponding feature; The adjustment weight score of the corresponding feature is multiplied by the preset precision weight coefficient to obtain the precision adjustment value of the corresponding feature rule generated by the SFC script language; Generate a precision adjustment value corresponding to the feature rule according to the SFC script language, and obtain corresponding SFC page script adjustment information.
2. According to claim 1, a low-code platform multi-terminal source code compilation and generation method is characterized in that: The step of generating the SFC page template according to the view element data specifically includes: Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes; Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes; Nodes, services and contexts with different attributes are combined according to corresponding quantities to obtain an SFC page template.
3. According to the method for compiling and generating multi-terminal source code on a low-code platform according to claim 1, it is characterized in that: The step of parsing the low-code platform DSL language and generating an SFC unit template in combination with nodes, services and contexts specifically includes: Based on the preset DSL syntax parsing rules, the low-code platform DSL language is parsed to obtain the parsed DSL language rules; Combine nodes, services and contexts according to the parsed DSL language rules to obtain the SFC unit template.
4. According to claim 3, a low-code platform multi-terminal source code compilation and generation method is characterized in that: After obtaining the parsed DSL language rules, the following steps are also included: According to the words in the DSL language rules, the words are constructed into a word sequence in order; Extracting syntax and semantics of word sequences; Compare and analyze the grammar of the word sequence with the word sequence in the preset grammar compilation error list. If they are consistent, the grammar error index of the corresponding word sequence is set to 1; if they are inconsistent, the grammar error index of the corresponding word sequence is set to 0; Compare and analyze the semantics of a word sequence with the semantics of adjacent word sequences to obtain the degree of association; If the correlation is greater than or equal to the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 0; if the correlation is less than the preset correlation threshold, the semantic error index of the corresponding word sequence is set to 1; Multiplying the grammatical error index of the word sequence by a preset grammatical error weight coefficient to obtain a first value; Multiplying the semantic error index of the word sequence by a preset semantic error weight coefficient to obtain a second value; The first value and the second value are accumulated to obtain an error index of the corresponding word sequence; When the error index of the word sequence is greater than or equal to a preset second error index threshold, corresponding word sequence error information is generated.
5. A method for compiling and generating multi-terminal source code on a low-code platform according to claim 4, characterized in that: After the corresponding word sequence error information is generated, the method further includes: Extract words from DSL language rules; According to the words in the DSL language rules, determine the corresponding word type; Compare and analyze the word type with the word type in the preset type compilation error list, and if they are consistent, extract the probability value of the corresponding word type in the preset compilation error list and set it as the first probability value; Extract the position of a word in a sequence of words; Compare and analyze the position of the word in the word sequence and the word position in the preset position compilation error list. If they are consistent, extract the probability value of the corresponding word position in the preset compilation error list and set it as the second probability value; Multiplying the first probability value by a preset first probability weight coefficient to obtain a first error index value of the corresponding word; Multiplying the second probability value by a preset second probability weight coefficient to obtain a second error index value of the corresponding word; Accumulate the first error index value and the second error index value of the word to obtain the error index value of the corresponding word; If the error index value of a word is greater than a preset first error index threshold, the corresponding word will be deleted and a warning message will be triggered.
6. A low-code platform multi-terminal source code compilation and generation system, characterized in that: The invention comprises a memory and a processor, wherein a low-code platform multi-terminal source code compilation generation method program is stored in the memory, and the low-code platform multi-terminal source code compilation generation method program is executed by the processor to implement the following steps: Get the low-code platform DSL language set by the user; Extract view element data and interaction logic data in the low-code platform DSL language; Based on the preset SFC markup language generator, generate SFC page templates according to view element data, and record the nodes, services and contexts required in the generation process; Based on the preset SFC script language generator, the corresponding SFC page script is matched according to the interactive logic data; Parse the low-code platform DSL language and generate an SFC unit template by combining nodes, services, and contexts; Combine the SFC page template, SFC page script and SFC unit template to obtain the source code of the corresponding platform; After the SFC page script is generated, it includes: Verify the execution function in the SFC page script and obtain the verification result; Extract features and corresponding eigenvalues from verification results; Based on the preset scoring rules, the features and corresponding feature values in the verification results are scored to obtain the scores of different features; Multiply the score of the feature by the weight coefficient of the corresponding feature to obtain the weight score of the corresponding feature; The weight scores of different features are accumulated to obtain the weight score of the SFC page script; When the weight score of the SFC page script is greater than or equal to the preset score threshold, the corresponding SFC page script is set as qualified; If the weight score of the SFC page script is less than the preset score threshold, SFC page script adjustment information is generated, and the SFC page script is adjusted according to the SFC page script adjustment information; The step of generating SFC page script adjustment information specifically includes: Compare and analyze the weight scores of the features to obtain the minimum weight score and the corresponding features; Determine the preset standard weight score of the corresponding feature according to the minimum weight score and the corresponding feature; Subtract the minimum weight score from the preset standard weight score of the corresponding feature to obtain the adjusted weight score of the corresponding feature; The adjustment weight score of the corresponding feature is multiplied by the preset precision weight coefficient to obtain the precision adjustment value of the corresponding feature rule generated by the SFC script language; Generate a precision adjustment value corresponding to the feature rule according to the SFC script language, and obtain corresponding SFC page script adjustment information.
7. A low-code platform multi-terminal source code compilation and generation system according to claim 6, characterized in that: The step of generating the SFC page template according to the view element data specifically includes: Extract data from the view element data, classify them according to different attributes, obtain data of different attributes, and record them in sequence to obtain the quantity values of data of different attributes; Based on the preset allocation weights, the quantity values of different attribute data are multiplied by the corresponding allocation weights to obtain the quantity of nodes, services, and contexts of different attributes; Nodes, services and contexts with different attributes are combined according to corresponding quantities to obtain an SFC page template.
Citation Information
Patent Citations
User interface generation method and device based on DSL and storage medium
CN111736834A
Front-end page generation method and device, equipment and medium
CN114385167A
Method and system for solving mutual conversion between DSL (Digital Subscriber Language) and Vue code
CN115951875A
File compiling system and method for low-code application program
CN116126347A
Development platform for page visual configuration and code writing
CN116301795A
