An expression generation method based on logic online editing component

Through the expression generation method based on the logical online editing component, the problems of complex configuration and high error rate caused by hard coding in the decision engine software are solved, low-code expression generation is realized, and the usability and flexibility of the decision engine are improved.

CN116166246BActive Publication Date: 2025-09-19RUIZHI HECHUANG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310040002.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-11
Publication Date
2025-09-19
Estimated Expiration
2043-01-11

AI Technical Summary

Technical Problem

The implementation of rule sets and functions in existing decision engine software requires hard coding, which leads to complex configuration, high cost, and is prone to coding errors, making it difficult to meet rapidly changing business needs.

Method used

An expression generation method based on logical online editing components is adopted. By obtaining language paragraphs from the natural language database, expression templates are established and combined and spliced. The decision engine is used to parse hierarchical dependencies and generate low-code program blocks.

Benefits of technology

It reduces the difficulty and error rate of coding modification, improves the flexibility and ease of configuration, broadens the scope of use of decision engine software, reduces code detail issues, and provides more decision-making methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116166246B_ABST
    Figure CN116166246B_ABST
Patent Text Reader

Abstract

The present invention provides an expression generation method based on a logic online editing component, comprising: obtaining a language paragraph from a natural language database, and establishing an expression template based on the language paragraph; selecting a target expression template that meets the business scenario from the expression template, and combining and splicing the target expression template to obtain a template chain combination; parsing the hierarchical dependency relationship of the template chain combination through a decision engine to obtain a low-code program block. The expression generated by the present invention is easy to understand, easy to operate, flexible in configuration, and has a lower degree of coupling, which provides decision engine users with more decision-making possibilities in daily work and production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for generating an expression of a logic online editing component. Background Art

[0002] The current decision engine software uses a single hard-coded language to implement rule sets, functions, and other methods. Engine operators adapt existing rule sets, functions, and other methods to provide new rule functions and other methods required in actual production. If there are major changes, they need to be re-encoded and re-implemented based on the existing personnel's familiarity with the language.

[0003] The configuration of rule sets, functions and other methods requires users to master coding skills and the ability to write or modify in a specified language. The cost of daily business use is high, and the implementation and configuration modes are relatively complex. During the code modification process, users need to repeatedly check and confirm whether there are subtle internal errors in the code updates (for example: whether there are misspelled names of data variables, incorrect definitions of referenced variables, incorrect variable types, missing function parameter passing, encoding format errors in code paragraphs, and programming symbol writing errors in code paragraphs) to ensure the basic accuracy of rule sets and function methods. Even after ensuring the basic accuracy, they will still face other data detail issues that require a lot of verification to discover. Summary of the Invention

[0004] The present invention provides an expression generation method based on a logic online editing component, which makes the generated expression easy to understand, convenient to operate, flexible in configuration, and has a lower coupling degree.

[0005] An expression generation method based on a logic online editing component, comprising:

[0006] S1: Obtain a language paragraph from a natural language database, and create an expression template based on the language paragraph;

[0007] S2: Selecting a target expression template that meets the business scenario from the expression templates, and combining and splicing the target expression templates to obtain a template chain combination;

[0008] S3: The hierarchical dependencies of the template chain combination are parsed through the decision engine to obtain low-code program blocks.

[0009] Preferably, in S1, establishing an expression template based on the language paragraph includes:

[0010] Extracting logical keywords from the language paragraph as main keywords;

[0011] extracting auxiliary keywords from the language paragraph as secondary keywords;

[0012] Extracting main keywords from the language paragraph as atomic keywords;

[0013] A primary expression template, a secondary expression template and an atomic expression template are respectively established based on the primary keyword, secondary keyword and atomic keyword.

[0014] Preferably, in S2, selecting a target expression template that meets the business scenario from the expression templates includes:

[0015] Splitting the business data in the business scenario according to the data structure to obtain multiple groups of structured data;

[0016] Extracting semantic features from the multiple sets of structural data, matching them with keyword features of the expression templates, and determining target expression templates corresponding to the multiple sets of structural data;

[0017] When no expression template corresponding to the structural data can be matched from the expression templates, a corresponding atomic-level expression template is established according to the semantic features of the structural data as a target expression template for the structural data.

