Vue-based data operation expression construction method and system and storage medium

Through the VUE component generation rule tree editor, users can intuitively construct and convert operation expressions, solving the efficiency and accuracy problems when inputting operation expressions in the prior art, and achieving efficient and accurate data scope construction.

CN118885641APending Publication Date: 2024-11-01CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411023094.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In big data products, users are prone to errors and take a long time when entering operation expressions in data ranges. Especially in complex business scenarios, the existing technology is difficult to ensure high efficiency and accuracy.

Method used

Generate a rule tree editor through VUE components, including logical operator nodes, expression nodes and operation nodes, providing keyword selection lists and constraint nodes, and users can intuitively build operation expressions and convert them into characters recognized by the database. String expression.

Benefits of technology

It significantly improves the work efficiency and accuracy of users when entering operational expressions, simplifies the construction process of complex expressions, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885641A_ABST
    Figure CN118885641A_ABST
Patent Text Reader

Abstract

The invention discloses a Vue-based data operation expression construction method and system and a storage medium, and relates to the field of data query. The method comprises the following steps: generating a rule tree editor through a VUE component; the rule tree editor comprises a rule tree, and the structure of the rule tree comprises a logic operator node, an expression node and an operation node; the expression node is used for inputting an operation expression and comprises a keyword selection list node, a keyword remark information node and a constraint condition node between a keyword and remark information; the operation node is used for newly adding a rule tree or an expression node; and the logic operator node is used for providing constraint conditions among the rule trees. According to the rule tree editor formed in this way, a user can efficiently and accurately input multiple operation expressions, then the working efficiency and accuracy are remarkably improved, and the user experience is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data query, and in particular to a method, system and storage medium for constructing data operation expressions based on Vue (a progressive framework for constructing user interfaces). Background Art

[0002] In big data products, there are many requirements for users to determine the data range. Generally, the data range is concretely displayed in the form of an operation expression, which is often the where part in the SQL (Structured Query Language) expression; for example, t1.number+t2.number<100and t1.number=50andt2.number>10, t1 represents males and t2 represents females, which means: the number of males and females is less than 100, the number of males is 50, and the number of females is greater than 10. This kind of expression is generally long and boring, and it is very cumbersome in some complex business scenarios. If users are not familiar with the operator priority and enter it directly, it is very easy to make mistakes. Even if they understand it, entering and checking it will take a lot of time. Summary of the invention

[0003] In view of the defects existing in the prior art, the technical problem solved by the present invention is to provide a method for constructing an operation expression with high working efficiency and accuracy.

[0004] In a first aspect, an embodiment of the present application provides a method for constructing a data operation expression based on VUE, comprising the following steps: generating a rule tree editor through a VUE component; the rule tree editor comprises a rule tree, the structure of the rule tree comprises a logic operator node, an expression node and an operation node; the expression node is used to input an operation expression, which comprises a keyword selection list node, a keyword remark information node, and a constraint condition node between the keyword and the remark information; the operation node is used to add a rule tree or an expression node; the logic operator node is used to provide constraints between rule trees.

[0005] In combination with the first aspect, in one implementation, the method further includes the following steps: converting the completed operation expression input into the rule tree editor into a string expression that can be recognized by the database.

[0006] In combination with the first aspect, in one implementation, the method further includes the following steps: converting the string expression into an operation expression and displaying the expression in the rule tree editor.

[0007] In combination with the first aspect, in one implementation, the expression node further includes a delete expression node, which is used to delete an expression.

[0008] In combination with the first aspect, in one implementation, the specific process of generating a rule tree editor through the VUE component includes: generating corresponding tree structure data according to the structure of the rule tree through the VUE component, rendering the tree structure, and obtaining a visual operation interface of the rule tree editor.

[0009] In a second aspect, an embodiment of the present application provides a computer-readable storage medium, on which a VUE-based data operation expression construction program is stored. When the VUE-based data operation expression construction program is executed, the steps of the VUE-based data operation expression construction method provided in the first aspect are implemented.

[0010] In a third aspect, an embodiment of the present application provides a data operation expression construction system based on VUE, including a rendering component index, which is used to: generate a rule tree editor through a VUE component; the rule tree editor includes a rule tree, and the structure of the rule tree includes a logical operator node, an expression node and an operation node; the expression node is used to input an operation expression, which includes a keyword selection list node, a keyword remark information node, and a constraint condition node between keywords and remark information; the operation node is used to add a new rule tree or expression node; the logical operator node is used to provide constraints between rule trees.

[0011] In combination with the third aspect, in one embodiment, the system also includes an expression conversion component, which is used to: input a completed operation expression in the rule tree editor and convert it into a string expression that can be recognized by the database; convert the string expression into an operation expression and display it in the rule tree editor.

