Data table generation method and device, storage medium and processor
Generating data tables through user-defined XML tags and Groovy scripts, solving the flexibility and efficiency of data query in the existing technology, realizing complex combined queries and statistics of diversified data dimensions, and improving user experience.
Patent Information
- Application Number
- CN202510245228.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-04
AI Technical Summary
Existing data query operations rely on fixed query statements, resulting in the search for data in a specific area when performing global search. The data dimensions are single, and the needs of complex conditional queries and diversified data dimension statistics cannot be met, affecting query efficiency and user experience.
By obtaining the XML tags entered by the user, parsing them into a tag structure tree, and traversing the tag nodes in turn executes a Groovy script, querying the target data from the system structure tree, generating a target data table, and supporting user-defined complex combination queries.
It realizes flexible data query based on user-defined to meet the statistical needs of diverse data dimensions, improves the flexibility and efficiency of data query, and improves the user experience.
Smart Images

Figure CN120256427A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and particularly to a method, apparatus, storage medium, and processor for generating a data table. Background Art
[0002] In a data system, data query and processing are one of the core functions. Existing data query operations usually rely on fixed query statements to perform simple combined retrievals on some common attributes, such as simple combined retrievals through database IDs or unique identifiers, etc.
[0003] Although existing query methods have certain applicability in specific scenarios, their application scope is greatly limited. For example, when performing a global retrieval, only data within a specific area can be searched, and the statistical data dimensions are also relatively single. When complex combined queries need to be performed, additional interfaces are often required to display data tables, which not only increases the operation complexity but also limits the ability of the data system to support complex condition queries and diverse data dimension statistics, thus seriously affecting the query efficiency and user experience of the data system.
[0004] Based on this, there is an urgent need for a method for generating a data table with higher flexibility to significantly improve the flexibility and efficiency of data query. Summary of the Invention
[0005] Based on the above problems, the present application provides a method, apparatus, storage medium, and processor for generating a data table, aiming to improve the flexibility and efficiency of data query to enhance the user experience.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] In the first aspect of the present application, a method for generating a data table is provided, and the method includes:
[0008] Obtain XML tags input by a user for generating a target data table; the XML tags include table configuration information defined by the user and a Groovy script; the table configuration information includes table style information corresponding to the target data table; the Groovy script is used to query target data required for generating the target data table from a system structure tree; the system structure tree is used to store all data in the data system;
[0009] Based on the table style information in the XML tags, parse the XML tags into a tag structure tree;
[0010] Traverse the tag nodes in the tag structure tree in sequence, execute the Groovy script corresponding to the tag node, and query the target data corresponding to the tag node from the system structure tree;
[0011] Add the target data to the corresponding tag node in the tag structure tree, and convert the tagged structure tree into the target data table.
[0012] In an alternative implementation, the table configuration information further includes a table modification rule, which is a rule for configuring the editing permissions of the target data table. The method for generating the data table further includes:
[0013] Obtain the identification information corresponding to the target data based on the table modification rule; the identification information is used to identify the storage location of the target data in the system structure tree;
[0014] Add the identification information to the corresponding tag node in the tag structure tree.
[0015] In an alternative implementation, after converting the tagged structure tree into the target data table, the method for generating the data table further includes:
[0016] In response to the modification operation of the user in the target data table, obtain the identification information corresponding to the data in the modified cell by the user and the modified data;
[0017] Update the corresponding data in the system structure tree based on the identification information and the modified data.
[0018] In an alternative implementation, before traversing the tag nodes in the tag structure tree in sequence and executing the Groovy script corresponding to the tag node, the method for generating the data table further includes:
[0019] Compile the Groovy script to obtain the compiled Groovy script;
[0020] Store the compiled Groovy script in the program memory.
[0021] In an alternative implementation, the step of traversing the tag nodes in the tag structure tree in sequence, executing the Groovy script corresponding to the tag node, and querying the target data corresponding to the tag node from the system structure tree includes:
[0022] Traverse the tag nodes in the tag structure tree in sequence, and call the compiled Groovy script corresponding to the tag node from the program memory;
[0023] Execute the compiled Groovy script to query the target data corresponding to the tag node from the system structure tree.
[0024] In an alternative implementation, the obtaining of the XML tag for generating the target data table by the user includes:
[0025] In response to the user's operation of clicking on the target node on the system structure tree, create a sandbox interface;
[0026] Obtain the XML tag input by the user on the sandbox interface.
[0027] In an alternative implementation, after obtaining the XML tag input by the user on the sandbox interface, the method for generating the data table further includes:
[0028] Store the XML tag in the form of a view name in a preset database.
[0029] In a second aspect of the present application, there is provided a device for generating a data table, the device including:
[0030] An obtaining module, configured to obtain an XML tag input by a user for generating a target data table; the XML tag includes table configuration information defined by the user and a Groovy script; the table configuration information includes table style information corresponding to the target data table; the Groovy script is used to query target data required for generating the target data table from a system structure tree; the system structure tree is used to store all data in a data system;
[0031] A parsing module, configured to parse the XML tag into a tag structure tree based on the table style information in the XML tag;
[0032] A data query module, configured to sequentially traverse tag nodes in the tag structure tree, execute the Groovy script corresponding to the tag node, and query target data corresponding to the tag node from the system structure tree;
[0033] A conversion module, configured to add the target data to the corresponding tag node in the tag structure tree and convert the tagged data tag structure tree into the target data table.
[0034] In a third aspect of the present application, there is provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is run by a processor, the above method for generating a data table is implemented.
[0035] In the fourth aspect of the present application, a processor is provided for running a computer program, and when the computer program runs, it executes the above-mentioned method for generating a data table.
[0036] Compared with the prior art, the present application has the following beneficial effects:
[0037] In the technical solution of the present application, by obtaining the XML tags input by the user for generating the target data table, and then based on the table style information in the XML tags, parsing the XML tags into a tag structure tree, and sequentially traversing the tag nodes in the tag structure tree, executing the Groovy script corresponding to the tag node, querying the target data corresponding to the tag node from the system structure tree; finally, adding the target data to the corresponding tag node in the tag structure tree, and converting the tagged structure tree into a target data table; wherein, the XML tags include user-defined table configuration information and Groovy scripts, the table configuration information includes the table style information corresponding to the target data table, the Groovy script is used to query the target data required for generating the target data table from the system structure tree, and the system structure tree is used to store all data in the data system.
[0038] In the technical solution of the present application, since the XML tags input by the user for generating the target data table include the table configuration information customized by the user according to their own needs and the Groovy script for querying the target data required for generating the target data table from the system structure tree, based on the table style information in the XML tags, parsing the XML tags into a tag structure tree, and sequentially traversing the tag nodes in the tag structure tree, executing the Groovy script corresponding to the tag node, and querying the target data corresponding to the tag node from the system structure tree, it is possible to implement complex combined queries based on user-defined query conditions, meeting the statistical requirements of users for diverse data dimensions; furthermore, adding the queried target data to the corresponding tag node in the tag structure tree and converting the tagged structure tree into a target data table realizes the generation of a more flexible target data table by allowing users to customize XML tags according to their personal needs, improving the flexibility and efficiency of data query and enhancing the user experience. Description of the Drawings
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0040] Figure 1Flowchart of a method for generating a data table provided by an embodiment of the present application;
[0041] Figure 2 Schematic diagram of a system structure tree provided by an embodiment of the present application;
[0042] Figure 3 Flowchart of a compilation process of a Groovy script provided by an embodiment of the present application;
[0043] Figure 4 Flowchart of a query process of target data provided by an embodiment of the present application;
[0044] Figure 5 Flowchart of a modification operation on data in a target data table provided by an embodiment of the present application;
[0045] Figure 6 Schematic diagram of the structure of a data table generation device provided by an embodiment of the present application. Detailed implementation manners
[0046] As described above, existing data query operations usually rely on fixed query statements to perform simple combined retrievals on some general attributes through fixed query statements, such as simple combined retrievals by database ID or unique identifier, etc. Although the existing query methods have certain applicability in specific scenarios, their application scope is greatly limited. For example, when performing a global retrieval, only data within a specific area can be searched, and the statistical data dimensions are also relatively single. When complex combined queries need to be performed, additional interfaces are often required to display data tables, which not only increases the operation complexity but also limits the ability of the data system to support complex condition queries and diverse data dimension statistics, thus seriously affecting the query efficiency and user experience of the data system.
[0047] Based on this, there is an urgent need for a method for generating a data table with higher flexibility to significantly improve the flexibility and efficiency of data query.
[0048] After research, the inventor proposed a method for generating a more flexible data table. In this solution, by obtaining the XML tags input by the user for generating the target data table, and then based on the table style information in the XML tags, parsing the XML tags into a tag structure tree, traversing the tag nodes in the tag structure tree in sequence, executing the Groovy script corresponding to the tag node, querying the target data corresponding to the tag node from the system structure tree; finally, adding the target data to the corresponding tag node in the tag structure tree, and converting the tagged data tag structure tree into a target data table; wherein, the XML tags include user-defined table configuration information and Groovy scripts, the table configuration information includes the table style information corresponding to the target data table, the Groovy script is used to query the target data required for generating the target data table from the system structure tree, and the system structure tree is used to store all data in the data system.
[0049] In the technical solution of this application, since the XML tags input by the user for generating the target data table include the table configuration information customized by the user according to their own needs and the Groovy script for querying the target data required for generating the target data table from the system structure tree, based on the table style information in the XML tags, parsing the XML tags into a tag structure tree, traversing the tag nodes in the tag structure tree in sequence, executing the Groovy script corresponding to the tag node, and querying the target data corresponding to the tag node from the system structure tree, it is possible to implement complex combined queries based on user-defined query conditions, meeting the statistical requirements of users' diverse data dimensions; furthermore, adding the queried target data to the corresponding tag node in the tag structure tree and converting the tagged data tag structure tree into a target data table, realizing the generation of a more flexible target data table by allowing users to customize XML tags according to their personal needs, improving the flexibility and efficiency of data query, and enhancing the user experience.
[0050] In order to enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0051] Keyword definition:
[0052] XML: A structured language that allows users to define their own tags and file structures.
[0053] Groovy: An agile development language based on the JVM (Java Virtual Machine), which combines many powerful features of dynamic languages such as Python, Ruby, and Smalltalk while retaining the syntax and semantics of the Java language.
[0054] System structure tree: It is the architecture of the entire system, usually referring to a hierarchical data structure used to represent the organizational relationships between internal components or elements of the system. The system structure tree is a way to arrange the various components of the system according to a certain logical or physical relationship, thereby helping users understand the architecture, composition, and the interrelationships between parts of the system.
[0055] UNIT: Component, representing a node in the system structure tree.
[0056] LINK: Link, representing the relationship between components.
[0057] UnitType / LinkType: The type of component / link.
[0058] Method embodiment
[0059] The embodiment of the present application provides an embodiment of a method for generating a data table. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0060] See Figure 1 , which is a flowchart of a method for generating a data table provided by an embodiment of the present application. As Figure 1 shown, the method includes the following steps:
[0061] Step S101, obtain the XML tags input by the user for generating the target data table.
[0062] In an optional embodiment, a system for generating a data table can be the execution entity of the method for generating a data table in the embodiment of the present application. For the convenience of description, hereinafter, the system for generating a data table will be simply referred to as the system.
[0063] In step S101, the XML tags include the table configuration information defined by the user and the Groovy script; the table configuration information includes the table style information corresponding to the target data table; the Groovy script is used to query the target data required for generating the target data table from the system structure tree; the system structure tree is used to store all the data in the data system.
[0064] In the embodiments of the present application, in addition to the table style information corresponding to the target data table, the table configuration information may further include a table modification rule, where the table modification rule is a rule for configuring the editing permission of the target data table. By configuring the table modification rule in the XML tag, editing of the target data table can be achieved.
[0065] In the embodiments of the present application, the system allows users to customize XML tags according to personal needs. Users can write corresponding Groovy script statements in the input XML tags according to the query conditions of the target data to be queried, so as to provide a data basis for implementing complex combined queries based on user-defined XML tags to meet the statistical requirements of users for diverse data dimensions. Exemplarily, the XML tags input by the user may include the following content:
[0066] <grid>
[0067] <columns>
[0068] <UnitNameColumn caption="CONTEXT" width="50" align="center" objectName="P1" / >
[0069] <StringValueColumn caption="Has Child" objectName="P2" / >
[0070] <UnitNameColumn caption="Child Name" objectName="P3">
[0071] <VersionColumn caption="Version" objectName="P3>
[0072] <ForEach select="gontext.current0 defbvLink(O)">
[0073] OccurrenceAttributeColumn caption="Name linkSID="xattibuteSID="AAA" objectName="p3" width="canAddPatt="true" /
[0074]
[0075] It should be noted that there seem to be some potential errors or unclear parts in the original text, such as "gontext" which might be a misspelling, and some inconsistent or incomplete tag attributes. But the translation is done strictly according to the rules.< / columns>
[0076] o
[0077] <RowObject name="P1">
[0078] <if test=context current(0defBylink(O)size(>0>
[0079] ……
[0080] <RowObject name="P2"select="Yes">
[0081] ……
[0082] <ForEach select="context.currentO.defbvLink(Q)">
[0083] …………
[0084] <RowObject name="P3">
[0085] <Row /
[0086] ……
[0087]
[0088]
[0089]
[0090] ………
[0091] < / grid>
[0092] Optionally, the XML tags supported by the Groovy script in the present application may include the following tags:
[0093] (1) <If test=""> Judge the execution result within test.
[0094] (2) <ForEach select="path query script"> Perform loop traversal according to the path query script.
[0095] (3) <defobj / > Start using from a certain Link and obtain the Unit pointed to by this Link.
[0096] (4) <choose>Selection statement, which determines which branch to enter and only one branch is taken.
[0097] (5)<When test="Judgment statement for supporting path function, enter when true and jump out when false">
[0098]
[0099] <otherwise>.
[0100] (6)<Variable name="Req"as="类型"select="路径查询脚本" / > Define the result of the path query script as a variable.
[0101] (7) <log>< / log> Print user-defined logs on the front-end interface.
[0102] (8) <row / > : This statement indicates that the row information output operation is performed here. When a series of statements are passed to this point, the data output operation will be performed according to the meaning of specific Column statements such as NameColumn and the position of the RowObject identified in each column.
[0103] (9)<RowObject name="P1"select=""> : This statement is used to identify the location of the output data, indicating that the content of this location will be output when the query reaches this location. The name written in name corresponds to the objectName in the specific Column.
[0104] (10)<NameColumn caption=""width=""align=""objectName="P1"cellMerge=""readOnly=""multiValueStyle=""icon="">This statement is used to output the name of the path accessed by RowObject P1.
[0105] (11) <AttributeColumn type="AA"caption=""width=""align=""
[0106] objectName="P1"cellMerge=""readOnly=""multiValueStyle="">::This statement is used to output the attribute value of AA of the data under the path accessed by RowObject P1.
[0107] (12) <Parameter caption="p1"name="IfOk?"
[0108] as="Boolean"defaultValue="true">Define a default variable P1, Boolean type, title p1, parameter name IfOk, default value true;
[0109] <ForEach select="[true,false]"> / / Give two values, true and false;
[0110] <addparametervalue / > / / Place it in the current parameter, and this parameter can select one of these two values;
[0111]
[0112]
[0113] The Parameter is a global parameter and is available throughout the xml.
[0114] (13) <OccurrenceColumn caption="Name"
[0115] linkSID="SID2"
[0116] attributeSID="ASID" width="" canAddPart="true" / > is used to attach a certain Unit to another Unit and supports editing of attributes.
[0117] It should be noted that in the embodiments of the present application, the user can input multiple of the above tags into the system according to their own needs, so that the system can implement complex combined data queries based on the user-defined XML tags. For example, the user can input the following XML tags: <log>< / log> Input into the system, and the system can query and output log data based on the Groovy script statements in the XML tag, so that the user can directly see the accuracy of the queried data.
[0118] Optionally, in the embodiments of the present application, the basic statements supported by the Groovy script are as follows:
[0119] First, the global object context. context is the global object of the Groovy script language. All Groovy script query statements start with context. context itself does not contain any data and is only used to call other query methods. Among them, the global object methods are as follows:
[0120] (1) current(): Obtain the current element object;
[0121] (2) currentUser(): Obtain the currently logged-in user;
[0122] (3) now(): Obtain the current date and time;
[0123] (4)isSid(obj, sid): Determine whether the SID of the Object is the same as the given SID. Parameter obj: the element object to be compared. Parameter sid: the given SID;
[0124] (5)user(account): Obtain the matching user according to the user name. Parameter account: the account name;
[0125] (6)chain(): Start a chained call with the current object as the starting point;
[0126] (7)chain(obj) Start a chained call with the given object as the starting point: Parameter obj: the given element object.
[0127] II. Chained Call Methods
[0128] (1) Parameter entitySid: the SID of the entity;
[0129] (2) Parameter linkSid: the sid of the link;
[0130] (3)get(): Used to end the chained call and return the final data. Note: The format of the finally returned data is always an array;
[0131] (4)defByLink(linkSid): The upstream element accesses the downstream element through this linkSid;
[0132] (5)def(): When the current element is a link, access the downstream element through this link;
[0133] (6)pathFromLink(entitySid): When the current element is a link, find the corresponding multiple entities according to the SID of the entity from this link (when it is any node on the path);
[0134] (7)units(): When the current element is an entity, access all related unit lists (including the starting point, path units, and ending point) from this entity.
[0135] III. Instance Object Methods
[0136] (1)get(field): Obtain the basic field value. Note: If the result returned by the Groovy script execution before calling the get(field) method is in array format, the get(field) method cannot be directly called. For specific reference, see the map method.
[0137] (2)getAttr(sid): Obtain the custom attribute object.
[0138] (3) value(): Obtain the attribute value of the custom attribute object. When used, this method follows the getAttr(sid) method.
[0139] In the embodiment of the present application, the system obtains the XML tags input by the user for generating the target data table, which may include the following steps:
[0140] Step 1, in response to the user's operation of clicking on the target node in the system structure tree, create a sandbox interface.
[0141] In the embodiment of the present application, the system structure tree can be used to store all data in the data system. When the user clicks on the target node in the system structure tree, the system can create a sandbox interface by responding to the user's operation of clicking on the target node in the system structure tree, realizing an interface that provides the user with custom complex combined data query conditions for the target node, making the user's query more targeted and focusing on the dataset related to the target node, thereby improving the flexibility and efficiency of data query. For example, when the user clicks on the UnitB node in the system structure tree as shown, the system can respond to the user's click operation and create a sandbox interface on the UnitB node. When subsequently querying the target data based on the XML tags input by the user, the system can use the UnitB node as the starting node for data query, making the user's query more targeted and focusing on the dataset related to the UnitB node. Figure 2 The system can respond to the user's click operation and create a sandbox interface on the UnitB node. When subsequently querying the target data based on the XML tags input by the user, the system can use the UnitB node as the starting node for data query, making the user's query more targeted and focusing on the dataset related to the UnitB node.
[0142] Step 2, obtain the XML tags input by the user on the sandbox interface.
[0143] In this embodiment, after the system creates the sandbox interface, the user inputs XML tags including custom complex combined data query conditions in the sandbox interface according to their own needs, and the system can directly obtain the XML tags input by the user.
[0144] Optionally, in this embodiment, after the system obtains the XML tags input by the user on the sandbox interface, the system can store the XML tags in the preset database in the form of a view name for persistent storage, so that the user can directly quickly load the required target data table by selecting the predefined view name without having to build the query process from scratch, thereby improving the efficiency of data query.
[0145] It should be noted that the above steps 1 to 2 are not shown in the figure.
[0146] Step S102, based on the table style information in the XML tags, parse the XML tags into a tag structure tree.
[0147] In this embodiment, the system can parse according to the content defined in the XML tags, and based on the table style information, parse the configuration nodes of the XML tags into basic configurations such as the styles within the user-defined table and the table modification rules, and construct a tag structure tree, so as to provide data preparation for subsequent efficient data query and the generation of the target data table with user-defined styles.
[0148] Step S103, traverse the tag nodes in the tag structure tree in sequence, execute the Groovy script corresponding to the tag node, and query the target data corresponding to the tag node from the system structure tree.
[0149] In this embodiment, the system can obtain the target data by traversing the tag nodes in the tag structure tree in sequence, executing the Groovy script corresponding to the tag node, and querying the data of the tag node and its corresponding child nodes from the system structure tree, so as to obtain all the data information corresponding to the tag node to be queried, such as the built-in attributes within the query item; thus realizing complex combined queries based on user-defined query conditions and meeting the statistical requirements of users for diverse data dimensions.
[0150] To further improve the efficiency of data query, the system can compile the Groovy script before traversing the tag nodes in the tag structure tree in sequence and executing the Groovy script corresponding to the tag node. Specifically, refer to Figure 3 , Figure 3 is a flowchart of the compilation process of a Groovy script provided by an embodiment of the present application. This process includes the following steps:
[0151] Step S301, compile the Groovy script to obtain the compiled Groovy script.
[0152] Step S302, store the compiled Groovy script in the program memory.
[0153] It should be noted that storing the compiled Groovy script in the program memory enables the compiled Groovy script to be quickly accessed and executed, improving the execution efficiency of the Groovy script and thus the data query efficiency.
[0154] Furthermore, as Figure 4 shown, the system traverses the tag nodes in the tag structure tree in sequence, executes the Groovy script corresponding to the tag node, and queries the target data corresponding to the tag node from the system structure tree, including the following steps:
[0155] Step S401, traverse the label nodes in the label structure tree in sequence, and call the compiled Groovy script corresponding to the label node from the program memory.
[0156] Step S402, execute the compiled Groovy script, and query the target data corresponding to the label node from the system structure tree.
[0157] It should be noted that by calling the compiled Groovy script corresponding to the label node from the program memory, executing the compiled Groovy script, and querying the target data corresponding to the label node from the system structure tree, it is possible to quickly access and execute the compiled Groovy script for data query, thereby improving the data query efficiency.
[0158] The data tables generated by the prior art often only support the viewing function, and generally cannot directly edit the corresponding data on the data table; when modifying the data in the data table, it is necessary to click on each piece of data in the table separately to enter the corresponding page for data editing, and after editing, it is necessary to refresh the interface to load the data, which has the problem of cumbersome operations and greatly affects the user experience.
[0159] To solve the above problems, in the embodiments of the present application, by configuring a table modification rule in the XLM label, the table modification rule is a rule for configuring the editing permission of the target data table, and the user can configure the table modification rule as a rule for the target data table to have editing permission, and implement the modification operation of the data in the target data table through the table modification rule. Specifically, the system can obtain the identification information corresponding to the target data based on the table modification rule; wherein, the identification information is used to identify the storage location of the target data in the system structure tree; then the system can add the identification information to the corresponding label node in the label structure tree.
[0160] It should be noted that obtaining the identification information corresponding to the target data based on the table modification rule and adding the identification information to the corresponding label node in the label structure tree can provide data preparation for implementing the modification operation of the data in the target data table.
[0161] Step S104, add the target data to the corresponding label node in the label structure tree, and convert the labeled label structure tree into a target data table.
[0162] In this embodiment, the system can use the query result (i.e., the target data) of the Groovy script to establish structured data as the data on the corresponding node of the label structure tree, and convert the labeled label structure tree into a target data table. Exemplarily, the target data table can be as shown in Table 1:
[0163] Table 1
[0164]
[0165]
[0166] The above Table 1 includes query conditions based on multiple dimensions defined by the user, and the data queried from the system structure tree, such as the data of UnitA, UnitB, and UnitC.
[0167] Further, refer to Figure 5 , which is a flowchart of a modification operation on the data in the target data table provided by the embodiment of the present application. The process includes the following steps:
[0168] Step S501, in response to the user's modification operation in the target data table, obtain the identification information corresponding to the data in the modified cell by the user, and the modified data.
[0169] In this embodiment, the target data table is implemented in a matrix manner. By using the cell binding method, each object in each cell in the target data table is an independent individual, so that the user can modify the data in the cell.
[0170] Step S502, based on the identification information and the modified data, update the corresponding data in the system structure tree.
[0171] Through the data table generation method provided by the embodiment of the present application, it is realized that by allowing the user to customize XML tags according to personal needs, complex combined queries are executed based on the query conditions defined by the user in the XML tags, meeting the statistical requirements of the user's diverse data dimensions; based on the table style information defined by the user in the XML tags and the data query results of complex combined queries, a target data table with higher flexibility is generated, improving the flexibility and efficiency of data query and enhancing the user experience. Through the data table generation method provided by the embodiment of the present application, by allowing the user to configure table modification rules in the XLM tags, the modification operation on the data in the generated target data table is realized, avoiding the problem of cumbersome operation and improving the user experience.
[0172] Device Embodiment
[0173] The embodiment of the present application provides a data table generation device, wherein, Figure 6 is a schematic structural diagram of a data table generation device provided by the embodiment of the present application. As Figure 6 shown, the device includes: an acquisition module 11, an analysis module 12, a data query module 13, and a conversion module 14. It can be seen from Figure 6 the connection relationships among several modules.
[0174] Among them, the acquisition module 11 is used to acquire the XML tags input by the user for generating the target data table; the XML tags include the table configuration information defined by the user and the Groovy script; the table configuration information includes the table style information corresponding to the target data table; the Groovy script is used to query the target data required for generating the target data table from the system structure tree; the system structure tree is used to store all the data in the data system;
[0175] The parsing module 12 is used to parse the XML tags into a tag structure tree based on the table style information in the XML tags;
[0176] The data query module 13 is used to sequentially traverse the tag nodes in the tag structure tree, execute the Groovy script corresponding to the tag node, and query the target data corresponding to the tag node from the system structure tree;
[0177] The conversion module 14 is used to add the target data to the corresponding tag nodes in the tag structure tree, and convert the tagged data tag structure tree into a target data table.
[0178] Optionally, the table configuration information further includes a table modification rule, and the table modification rule is a rule for configuring the editing permission of the target data table; the data table generation device further includes: a first acquisition unit and a first addition unit.
[0179] The first acquisition unit is used to acquire the identification information corresponding to the target data based on the table modification rule; the identification information is used to identify the storage location of the target data in the system structure tree;
[0180] The first addition unit is used to add the identification information to the corresponding tag nodes in the tag structure tree.
[0181] Optionally, the data table generation device further includes: a response unit and an update unit.
[0182] The response unit is used to, after converting the tagged data tag structure tree into a target data table, in response to the modification operation of the user in the target data table, acquire the identification information corresponding to the data in the modified cell by the user, and the modified data;
[0183] The update unit is used to update the corresponding data in the system structure tree based on the identification information and the modified data.
[0184] Optionally, the data table generation device further includes: a compilation unit and a first storage unit.
[0185] A compilation unit is used to compile a Groovy script before sequentially traversing label nodes in a label structure tree and executing the Groovy script corresponding to the label node, so as to obtain a compiled Groovy script.
[0186] A first storage unit is used to store the compiled Groovy script into the program memory.
[0187] Optionally, the data query module includes: a script invocation unit and a data query unit.
[0188] The script invocation unit is used to sequentially traverse label nodes in the label structure tree and invoke the compiled Groovy script corresponding to the label node from the program memory.
[0189] The data query unit is used to execute the compiled Groovy script and query target data corresponding to the label node from the system structure tree.
[0190] Optionally, the acquisition module includes:
[0191] A creation unit is used to create a sandbox interface in response to an operation of a user clicking on a target node on the system structure tree.
[0192] A second acquisition unit is used to acquire XML tags input by the user on the sandbox interface.
[0193] Optionally, the device for generating a data table further includes:
[0194] A second storage unit is used to store the XML tags in the form of a view name into a preset database after acquiring the XML tags input by the user on the sandbox interface.
[0195] Embodiment of the storage medium
[0196] An embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, some or all of the steps in the method for generating a data table introduced in the foregoing method embodiment of the present application are implemented. The storage medium may be various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.
[0197] Embodiment of the processor
[0198] An embodiment of the present application provides a processor, which is used to run a program. When the program runs, some or all of the steps in the method for generating a data table introduced in the foregoing method embodiment are executed.
[0199] It should be noted that the various embodiments in this specification are described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content. The apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components referred to as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0200] As described above, this is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.< / otherwise> < / choose>
Claims
1. A method for generating a data table, characterized in that, including: obtaining an XML tag input by a user for generating a target data table; the XML tag includes the table configuration information defined by the user and a Groovy script; the table configuration information includes table style information corresponding to the target data table; the Groovy script is used to query target data required for generating the target data table from a system structure tree; the system structure tree is used to store all data in a data system; parsing the XML tag into a tag structure tree based on the table style information in the XML tag; sequentially traversing tag nodes in the tag structure tree, executing a Groovy script corresponding to the tag node, and querying target data corresponding to the tag node from the system structure tree; adding the target data to a corresponding tag node in the tag structure tree, and converting the tagged structure tree into the target data table.
2. The method according to claim 1, wherein The table configuration information further includes a table modification rule, and the table modification rule is a rule for configuring editing permissions of the target data table. The method further includes: obtaining identification information corresponding to the target data based on the table modification rule; the identification information is used to identify a storage location of the target data in the system structure tree; adding the identification information to a corresponding tag node in the tag structure tree.
3. The method according to claim 2, wherein After converting the tagged structure tree into the target data table, the method further includes: responding to a modification operation of the user on the target data table, obtaining identification information corresponding to data in a cell modified by the user, and modified data; updating corresponding data in the system structure tree based on the identification information and the modified data.
4. The method according to claim 1, wherein Before sequentially traversing tag nodes in the tag structure tree and executing a Groovy script corresponding to the tag node, the method further includes: compiling the Groovy script to obtain a compiled Groovy script; storing the compiled Groovy script in program memory.
5. The method according to claim 4, wherein The sequentially traversing tag nodes in the tag structure tree, executing a Groovy script corresponding to the tag node, and querying target data corresponding to the tag node from the system structure tree includes: sequentially traversing tag nodes in the tag structure tree, and calling a compiled Groovy script corresponding to the tag node from the program memory; executing the compiled Groovy script, and querying target data corresponding to the tag node from the system structure tree.
6. The method according to claim 1, wherein The obtaining an XML tag input by a user for generating a target data table includes: responding to an operation that the user clicks a target node on the system structure tree, and creating a sandbox interface; obtaining an XML tag input by the user on the sandbox interface.
7. The method according to claim 6, characterized in that, After obtaining the XML tag input by the user on the sandbox interface, the method further includes: storing the XML tag in a preset database in the form of a view name.
8. A generating device for a data table, characterized in that, including: An acquisition module, configured to acquire an XML tag input by a user for generating a target data table; the XML tag includes table configuration information defined by the user and a Groovy script; the table configuration information includes table style information corresponding to the target data table; the Groovy script is used to query target data required for generating the target data table from a system structure tree; The system structure tree is used to store all data in the data system; A parsing module, configured to parse the XML tag into a tag structure tree based on the table style information in the XML tag; A data query module, configured to sequentially traverse tag nodes in the tag structure tree, execute a Groovy script corresponding to the tag node, and query target data corresponding to the tag node from the system structure tree; A conversion module, configured to add the target data to a corresponding tag node in the tag structure tree, and convert the tag structure tree with annotated data into the target data table.
9. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program, and when the computer program is run by a processor, the method for generating a data table according to any one of claims 1-7 is implemented.
10. A processor, characterized in that, For running a computer program, the computer program executes the method for generating a data table according to any one of claims 1-7 when running.
Citation Information
Cited By
Universal table data importing method and system, storage medium and electronic equipment
CN121071017A