[0018] Preferably, in S2, the target expression templates are combined and spliced ​​to obtain a template chain combination, including:

[0019] According to template attributes, the target expression template is divided into a primary target template, a secondary target template and an atomic target template;

[0020] Based on the template features of the historical target expression template, determining the first inter-layer evaluation index of the main target template, the second inter-layer evaluation index of the secondary target template and the third inter-layer evaluation index of the atomic-level target template, and based on the operation data of the historical target expression template, determining the first-level evaluation index between the main target template and the secondary target template, and the second-level evaluation index between the secondary target template and the atomic-level target template;

[0021] A template chain combination is obtained based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index, and the second-level evaluation index.

[0022] Preferably, based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index and the second-level evaluation index, a template chain combination is obtained, including:

[0023] Based on the first inter-layer evaluation index, the second inter-layer evaluation index and the first-level evaluation index, a first evaluation system is established between the primary target template and the secondary target template; based on the second inter-layer evaluation index, the third inter-layer evaluation index and the second-level evaluation index, a second evaluation system is established between the secondary target template and the atomic-level target template;

[0024] Based on program logic, the target expression templates are combined and spliced ​​to obtain multiple groups of initial template chain combinations;

[0025] Based on the first evaluation system and the second evaluation system, a template chain combination is selected from the multiple groups of initial template chain combinations.

[0026] Preferably, based on the first evaluation system and the second evaluation system, the template chain combination is selected from the multiple groups of initial template chain combinations, including:

[0027] Based on the first evaluation system, a first evaluation index value of the initial template chain combination is calculated, and an initial template chain combination whose first evaluation index value is greater than a preset first index value is selected as a first selected chain combination;

[0028] Based on the second evaluation system, a second evaluation index value of the first selection chain combination is calculated, and the first selection chain combination whose second evaluation index value is greater than a preset second index value is selected as the second selection chain combination; based on the correspondence between the template features and the operation data, a weighted value is set for the target expression template, and based on the weighted value, the first evaluation index value and the second evaluation index value, a comprehensive evaluation value of the second selection chain combination is obtained;

[0029] The chain combination with the largest comprehensive evaluation value is selected from the second selected chain combinations as the final template chain combination.

[0030] Preferably, in S3, the hierarchical dependency relationship of the template chain combination is parsed by the decision engine to obtain a low-code program block, including:

[0031] Determining a hierarchical dependency relationship of the template chain combination based on template splicing combination information in the template chain combination;

[0032] Based on the hierarchical dependency, the template chain combination is decomposed to obtain multiple groups of paragraphs, and the multiple groups of paragraphs are graded according to the logical relationships between the multiple groups of paragraphs to obtain hierarchical paragraphs;

[0033] Based on the matching of the hierarchical paragraphs with the pre-designed code generation template, sub-code program blocks are obtained, and low-code program blocks are composed based on the sub-code program blocks.

[0034] Preferably, the sub-code program blocks are obtained based on matching the hierarchical paragraphs with pre-designed code generation templates, including:

[0035] Selecting the lowest-level paragraph and matching it with a pre-designed code generation template to obtain a target code template, parsing the lowest-level paragraph using a decision engine to obtain a first code content, and filling the first code content into a replacement identifier position of the target code template to obtain a first sub-low code block;

[0036] Match the level paragraphs in order from low to high levels with the corresponding target code templates, use the decision engine to parse the level paragraphs to obtain the second code content, and use the decision engine to fill the code content and the adjacent low-level first sub-low code block related to the corresponding target code template into the replacement identification position of the corresponding target code template to obtain the second sub-low code block.

[0037] Preferably, the low-code program block is formed based on the sub-code program block, including:

[0038] Combining the first low-code sub-block, the second low-code sub-block, and the low-code sub-block corresponding to each level segment to obtain an initial low-code block;

[0039] Based on the logic definition, the initial low-code block is logically analyzed in descending order to determine whether the logic between the sub-low-code blocks or code contents at the replacement identification position is reasonable;

[0040] If so, determining that the initial low-code block is a low-code program block;

[0041] Otherwise, based on the logic analysis results, the logic differences are determined, and based on the logic differences, the sub-low-code blocks or code contents corresponding to the unreasonable replacement identification positions are replaced to obtain new low-code blocks as low-code program blocks.