[0012] In conjunction with the third aspect, in one implementation, the rendering component includes:

[0013] A logical operator component, which is used to: create a logical operator node;

[0014] A symbolic expression component, which is used to: create an expression node; the symbolic expression component includes a data item selection component for creating a keyword selection list node, an operator selection component for creating a constraint condition node, a remark information input component for creating a keyword remark information node, and a deletion component for creating a deletion expression node;

[0015] The operation component is used to: create an operation node.

[0016] In combination with the third aspect, in one implementation, the rendering component is specifically used to: generate corresponding tree structure data according to the structure of the rule tree through the VUE component, render the tree structure, and obtain a visual operation interface of the rule tree editor.

[0017] Compared with the prior art, the advantages of the present invention are:

[0018] The present invention generates a rule tree editor through a VUE component for users to input operation expressions. The expression node is used to allow users to input operation expressions. The keyword selection list in the expression node allows users to only select, and will not enter keywords that are not in the keyword selection list to cause information errors; the keyword selection list, keyword remark information, and constraints between keywords and remark information in the expression node can cooperate to allow users to accurately and intuitively input operation expressions. The operation node is used to allow users to add expressions or new rule trees, and the logical operator node is used to provide constraints between rule trees. The rule tree editor formed in this way can allow users to efficiently and accurately input a variety of operation expressions, thereby significantly improving work efficiency and accuracy, and greatly improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a schematic diagram of a visual interface of a rule tree editor in an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of the hardware structure of a VUE-based data operation expression construction device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] First, some technical terms in the present application are explained to facilitate those skilled in the art to understand the present application.

[0025] AntV X6: X6 is a graph editing engine under AntV, which provides a series of out-of-the-box interactive components and easy-to-use node customization capabilities, making it easy for us to quickly build graph editing applications.

[0026] Props: props refers to the use of props attributes in Vue components to define the data passed to child components.

[0027] Expose: Vue is used to declare public properties that are exposed when a component instance is accessed by a parent component through a template reference. To make the purpose, technical solution and advantages of this application clearer, the implementation method of this application will be further described in detail below in conjunction with the accompanying drawings.

[0028] N-ary tree: Each node in a binary tree has one data item and at most two child nodes. If each node of the tree is allowed to have more than two child nodes, then the tree is called an n-order multi-tree, or an n-ary tree.

[0029] In a first aspect, an embodiment of the present application provides a method for constructing a data operation expression based on VUE, the method comprising: generating a rule tree editor through a VUE component. Figure 1 As shown, the rule tree editor includes an initial rule tree. The structure of the rule tree includes 1 root node and 2 initial child nodes. The root node is a logic operator node, and the 2 initial child nodes are an expression node and an operation node. The expression node is used to input an operation expression, which includes a keyword selection list node, a keyword remark information node, and a constraint node between keywords and remark information (for example, if the keyword is age, the remark information is 20, and the constraint is >, it means that people aged greater than 20 are required). The operation node is used to add a rule tree or expression node, and the logic operator node is used to provide constraints between rule trees (for example, and / or / not).

[0030] It can be seen that the present invention generates a rule tree editor through a VUE component for users to input operation expressions. The expression node is used to allow users to input operation expressions. The keyword selection list in the expression node allows users to only select, and will not enter keywords that are not in the keyword selection list, thereby causing information errors; the keyword selection list, keyword remark information, and the constraints between keywords and remark information in the expression node can cooperate to allow users to accurately and intuitively input operation expressions. The operation node is used to allow users to add expressions or new rule trees, and the logical operator node is used to provide constraints between rule trees. The rule tree editor formed in this way can allow users to efficiently and accurately input a variety of operation expressions, thereby significantly improving work efficiency and accuracy, and greatly improving user experience.

[0031] In one embodiment, the method further includes the following steps: after the user completes inputting the operation expression in the rule tree editor, the operation expression is converted into a string expression that can be recognized by the database.

[0032] At the same time, the above method also includes the following steps: when the user needs to modify the string expression, the string expression is converted into an operation expression and displayed in the rule tree editor.

[0033] In one embodiment, the expression node in the above method also includes a delete expression node, which is used to delete the expression.

[0034] In one embodiment, the specific process of generating a rule tree editor through the VUE component in the above method includes: generating corresponding tree structure data according to the structure of the rule tree through the VUE component, rendering the tree structure, and obtaining a visual operation interface of the rule tree editor.