[0042] Preferably, in S3, the low-code program block is the expression ultimately generated based on the logic online editing component.

[0043] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0044] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0046] Figure 1 This is a flow chart of a method for generating an expression based on a logic online editing component in an embodiment of the present invention;

[0047] Figure 2 A flowchart of selecting a target expression template in an embodiment of the present invention;

[0048] Figure 3 A flowchart for obtaining low-code program blocks in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0050] Example 1

[0051] The embodiment of the present invention provides an expression generation method based on a logic online editing component, such as Figure 1 As shown, including:

[0052] S1: Obtain a language paragraph from a natural language database, and create an expression template based on the language paragraph;

[0053] S2: Selecting a target expression template that meets the business scenario from the expression templates, and combining and splicing the target expression templates to obtain a template chain combination;

[0054] S3: The hierarchical dependencies of the template chain combination are parsed through the decision engine to obtain low-code program blocks.

[0055] In this embodiment, the expression template is composed of a main expression template, a secondary expression template and an atomic-level expression template, and has actual linguistic meaning. For example, "If the number of apples I eat today is greater than 3, then my physical health score increases by 1 point", where "if...then..." is regarded as the main expression template, "...is greater than..." belongs to the secondary expression template, and "the apples I ate today" is regarded as the atomic-level expression template.

[0056] In this embodiment, the primary expression template, the secondary expression template, and the atomic expression template are all applicable to the learning of natural language, and can be used to calculate at least n*m*o language matching combinations. Any number of primary expression templates and secondary expression templates can be nested between the root node of each expression and the atomic expression template to achieve the desired complex natural language expression. These complex natural language expressions can be used to verify complex rule sets and function templates. At the same time, the expression for such complex natural language expressions also allows the reference of established function expressions to reduce the difficulty of natural language reading of the expression.

[0057] In this embodiment, various chain combinations formed by primary expression template-secondary expression template-atomic expression template can form a higher degree of logic customization.

[0058] In this embodiment, the code block is the expression form that satisfies the business scenario.

[0059] The beneficial effects of the above design scheme are: the present invention adopts natural language splicing to form language paragraphs that are easy for humans to read, operate and change, and reduces the many problems that may exist in coding modification by users through the highly stable text parsing and low-code block generation behind the interface of the decision engine software, greatly improving the basic accuracy of users in writing rule sets and function methods. The data detail problems of the code blocks behind the text paragraphs formed by this scheme have been greatly reduced compared with the existing technology after careful testing; the text paragraphs composed of expressions through expression templates are easy to understand, easy to operate, flexible in configuration, and highly extensible, which greatly improves the ease of use of the current decision engine software and broadens the scope of use of the current decision engine software. The logical clarity brought by the expression can bring a lot of invisible decision-making ideas to the users of the decision engine. Help. After mastering the expression logic of this expression, users of the decision engine software can also quickly convert other decision-making programming statements into the expression of the decision engine expression. Due to the low-code nature of the overall decision-making component, the programming code blocks formed by translating the decision engine expression have a lower degree of coupling than the original decision-making programming statements. This also provides decision engine users with more decision-making possibilities in their daily work and production.

[0060] Example 2

[0061] Based on Example 1, this embodiment of the present invention provides an expression generation method based on a logic online editing component. In S1, an expression template is established based on the language paragraph, including:

[0062] Extracting logical keywords from the language paragraph as main keywords;

[0063] extracting auxiliary keywords from the language paragraph as secondary keywords;

[0064] Extracting main keywords from the language paragraph as atomic keywords;

[0065] A primary expression template, a secondary expression template and an atomic expression template are respectively established based on the primary keyword, secondary keyword and atomic keyword.

[0066] In this embodiment, for example, the language paragraph is "If the number of apples I eat today is greater than 3, then my physical health score increases by 1 point", where "if...then..." is regarded as a logical keyword, serving as the main expression template, "...is greater than..." is an auxiliary keyword, serving as a secondary expression template, and "the apples I ate today" is a main keyword, which is regarded as an atomic-level expression template.

[0067] The beneficial effect of the above design scheme is: by performing various extractions based on language paragraphs to establish different expression templates, a template basis is provided for establishing expressions that meet different business scenarios.

[0068] Example 3

[0069] Based on Example 1, the embodiment of the present invention provides an expression generation method based on a logic online editing component, such as Figure 2 As shown, in S2, a target expression template that meets the business scenario is selected from the expression template, including:

[0070] S201: Split the business data in the business scenario according to the data structure to obtain multiple groups of structured data;

[0071] S202: extracting semantic features from the multiple sets of structural data, matching them with keyword features of the expression template, and determining target expression templates corresponding to the multiple sets of structural data;

[0072] S203: When no expression template corresponding to the structural data can be matched from the expression templates, a corresponding atomic-level expression template is established according to the semantic features of the structural data as a target expression template for the structural data.

[0073] In this embodiment, due to the continuous updating of business scenarios, the pre-established expression templates may not be able to fully match the business scenarios. Therefore, it is necessary to establish new expression templates according to the needs of the business scenarios, and such templates are usually atomic-level expression templates.

[0074] The beneficial effect of the above design scheme is: by splitting the business data in the business scenario according to the data structure, the target expression templates are matched one by one, and when the expression template corresponding to the structural data cannot be matched in the expression template, the corresponding atomic-level expression template is established according to the semantic characteristics of the structural data as the target expression template of the structural data, ensuring that the obtained target expression template can meet the needs of the business scenario.

[0075] Example 4

[0076] Based on Example 1, this embodiment of the present invention provides an expression generation method based on a logic online editing component. In S2, the target expression templates are combined and spliced ​​to obtain a template chain combination, including:

[0077] According to template attributes, the target expression template is divided into a primary target template, a secondary target template and an atomic target template;

[0078] Based on the template features of the historical target expression template, determining the first inter-layer evaluation index of the main target template, the second inter-layer evaluation index of the secondary target template and the third inter-layer evaluation index of the atomic-level target template, and based on the operation data of the historical target expression template, determining the first-level evaluation index between the main target template and the secondary target template, and the second-level evaluation index between the secondary target template and the atomic-level target template;

[0079] A template chain combination is obtained based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index, and the second-level evaluation index.

[0080] In this embodiment, the inter-layer evaluation index is an evaluation of the target expression template itself, and the inter-layer evaluation index includes: the number of template paragraphs, template language features, the number of template historical uses, etc.

[0081] In this embodiment, the hierarchical evaluation index is an evaluation of the connection relationship between the main target template and the secondary target template or between the secondary target template and the atomic-level target template. The hierarchical evaluation index includes, for example: the number of hierarchical combinations (the number of main target templates combined with secondary target templates, the number of secondary target templates combined with atomic-level target templates), hierarchical operation status, hierarchical logical characteristics, etc.

[0082] The beneficial effect of the above design scheme is: by determining the inter-layer evaluation indicators and hierarchical evaluation indicators between the target expression templates based on the template characteristics and operation data of the historical target expression templates, and then determining the first-level evaluation indicators between the main target template and the secondary target template, as well as the second-level evaluation indicators between the secondary target template and the atomic-level target template, providing an evaluation basis for the combination and splicing of target expression templates, so that the final template chain combination is easy to understand, easy to operate, flexible in configuration, and highly extensible. The logical clarity brought by the expression can bring a lot of invisible decision-making help to the users of the decision engine.

[0083] Example 5

[0084] Based on Example 4, an embodiment of the present invention provides an expression generation method based on a logic online editing component, characterized in that a template chain combination is obtained based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index, and the second-level evaluation index, including:

[0085] Based on the first inter-layer evaluation index, the second inter-layer evaluation index and the first-level evaluation index, a first evaluation system is established between the primary target template and the secondary target template; based on the second inter-layer evaluation index, the third inter-layer evaluation index and the second-level evaluation index, a second evaluation system is established between the secondary target template and the atomic-level target template;

[0086] Based on program logic, the target expression templates are combined and spliced ​​to obtain multiple groups of initial template chain combinations;

[0087] Based on the first evaluation system and the second evaluation system, a template chain combination is selected from the multiple groups of initial template chain combinations.

[0088] In this embodiment, the first evaluation index value is used to evaluate the main target template and the secondary target template. The better the connection relationship between the main target template and the secondary target template, the larger the corresponding first evaluation index value. The second evaluation index value is used to evaluate the secondary target template and the atomic-level target template.