[0035] In the second aspect, an embodiment of the present application provides a data operation expression construction system based on VUE, the system includes a rendering component index, which is used to: generate a rule tree editor, the rule tree editor includes an initial rule tree, the structure of the rule tree includes 1 root node and 2 initial child nodes, the root node is a logic operator node, and the 2 initial child nodes are expression nodes and operation nodes. The expression node is used to input the operation expression, which includes a keyword selection list node, a keyword remark information node, and a constraint node between the keyword and the remark information. The operation node is used to add a new rule tree or expression node, and the logical operator node is used to provide constraints between rule trees.

[0036] The rendering component is the only interface for introduction and use. As a Vue component, it integrates all subcomponents and functions and glues them into usable components. Nodes are components, and node relationships are edges. It contains the main canvas of AntV X6 and is the rendering carrier of the editor. The actual execution of rendering is also in this component. This component uses props to receive three parameters: logical operator array, data item array, and expression operator array for dynamic configuration of data. The received array is injected into the subcomponent through provide. In addition, it also throws (expose) the bootstrap method to initialize the component and the getData method to obtain data.

[0037] In one embodiment, the system also includes an expression conversion component utils, which is used to: after the user completes entering an operation expression in the rule tree editor, convert the operation expression into a string expression that can be recognized by the database; when the user needs to modify the string expression, convert the string expression into an operation expression and display it in the rule tree editor.

[0038] The expression conversion component enables the editor to support both string type and tree structure input and output, where the tree structure is natively supported as the basic data structure of the component. The component provides tree->string and string->tree conversion algorithms to support string types. The tree->string algorithm uses breadth-first traversal to splice the tree structure into a string type expression through logical operators, and this expression can be called at any time; string->tree traverses the string and uses the appearance of left and right brackets to perform depth grading, and can generate a deep and complex regular tree structure with only a single traversal.

[0039] In one embodiment, the rendering component includes:

[0040] The logical operator component Expression is used to create a logical operator node. The logical operator component contains a selection component that receives the logical operator array injected by the rendering component as its options, so it can be dynamically configured. It can be the root node of an n-ary tree leading one or more expression nodes, or it can be a child node of other logical operator nodes. This structure can successfully display operation expressions of all types and complexities.

[0041] The symbolic expression component Operator is used to create expression nodes; the symbolic expression component includes a left data item selection component for creating a keyword selection list node, a middle operator selection component for creating a constraint condition node, a right remark information input component for creating a keyword remark information node, and a deletion component for creating a deletion expression node.

[0042] The left data item selection component receives the data item array injected by the rendering component as options, so as to achieve dynamic configuration based on the business; the middle operator selection component receives the expression operator array injected by the rendering component as options, which can be configured according to business needs; the right note information input component can input a value. These three components constitute the main body of a meta-expression, which is also the smallest unit of the expression. These smallest units can be assembled and combined into the desired expression through logical operators such as and / or / not of the logical operator component. At the same time, this component provides a delete operation.

[0043] The operation component AddNew is used to create an operation node. The operation component appears at the end of all n-ary trees. By clicking it, a logical operator component or a symbolic expression component can be inserted at the current position.

[0044] The above operation method and logic are: register three operation methods in the rendering component, specifically:

[0045] The insert logical operator method replaces the current operation component with the logical operator component and adds two subcomponents, the expression component and the operation component;

[0046] The insert expression method inserts an expression component at the same level;

[0047] The DeleteExpression method deletes the current expression and recursively checks upward to remove empty logical operators.

[0048] In one embodiment, the rendering component is specifically used to: generate corresponding tree structure data according to the structure of the rule tree through the VUE component, render the tree structure, and obtain a visual operation interface of the rule tree editor.

[0049] Specifically, the above rendering operation is completed through the data structure and the rendering parser RuleTree, and the component uses the tree structure as the basic data structure. Each tree node has three attributes: node type type, node data data and child nodes children. The rendering parser parses it into a mind map structure that can be rendered to achieve rendering. The rendering parser receives parameters such as node width, height, distance and edge algorithm, deeply traverses all tree nodes and parses their node types and data to convert them into rendering nodes. The rendering parser is executed every time a node is initialized or operated, and the layout is recalculated and then the component is rendered.

[0050] It can be seen that the advantages of the present invention include:

[0051] (1) The rule tree component can convert complex expressions into a clear and visual tree structure, which simplifies the difficulty of splicing rule expressions and improves usage efficiency.

[0052] (2) This rule tree component supports two data structures, tree structure and string expression, and can convert them seamlessly. The tree structure can be used for front-end and back-end interaction. The support of string expressions enables the component to directly receive expressions for rendering, so it can support users to directly input or import expressions, broadening the usage channels. The output expression can be directly used by the back-end in SQL expressions, simplifying the front-end and back-end connection.