[0089] The beneficial effects of the above design scheme are: according to the program logic, the target expression templates are combined and spliced ​​to obtain multiple groups of initial template chain combinations, and the multiple groups of initial template chain combinations are evaluated according to the previously set evaluation indicators to obtain evaluation values, and the second selection chain combination is preliminarily selected to ensure the quality of the second selection chain combination, providing a basis for selecting a suitable template chain combination.

[0090] Example 6

[0091] Based on Example 5, an embodiment of the present invention provides an expression generation method based on a logic online editing component, which selects a template chain combination from the multiple groups of initial template chain combinations based on a first evaluation system and a second evaluation system, including:

[0092] Based on the first evaluation system, a first evaluation index value of the initial template chain combination is calculated, and an initial template chain combination whose first evaluation index value is greater than a preset first index value is selected as a first selected chain combination;

[0093] Calculate the first evaluation index value according to the following formula:

[0094]

[0095] Wherein, F1 represents the first evaluation index value, p represents the number of the first-level evaluation indexes, m represents the number of the first inter-layer evaluation indexes or the second inter-layer evaluation indexes, δ a Indicates the weight value of the first-level evaluation index a, which is (0, 1), R a represents the value of the first-level evaluation index, which is (0, 1), ΔR represents the value of the reference level evaluation index, which is (0, 1), τ j Indicates the weight value of the jth first-layer evaluation index or the second-layer evaluation index, which takes the value of (0, 1). G 2j Indicates the value of the j-th second-layer evaluation index, which is (0, 1). G 1j represents the value of the jth first inter-layer evaluation index, which is (0, 1); ΔG represents the value of the reference inter-layer evaluation index, which is (0, 1);

[0096] Based on the second evaluation system, a second evaluation index value of the first selected chain combination is calculated, and the first selected chain combination whose second evaluation index value is greater than the preset second index value is selected as the second selected chain combination;

[0097] The second evaluation index value is calculated according to the following formula:

[0098]

[0099] Wherein, F2 represents the second evaluation index value, n represents the number of the second-level evaluation indexes, m represents the number of the second-layer evaluation indexes or the third-layer evaluation indexes, δ i Indicates the weight value of the i-th second-level evaluation index, which is (0, 1). i represents the value of the second-level evaluation index of the i-th level, which is (0, 1), ΔR represents the value of the reference level evaluation index, which is (0, 1), τ jIndicates the weight value of the jth second-layer evaluation index or the third-layer evaluation index, which takes the value of (0, 1). G 2j Indicates the value of the j-th second-layer evaluation index, which is (0, 1). G 3j represents the value of the jth third inter-layer evaluation index, which is (0, 1); ΔG represents the value of the reference inter-layer evaluation index, which is (0, 1);

[0100] Setting a weighted value for the target expression template based on the correspondence between the template features and the running data;

[0101] Obtaining a comprehensive evaluation value of the second selected chain combination based on the weighted value, the first evaluation index value, and the second evaluation index value;

[0102] The comprehensive evaluation value is calculated according to the following formula:

[0103]

[0104] Wherein, F represents the comprehensive evaluation value of the second selection chain combination, k represents the number of first target expression templates related to the first evaluation system, γ w Represents the weighted value of the w-th first target expression template, which is (0, 1). represents the average index value of the wth first target expression template, which is (0, 1), h represents the number of second target expression templates related to the second evaluation system, γ r Represents the weighted value of the rth second target expression template, which is (0, 1). represents the average index value of the rth second target expression template, and its value is (0, 1);

[0105] The chain combination with the largest comprehensive evaluation value is selected from the second selected chain combinations as the final template chain combination.

[0106] In this embodiment, the correspondence between the template features and the operation data is specifically that the better the operation result indicated by the operation data corresponding to the template features, the greater the weighted value set for the corresponding target expression template.

[0107] In this embodiment, based on the weighted value, the first evaluation index value and the second evaluation index value, the comprehensive evaluation value of the second selection chain combination is obtained, for example, by weighting the first evaluation index value and the second evaluation index value using the weighted value to obtain a weighted evaluation value, and taking the sum of the weighted evaluation values ​​as the comprehensive evaluation value.

[0108] In this embodiment, the number of the first inter-layer evaluation indicators, the second inter-layer evaluation indicators, and the third inter-layer evaluation indicators is the same.

[0109] In this embodiment, the reference inter-layer evaluation index value and the reference level evaluation index value are specifically set according to actual conditions.

[0110] The beneficial effect of the above design scheme is as follows: by determining the inter-layer evaluation indicators and hierarchical evaluation indicators between the target expression templates based on the template features and operation data of the historical target expression templates, and then determining the first-level evaluation indicators between the main target template and the secondary target template, and the second-level evaluation indicators between the secondary target template and the atomic-level target template, providing an evaluation basis for the combination and splicing of the target expression templates, and then combining and splicing the target expression templates according to the program logic to obtain multiple groups of initial template chain combinations, evaluating the multiple groups of initial template chain combinations according to the previously set evaluation indicators to obtain evaluation values, preliminarily selecting a second selection chain combination, and then setting a weighted value for the target expression template based on the correspondence between the template features and the operation data to obtain a comprehensive evaluation value of the second selection chain combination, ensuring that the comprehensive evaluation value of the second selection chain combination can more accurately represent the combined evaluation result of the second selection chain combination, and finally obtaining a template chain combination that is easy to understand, easy to operate, flexible in configuration, and highly scalable. The logical clarity brought by the expression can provide a lot of invisible help to the users of the decision engine in decision-making ideas.

[0111] Example 7

[0112] Based on Example 1, the embodiment of the present invention provides an expression generation method based on a logic online editing component, such as Figure 3 As shown, in S3, the decision engine parses the hierarchical dependencies of the template chain combination to obtain low-code program blocks, including:

[0113] S301: Determine the hierarchical dependency relationship of the template chain combination based on the template splicing combination information in the template chain combination;

[0114] S302: Based on the hierarchical dependency, the template chain combination is decomposed to obtain multiple groups of paragraphs, and the multiple groups of paragraphs are graded according to the logical relationships between the multiple groups of paragraphs to obtain graded paragraphs;

[0115] S303: Matching the hierarchical paragraphs with a pre-designed code generation template to obtain sub-code program blocks, and forming low-code program blocks based on the sub-code program blocks.

[0116] In this embodiment, the hierarchical dependency relationship is specifically the relationship between target expression templates, such as a parallel relationship, a master-slave relationship, and a mergeable relationship.

[0117] In this embodiment, the pre-designed code generation templates are all fixed JSON structures built into the templates, which greatly reduces the difficulty of technical operations of program language logic for personnel using the decision engine software, and also greatly reduces the time required for personnel using the decision engine software to create and maintain decision components.

[0118] The beneficial effects of the above design scheme are: by parsing the hierarchical dependencies of the template chain combination through the decision engine, a low-code program block is obtained, and with a code amount close to zero, the effect of the rule set and method within the engine system that can only be achieved with a large amount of code is achieved using human-readable language. The text paragraphs composed of expressions through expression templates are easy to understand, easy to operate, flexible to configure, and highly scalable, which greatly improves the usability of the current decision engine software and broadens the scope of use of the current decision engine software; due to the low-code nature of the overall decision component, the programming code blocks formed by the decision engine expression translation have a lower degree of coupling than the original decision-making programming statements, which also provides decision engine users with more decision-making possibilities in their daily work and production.

[0119] Example 8

[0120] Based on Example 7, the embodiment of the present invention provides an expression generation method based on a logic online editing component, which matches the hierarchical paragraphs with a pre-designed code generation template to obtain a sub-code program block, including:

[0121] Selecting the lowest-level paragraph and matching it with a pre-designed code generation template to obtain a target code template, parsing the lowest-level paragraph using a decision engine to obtain a first code content, and filling the first code content into a replacement identifier position of the target code template to obtain a first sub-low code block;

[0122] Match the level paragraphs in order from low to high levels with the corresponding target code templates, use the decision engine to parse the level paragraphs to obtain the second code content, and use the decision engine to fill the code content and the adjacent low-level first sub-low code block related to the corresponding target code template into the replacement identification position of the corresponding target code template to obtain the second sub-low code block.

[0123] In this embodiment, the pre-designed code generation templates are all fixed JSON structures built into the templates, which greatly reduces the difficulty of technical operations of program language logic for personnel using the decision engine software, and also greatly reduces the time required for personnel using the decision engine software to create and maintain decision components.