[0053] (3) This rule tree component supports dynamic data input, which can ensure that the component supports most usage scenarios. For other customized scenarios, secondary development can also be carried out through the interfaces or methods exposed by the component, which improves development efficiency.

[0054] In a third aspect, an embodiment of the present application provides a data operation expression construction device based on VUE. The data operation expression construction device based on VUE can be a personal computer (PC), a laptop computer, a server, or other device with data processing functions.

[0055] Reference Figure 2 , Figure 2 The hardware structure diagram of the VUE-based data operation expression construction device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the VUE-based data operation expression construction device may include a processor, a memory, a communication interface, and a communication bus.

[0056] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0057] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, which are used to realize the interconnection of devices inside the VUE-based data operation expression construction device, and an interface for realizing the interconnection of the VUE-based data operation expression construction device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display (Display), a keyboard (Keyboard), etc.

[0058] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0059] The processor may be a general-purpose processor, which may call a VUE-based data operation expression construction program stored in a memory and execute a VUE-based data operation expression construction method provided in an embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the VUE-based data operation expression construction program is called may refer to the various embodiments of the VUE-based data operation expression construction method of the present application, which will not be described in detail here.

[0060] Those skilled in the art will understand that Figure 2 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0061] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0062] The computer-readable storage medium of the present application stores a VUE-based data operation expression construction program, wherein when the VUE-based data operation expression construction program is executed by a processor, the steps of the VUE-based data operation expression construction method described above are implemented.

[0063] Among them, the method implemented when the VUE-based data operation expression construction program is executed can refer to the various embodiments of the VUE-based data operation expression construction method of the present application, and will not be repeated here.

[0064] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0065] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0066] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0067] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0068] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0069] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0070] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0071] The above are only specific implementations of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and these modifications or replacements should be included in the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for constructing data operation expressions based on VUE, It is characterized in that The method comprises the following steps: generating a rule tree editor through a VUE component; the rule tree editor comprises a rule tree, the structure of the rule tree comprises a logic operator node, an expression node and an operation node; the expression node is used to input an operation expression, which comprises a keyword selection list node, a keyword remark information node, and a constraint condition node between the keyword and the remark information; the operation node is used to add a rule tree or an expression node; and the logic operator node is used to provide constraints between rule trees.

2. The method for constructing a data operation expression based on VUE as claimed in claim 1, It is characterized in that The method also includes the following steps: converting the completed operation expression input into the rule tree editor into a string expression that can be recognized by the database.

3. The method for constructing a data operation expression based on VUE as claimed in claim 1, It is characterized in that The method further comprises the following steps: converting the string expression into an operation expression and displaying the expression in the rule tree editor.

4. The method for constructing a data operation expression based on VUE as claimed in claim 1, Features: The expression node also includes a delete expression node, which is used to delete an expression.

5. The VUE-based data operation expression construction method according to any one of claims 1 to 4, It is characterized in that The specific process of generating a rule tree editor through the VUE component includes: generating corresponding tree structure data according to the structure of the rule tree through the VUE component, rendering the tree structure, and obtaining a visual operation interface of the rule tree editor.

6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a VUE-based data operation expression construction program, wherein when the VUE-based data operation expression construction program is executed, the steps of the VUE-based data operation expression construction method according to any one of claims 1 to 5 are implemented.

7. A data operation expression construction system based on VUE, Features: The system includes a rendering component index, which is used to: generate a rule tree editor through a VUE component; the rule tree editor includes a rule tree, and the structure of the rule tree includes a logic operator node, an expression node and an operation node; the expression node is used to input an operation expression, which includes a keyword selection list node, a keyword remark information node, and a constraint condition node between keywords and remark information; the operation node is used to add a rule tree or an expression node; Logical operator nodes are used to provide constraints between rule trees.

8. The VUE-based data operation expression construction system according to claim 7, Features: The system also includes an expression conversion component, which is used to: input a completed operation expression in the rule tree editor and convert it into a string expression that can be recognized by the database; convert the string expression into an operation expression and display it in the rule tree editor.

9. The VUE-based data operation expression construction system according to claim 7, It is characterized in that The rendering component includes: A logical operator component, which is used to: create a logical operator node; A symbolic expression component, which is used to: create an expression node; the symbolic expression component includes a data item selection component for creating a keyword selection list node, an operator selection component for creating a constraint condition node, a remark information input component for creating a keyword remark information node, and a deletion component for creating a deletion expression node; The operation component is used to: create an operation node.

10. The VUE-based data operation expression construction system according to claim 7, It is characterized in that The rendering component is specifically used to: generate corresponding tree structure data according to the structure of the rule tree through the VUE component, render the tree structure, and obtain a visual operation interface of the rule tree editor.