[0124] The beneficial effect of the above design scheme is: by matching the target code template for the level paragraph from bottom to top starting from the lowest level paragraph, and inputting the code content or directly low-level sub-program block for the replacement identification position of the target code template, the logical correctness of the obtained sub-low-code block is guaranteed from bottom to top, providing a basis for the determination of the low-code program block.

[0125] Example 9

[0126] Based on Example 8, an embodiment of the present invention provides an expression generation method based on a logic online editing component, which is based on the sub-code program block to form a low-code program block, including:

[0127] Combining the first low-code sub-block, the second low-code sub-block, and the low-code sub-block corresponding to each level segment to obtain an initial low-code block;

[0128] Based on the logic definition, the initial low-code block is logically analyzed in descending order to determine whether the logic between the sub-low-code blocks or code contents at the replacement identification position is reasonable;

[0129] If so, determining that the initial low-code block is a low-code program block;

[0130] Otherwise, based on the logic analysis results, the logic differences are determined, and based on the logic differences, the sub-low-code blocks or code contents corresponding to the unreasonable replacement identification positions are replaced to obtain new low-code blocks as low-code program blocks.

[0131] In this embodiment, an initial low-code block is generated in order of level paragraphs from low to high, and then the initial low-code block is logically checked in order of level from high to low to ensure the comprehensive logical rationality of the obtained low-code program block.

[0132] In this embodiment, the logical difference replaces the sub-low code block or code content corresponding to the unreasonable replacement identification position, which can be by exchanging the sub-low code block or code content corresponding to the replacement identification position with the content at other replacement identification positions, deleting the sub-low code block or code content corresponding to the replacement identification position, etc.

[0133] The beneficial effects of the above design scheme are: by parsing the hierarchical dependencies of the template chain combination through the decision engine, a low-code program block is obtained, and with a code amount close to zero, the effect of the rule set and method within the engine system that can only be achieved with a large amount of code is achieved using human-readable language. The text paragraphs composed of expressions through expression templates are easy to understand, easy to operate, flexible to configure, and highly scalable, which greatly improves the usability of the current decision engine software and broadens the scope of use of the current decision engine software; due to the low-code nature of the overall decision component, the programming code blocks formed by the decision engine expression translation have a lower degree of coupling than the original decision-making programming statements, which also provides decision engine users with more decision-making possibilities in their daily work and production.

[0134] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for generating an expression based on a logic online editing component, characterized in that: include: S1: Obtain a language paragraph from a natural language database, and create an expression template based on the language paragraph; S2: Selecting a target expression template that meets the business scenario from the expression templates, and combining and splicing the target expression templates to obtain a template chain combination, including: According to template attributes, the target expression template is divided into a primary target template, a secondary target template and an atomic target template; Based on the template features of the historical target expression template, determining the first inter-layer evaluation index of the main target template, the second inter-layer evaluation index of the secondary target template and the third inter-layer evaluation index of the atomic-level target template, and based on the operation data of the historical target expression template, determining the first-level evaluation index between the main target template and the secondary target template, and the second-level evaluation index between the secondary target template and the atomic-level target template; Obtaining a template chain combination based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index, and the second-level evaluation index; S3: The hierarchical dependencies of the template chain combination are parsed through the decision engine to obtain low-code program blocks.

2. The expression generation method based on the logic online editing component according to claim 1, characterized in that: In S1, based on the language paragraph, an expression template is established, including: Extracting logical keywords from the language paragraph as main keywords; extracting auxiliary keywords from the language paragraph as secondary keywords; Extracting main keywords from the language paragraph as atomic keywords; A primary expression template, a secondary expression template and an atomic expression template are respectively established based on the primary keyword, secondary keyword and atomic keyword.

3. The expression generation method based on the logic online editing component according to claim 1 is characterized in that: In S2, a target expression template that meets the business scenario is selected from the expression templates, including: Splitting the business data in the business scenario according to the data structure to obtain multiple groups of structured data; Extracting semantic features from the multiple sets of structural data, matching them with keyword features of the expression templates, and determining target expression templates corresponding to the multiple sets of structural data; When no expression template corresponding to the structural data can be matched from the expression templates, a corresponding atomic-level expression template is established according to the semantic features of the structural data as a target expression template for the structural data.

4. The expression generation method based on the logic online editing component according to claim 1 is characterized in that: Based on the first inter-layer evaluation index, the second inter-layer evaluation index, the third inter-layer evaluation index, the first-level evaluation index, and the second-level evaluation index, a template chain combination is obtained, including: Based on the first inter-layer evaluation index, the second inter-layer evaluation index and the first-level evaluation index, a first evaluation system is established between the primary target template and the secondary target template; based on the second inter-layer evaluation index, the third inter-layer evaluation index and the second-level evaluation index, a second evaluation system is established between the secondary target template and the atomic-level target template; Based on program logic, the target expression templates are combined and spliced ​​to obtain multiple groups of initial template chain combinations; Based on the first evaluation system and the second evaluation system, a template chain combination is selected from the multiple groups of initial template chain combinations.

5. The expression generation method based on the logic online editing component according to claim 4 is characterized in that: Based on the first evaluation system and the second evaluation system, a template chain combination is selected from the multiple groups of initial template chain combinations, including: Based on the first evaluation system, a first evaluation index value of the initial template chain combination is calculated, and an initial template chain combination whose first evaluation index value is greater than a preset first index value is selected as a first selected chain combination; Based on the second evaluation system, a second evaluation index value of the first selection chain combination is calculated, and the first selection chain combination whose second evaluation index value is greater than a preset second index value is selected as the second selection chain combination; based on the correspondence between the template features and the operation data, a weighted value is set for the target expression template, and based on the weighted value, the first evaluation index value and the second evaluation index value, a comprehensive evaluation value of the second selection chain combination is obtained; The chain combination with the largest comprehensive evaluation value is selected from the second selected chain combinations as the final template chain combination.

6. The expression generation method based on the logic online editing component according to claim 1 is characterized in that: In S3, the decision engine parses the hierarchical dependencies of the template chain combination to obtain low-code program blocks, including: Determining a hierarchical dependency relationship of the template chain combination based on template splicing combination information in the template chain combination; Based on the hierarchical dependency, the template chain combination is decomposed to obtain multiple groups of paragraphs, and the multiple groups of paragraphs are graded according to the logical relationships between the multiple groups of paragraphs to obtain hierarchical paragraphs; Based on the matching of the hierarchical paragraphs with the pre-designed code generation template, sub-code program blocks are obtained, and low-code program blocks are composed based on the sub-code program blocks.

7. The expression generation method based on the logic online editing component according to claim 6 is characterized in that: Based on the matching of the hierarchical paragraphs with the pre-designed code generation template, a sub-code program block is obtained, including: Selecting the lowest-level paragraph and matching it with a pre-designed code generation template to obtain a target code template, parsing the lowest-level paragraph using a decision engine to obtain a first code content, and filling the first code content into a replacement identifier position of the target code template to obtain a first sub-low code block; Match the level paragraphs in order from low to high levels with the corresponding target code templates, use the decision engine to parse the level paragraphs to obtain the second code content, and use the decision engine to fill the code content and the adjacent low-level first sub-low code block related to the corresponding target code template into the replacement identification position of the corresponding target code template to obtain the second sub-low code block.

8. The expression generation method based on the logic online editing component according to claim 7 is characterized in that: The low-code program blocks are formed based on the sub-code program blocks, including: Combining the first low-code sub-block, the second low-code sub-block, and the low-code sub-block corresponding to each level segment to obtain an initial low-code block; Based on the logic definition, the initial low-code block is logically analyzed in descending order to determine whether the logic between the sub-low-code blocks or code contents at the replacement identification position is reasonable; If so, determining that the initial low-code block is a low-code program block; Otherwise, based on the logic analysis results, the logic differences are determined, and based on the logic differences, the sub-low-code blocks or code contents corresponding to the unreasonable replacement identification positions are replaced to obtain new low-code blocks as low-code program blocks.

9. The expression generation method based on the logic online editing component according to claim 1 is characterized in that: In S3, the low-code program block is the expression ultimately generated based on the logic online editing component.

Citation Information

Patent Citations

  • Decision configuration method, service decision method and decision engine system

    CN112394922A

  • Decision analysis system and method

    US20040103058A1