[go: up one dir, main page]

CN115576974A - Data processing method, device, equipment and medium - Google Patents

Data processing method, device, equipment and medium Download PDF

Info

Publication number
CN115576974A
CN115576974A CN202211214014.4A CN202211214014A CN115576974A CN 115576974 A CN115576974 A CN 115576974A CN 202211214014 A CN202211214014 A CN 202211214014A CN 115576974 A CN115576974 A CN 115576974A
Authority
CN
China
Prior art keywords
node
query statement
data
event
structured query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211214014.4A
Other languages
Chinese (zh)
Other versions
CN115576974B (en
Inventor
胡岗
金可栋
杨华
胡肖宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202211214014.4A priority Critical patent/CN115576974B/en
Publication of CN115576974A publication Critical patent/CN115576974A/en
Application granted granted Critical
Publication of CN115576974B publication Critical patent/CN115576974B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a data processing method, a data processing device, data processing equipment and a data processing medium, and relates to the technical field of internet. The method comprises the following steps: responding to a first event triggered by a first node in a data tree displayed in a target page, and inquiring a first keyword corresponding to the first node according to the first event; acquiring first attribute content of a first node; and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database. Therefore, the structured query statement can be automatically generated in a mode that a user operates (such as clicking, dragging, selecting and the like) on the node in the data tree displayed in the target page, so that data processing operation can be performed on the database according to the structured query statement without manually writing the automatic query statement, and the writing or generating difficulty of the SQL statement can be reduced.

Description

Data processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data processing method, apparatus, device, and medium.
Background
For a data system or a database system of a World Wide WEB (World Wide WEB) platform, data processing operations (such as Query operations, storage operations, add/delete operations, update operations, etc.) may be performed on the data system or the database system through Structured Query Language (SQL) statements.
In the related art, a user manually writes an SQL statement to perform a data processing operation on a data system or a database system according to the manually written SQL statement.
However, the above-mentioned way of manually writing SQL statements is difficult for users who are not proficient in SQL to write, and is prone to syntax errors.
Disclosure of Invention
The present disclosure is directed to solving, at least to some extent, one of the technical problems in the related art.
The present disclosure provides a data processing method, apparatus, device, and medium, which implement automatic generation of a structured query statement in a manner that a user operates (for example, clicks, drags, selects, etc.) a node in a data tree displayed in a target page, so that data processing operations can be performed on a database according to the structured query statement without manually writing an automatic query statement, thereby reducing the writing or generating difficulty of an SQL statement, and improving the user experience.
An embodiment of the first aspect of the present disclosure provides a data processing method, including:
responding to a first event triggered by a first node in a data tree displayed in a target page, and inquiring a first keyword corresponding to the first node according to the first event; wherein the first keyword and each node in the data tree are used for generating a structured query statement;
acquiring first attribute content of the first node;
and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database.
In the data processing method of the embodiment of the disclosure, by responding to a first event triggered by a first node in a data tree displayed in a target page, a first keyword corresponding to the first node is queried according to the first event; the first keyword and each node in the data tree are used for generating a structured query statement; acquiring first attribute content of a first node; and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database. Therefore, the structured query statement can be automatically generated in a mode that a user operates (such as clicking, dragging, selecting and the like) on the node in the data tree displayed in the target page, so that data processing operation can be performed on the database according to the structured query statement without manually writing the automatic query statement, the writing or generating difficulty of the SQL statement can be reduced, and the use experience of the user is improved.
An embodiment of a second aspect of the present disclosure provides a data processing apparatus, including:
the query module is used for responding to a first event triggered by a first node in a data tree displayed in a target page, and querying a first keyword corresponding to the first node according to the first event; wherein the first keyword and each node in the data tree are used to generate a structured query statement;
an obtaining module, configured to obtain a first attribute content of the first node;
and the generating module is used for generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database.
The data processing device of the embodiment of the disclosure queries a first keyword corresponding to a first node according to a first event by responding to the first event triggered by monitoring the first node in a data tree displayed in a target page; the first keyword and each node in the data tree are used for generating a structured query statement; acquiring first attribute content of a first node; and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database. Therefore, the structured query statement can be automatically generated in a mode that a user operates (such as clicking, dragging, selecting and the like) the node in the data tree displayed in the target page, so that data processing operation can be performed on the database according to the structured query statement without manually compiling the automatic query statement, the compiling or generating difficulty of the SQL statement can be reduced, and the use experience of the user can be improved.
An embodiment of a third aspect of the present disclosure provides an electronic device, including: the data processing method comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the data processing method according to the embodiment of the first aspect of the disclosure.
A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a data processing method as set forth in the first aspect of the present disclosure.
A fifth aspect of the present disclosure provides a computer program product, wherein when instructions of the computer program product are executed by a processor, the data processing method as set forth in the first aspect of the present disclosure is performed.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the disclosure;
fig. 2 is a schematic flow chart diagram of another data processing method provided in the embodiment of the present disclosure;
fig. 3 is a schematic diagram of a first target page provided by the embodiment of the present disclosure;
FIG. 4 is a schematic flow chart diagram illustrating another data processing method according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a second target page provided by the embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative and intended to explain the present disclosure, and should not be construed as limiting the present disclosure.
Currently, for a data system of a WEB platform, a user may manually write SQL statements to perform data processing operations on the data system according to the manually written SQL statements. Or, the SQL statement may be generated on other platforms and copied to the current WEB platform data system for use.
However, for users who are not proficient in SQL, the difficulty of writing SQL statements manually is high, and syntax errors are inevitable; for users familiar with SQL, writing errors are easy to occur when data tables and field information are manually input due to the fact that code prompts do not exist. In addition, for the manually written SQL statement, the difficulty of checking syntax errors is large because no syntax limitation exists.
Accordingly, in view of at least one of the above problems, the present disclosure proposes a data processing method, an apparatus, an electronic device, and a storage medium.
A data processing method, apparatus, device, and medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings. Before describing embodiments of the present disclosure in detail, for ease of understanding, common terminology will be introduced first:
DOM (Document Object Model) Object: each element in the page can be regarded as a node, each node is an object, and when the page element is operated, the page element node can be regarded as a DOM object, so that the attribute and the method of the DOM object can be used for relevant operation.
JSON (JavaScript Object Notation) is a lightweight data exchange format.
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the disclosure.
In the embodiment of the present disclosure, the data processing method may be applied to any electronic device, so that the electronic device may perform a data processing function.
The electronic device may be any device having a computing capability, for example, a PC (Personal Computer), an industrial Computer, a mobile terminal, a server, and the like, and the mobile terminal may be a hardware device having various operating systems, touch screens, and/or display screens, such as a mobile phone, a tablet Computer, a Personal digital assistant, and a wearable device.
As shown in fig. 1, the data processing method may include the steps of:
step 101, in response to a first event triggered by a first node in a data tree displayed in a target page, querying a first keyword corresponding to the first node according to the first event; wherein the first key and each node in the data tree are used to generate a structured query statement.
In the embodiment of the present disclosure, the target page may be a page in a WEB platform (such as a data service platform, a data management and control platform, and the like), for example, the target page may be a page in the WEB platform for generating a structured query statement (such as an SQL statement) or may be a page in the WEB platform for configuring the structured query statement.
In the disclosed embodiment, the first event may include, but is not limited to, a click event, a double click event, a long press event, a drag event, a selection event, a touch event, and the like.
In the disclosed embodiment, the first key is used for generating a structured query statement (such as an SQL statement), such as the first key may include, but is not limited to, select, from, where (filter key, act on table, filter records before aggregation), group by, having (filter key, act on group, filter records after grouping), order by, limit, left join (left join, also called left outer join), inner join, etc.
In the disclosed embodiment, each node in the data tree is used to generate a structured query statement (such as an SQL statement), wherein the data tree can be presented on a target page in a graphical tree component.
In this embodiment of the present disclosure, the first node may be any node in the data tree, for example, the first node may be a leaf node in the data tree, or the first node may also be a non-leaf node in the data tree, which is not limited in this disclosure.
In the embodiment of the present disclosure, an HTML (HyperText Mark-up Language, or HyperText markup Language) event interception technology may be adopted to intercept an event triggered to each DOM object in a target page, where each node in a data tree displayed in the target page may be regarded as one DOM object. When a first event triggered by a first node in a data tree displayed in a target page is monitored, a first keyword corresponding to the first node may be queried according to the first event.
As an example, the correspondence between different nodes, events and keywords may be configured in advance, so in the present disclosure, the correspondence may be queried according to the first node and the first event to obtain the first keyword corresponding to the first node and the first event.
Step 102, obtaining a first attribute content of a first node.
In the disclosed embodiment, the attribute content of a node may include, but is not limited to, the name, value, type, etc. of the node.
In the embodiment of the present disclosure, the attribute content of the first node may be obtained, and is denoted as the first attribute content in the present disclosure.
And 103, generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database.
In the embodiment of the disclosure, a target structured query statement (for example, a target SQL statement) may be generated according to the first keyword and the first attribute content, so as to perform a data processing operation (for example, a query operation, a storage operation, an add/delete operation, an update operation, etc.) matching the target structured query statement on the database.
As an example, taking the structured query statement as an SQL statement, assuming that a first node is not associated with other nodes, a target SQL statement may be generated according to the first keyword and the first attribute content of the first node, where the target SQL statement may not contain an association relationship (such as left join, inner join, etc.) in the statement.
As another example, taking the structured query statement as an SQL statement, assuming that a first node is associated with other nodes, a target SQL statement may be generated according to the attribute contents of the other nodes associated with the first node and the first attribute content of the first node, and according to the first keyword, where the target SQL statement includes an association relationship in the statement.
In the data processing method of the embodiment of the disclosure, a first event triggered by a first node in a data tree displayed in a target page is responded, and a first keyword corresponding to the first node is inquired according to the first event; the first keyword and each node in the data tree are used for generating a structured query statement; acquiring first attribute content of a first node; and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database. Therefore, the structured query statement can be automatically generated in a mode that a user operates (such as clicking, dragging, selecting and the like) on the node in the data tree displayed in the target page, so that data processing operation can be performed on the database according to the structured query statement without manually writing the automatic query statement, the writing or generating difficulty of the SQL statement can be reduced, and the use experience of the user is improved.
In order to clearly illustrate how the target structured query statement is generated according to the first keyword and the first attribute content in the above embodiments, the present disclosure also proposes a data processing method.
Fig. 2 is a schematic flow chart of another data processing method according to an embodiment of the disclosure.
As shown in fig. 2, the data processing method may include the steps of:
step 201, in response to a first event triggered by a first node in a data tree displayed in a target page being intercepted, querying a first keyword corresponding to the first node according to the first event.
Wherein the first key and each node in the data tree are used to generate a structured query statement.
For the explanation of step 201, reference may be made to relevant descriptions in any embodiment of the present disclosure, and details are not described herein.
At least one second node associated with the first node is queried based on the first event, step 202.
The second node may be a leaf node in the data tree, or may also be a non-leaf node in the data tree, which is not limited in this disclosure.
In the embodiment of the present disclosure, at least one second node associated with the first node may also be queried according to the first event.
As an example, the correspondence between different nodes, other nodes associated with the nodes, and the event and the keyword may be configured in advance, so that in the present disclosure, the correspondence may be queried according to the first event and the first node to determine the first keyword corresponding to the first event and the first node, and the correspondence may be queried according to the first event and the first node to determine the at least one second node corresponding to the first event and the first node.
In a possible implementation manner of the embodiment of the present disclosure, the correspondence relationship may be established through the following steps:
(1) And responding to a second event triggered by a third node in the data tree in the target page, and configuring an incidence relation between the third node and at least one fourth node according to the second event.
The third node may be any node in the data tree, and the third node may be a leaf node in the data tree, or may also be a non-leaf node in the data tree, which is not limited in this disclosure.
Wherein the second event includes, but is not limited to, a click event, a double click event, a long press event, a drag event, a selection event, a touch event, etc.
In the embodiment of the present disclosure, when a second event triggered by a third node in a data tree in a target page is monitored, an association relationship between the third node and at least a fourth node may be configured according to the second event.
As an example, the data tree may be as shown in the area 31 in FIG. 3, in which the sub-area 311 in the area 31 is shown as a root node, and the sub-area 312 in the area 32 is shown as non-leaf nodes (i.e. each row of character strings in the sub-area 312 is the name of one non-leaf node), in which no leaf node is shown in the area 31. A leaf node below a certain non-leaf node in the sub-region 312 may be displayed in the region 32 by clicking or dragging, for example, a leaf node below a non-leaf node bdap.act _ evt _ log (not shown in the sub-region 312) is displayed in the sub-region 321 of the region 32; act _ ge _ property (not shown in sub-region 312) is shown in sub-region 322 of region 32.
When configuring the association relationship, the child node of the non-leaf node bdap.act _ evt _ log (e.g., TASK _ ID _shownin the area 3211 in the sub-area 321) may be associated with the child node of the non-leaf node bdap.act _ ge _ property (e.g., NAME _shownin the area 3221 in the sub-area 322) by means of dragging. For example, the third node may be a leaf node TASK _ ID _, the third event may be a drag event, and the association relationship between the leaf node (TASK _ ID _) and the leaf node (NAME _) may be established by listening to the drag event. Further, an association relationship between a non-leaf node (bdap. Act _ evt _ log) and a non-leaf node (bdap. Act _ ge _ property) may also be established.
(2) A second keyword is determined from the plurality of keywords presented in the destination page.
For example, the second keyword may be determined by a related technician from a plurality of keywords presented in the target page.
As an example, taking the target page as shown in fig. 3, a plurality of keywords are shown in the area 33 in fig. 3, and the technician can select the second keyword from the plurality of keywords. Wherein the number of the second keywords may be at least one.
It should be noted that the keywords in fig. 3 are only exemplary, that is, fig. 3 is only exemplified BY the keywords including SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY, but the disclosure is not limited thereto, and in practical applications, the target page may also display other keywords, which is not limited thereto.
(3) And establishing a corresponding relation among the second event, the second keyword, the third node and at least one fourth node.
In the disclosed embodiment, a correspondence relationship between the second event, the second keyword, the third node, and at least one fourth node may be established.
That is, the correspondence relationship may be configured in advance in a visual manner by a person skilled in the art, and the structured query sentence may be generated based on the correspondence relationship.
Step 203, obtaining a first attribute content of the first node and a second attribute content of at least one second node.
In the embodiment of the present disclosure, the first attribute content of the first node and the second attribute content of each second node may be acquired.
And 204, generating a target structured query statement according to the first keyword, the first attribute content and the second attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database.
In the embodiment of the present disclosure, a target structured query statement may be generated according to the first keyword, the first attribute content of the first node, and the second attribute content of each second node, so as to perform a data processing operation (such as a query operation, a storage operation, an add/delete operation, an update operation, and the like) matching the target structured query statement on the database.
As a possible implementation manner, in order to improve the accuracy of the result generated by the target structured query statement, structured information (such as data in JSON format (hereinafter referred to as JSON data), that is, data in the form of Key (Key) Value (Value) pairs) may be generated according to the first keyword, the association relationship between the first node and the at least one second node, and the first attribute content and the second attribute content, so that the structured information may be converted into the target structured query statement.
As an example, structured information is JSON data, a structured query statement is SQL statement, the JSON data may be converted into the SQL statement based on a set conversion rule, the set conversion rule may be an existing JSON to SQL rule, or may be a JSON to SQL rule customized by a related technician, and the disclosure is not limited thereto. For example, the SQL statement may be generated by concatenating and assembling the key name and the value to different positions of the final SQL statement (character string) according to different key values of the JSON data through a loop statement.
In a possible implementation manner of the embodiment of the present disclosure, a corresponding relationship between the structured information and the target structured query statement may also be stored, so that the corresponding relationship may be provided to other platforms for use, and the user is helped to visually generate the structured query statement (such as an SQL statement) without manually writing the structured query statement by the user. Moreover, the structured information and the target structured query statement are stored in the database, so that the structured information or the target structured query statement can be called for many times without repeatedly generating the same structured query statement.
In addition, the structured query statement is exemplified as an SQL statement, and generally, the SQL statement is used when a certain function (such as data quality analysis) is executed, a functional module using the SQL statement is to store data, and a module storing the SQL statement is required to call the function. Therefore, in the present disclosure, the corresponding relationship between the structured information and the target structured query statement is saved, and the above functions can be normally executed.
The data processing method of the embodiment of the disclosure can effectively generate the target structured query statement according to the attribute content of the first node, the attribute content of each second node associated with the first node, and the first keyword.
In order to clearly illustrate any one of the above embodiments, the present disclosure further provides a data processing method.
Fig. 4 is a schematic flow chart of another data processing method according to the embodiment of the present disclosure.
As shown in fig. 4, the data processing method may include the steps of:
step 401, determining a target service scenario.
It should be noted that, for different business scenarios, the generated SQL statements may be different, and the data trees for generating the SQL statements may be different.
Therefore, in the present disclosure, in order to enable the generated structured query statement to meet an actual business requirement, a business scenario corresponding to a WEB platform (e.g., a data service platform, a data management and control platform, etc.) may be determined, and is denoted as a target business scenario in the present disclosure.
Step 402, loading a plurality of data tables matched with the target service scene.
In the embodiment of the present disclosure, a plurality of data tables matching with a target service scenario may be loaded. For example, data tables corresponding to different service scenes may be collected in advance, and a mapping relationship between the data tables and the service scenes may be established, so that in the present disclosure, the mapping relationship may be queried according to a target service scene to determine a plurality of data tables matching the target service scene, and load the plurality of data tables matching the target service scene.
As an example, a plurality of data tables matching with the target business scenario can be loaded through an interface provided by a WEB platform.
And 403, generating a data tree according to the plurality of data tables, and displaying the data tree on the target page.
In the embodiment of the present disclosure, the data tree may be generated according to a plurality of data tables, for example, attribute contents (such as names, values, types, and the like) of the plurality of data tables may be obtained, non-leaf nodes in the data tree may be generated according to the attribute contents of the plurality of data tables, and leaf nodes in the data tree may be generated according to field information included in the plurality of data tables.
As an example, the data tree may be shown as a region 31 in fig. 3, where a sub-region 311 in the region 31 is a root node, and a sub-region 312 in the region 32 is a non-leaf node generated according to the name of the data table, where no leaf node is shown in the region 31. Further, a leaf node below a certain non-leaf node in the area 312 may be displayed in the area 32 by clicking or dragging, for example, a leaf node below a non-leaf node bdap.act _ evt _ log (name of data table) is displayed in the area 32, where each leaf node is displayed in the sub-area 321 in the area 32, and each leaf node is information of each field in the data table bdap.act _ evt _ log.
In the embodiment of the disclosure, the data tree can be displayed on the target page in a visual manner. For example, the destination page may be as shown in FIG. 3 and the data tree may be as shown in area 31 of FIG. 3.
Step 404, in response to a first event triggered by a first node in a data tree displayed in a target page, querying a first keyword corresponding to the first node according to the first event; wherein the first key and each node in the data tree are used to generate a structured query statement.
Step 405, a first attribute content of the first node is obtained.
And 406, generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database.
As an example, assuming that the first node is not associated with other nodes, if a related person drags a non-leaf node bdap.act _ evt _ log into the region 32 FROM the data tree shown in the region 31 in fig. 3, data in a FROM node of structured information (e.g., JSON data) may be generated according to an attribute content (e.g., a table name) of the non-leaf node bdap.act _ evt _ log, and if the related person clicks the leaf node TASK _ ID _ in the sub-region 321 of the region 32, data in a SELECT node in an array below the FROM node of structured information (e.g., JSON data) may be generated according to an attribute content (e.g., a field name) of the leaf node TASK _ ID _.
As another example, assuming that the first node is associated with other nodes, and the related person drags the non-leaf nodes bdap. Act _ evt _ log and bdap. Act _ ge _ property into the region 32 FROM the data tree shown in the region 31 in fig. 3, the data in the FROM node may be generated according to the attribute content (such as table NAME) of the non-leaf node bdap. Act _ evt _ log and the attribute content (such as table NAME) of the non-leaf node bdap. Act _ ge _ property, and the related person may create the data in the FROM node by clicking the leaf node TASK _ ID (shown in the region 3211) in the sub-region 321 of the region 32, and associating the FROM node TASK _ ID _ with the leaf node NAME (shown in the region 3221) in the sub-region 322 of the region 32 by dragging, the related person may create the relationship between the attribute content (such as field NAME) of the leaf node TASK _ ID and the attribute content (such as field NAME) of the leaf node, and the FROM node data in the FROM node array of the FROM the off node (such as table NAME) and the related data (ON node) in the sub-region 32.
Thereafter, the structured information (e.g., JSON data) can be converted to a target structured query statement (e.g., SQL statement) based on the set conversion rules. The structured information is JSON data, and the structured query statement is an SQL statement for example, the set conversion rule may be an existing JSON to SQL rule, or may also be a JSON to SQL rule customized by a relevant technician, and the comparison in the present disclosure is not limited. For example, the SQL statement may be generated by concatenating and assembling the key name and the value to different positions of the final SQL statement (character string) according to different key values of the JSON data through a loop statement.
For explanation of steps 404 to 406, reference may be made to relevant description in any embodiment of the present disclosure, and details are not repeated herein.
As an example, a structured query statement is taken as an SQL statement for example, the SQL statement can be visually generated and edited on line on a WEB platform, and the generation difficulty of the SQL statement is reduced, so that business personnel can participate in the creation of the SQL statement even when they are unfamiliar with SQL technology.
The method comprises the following steps of realizing visual generation of SQL sentences on a WEB platform:
1. and loading the data table.
And loading a related data table (containing field information) for generating SQL statements through an interface provided by a WEB platform, putting the data table into a data tree (dataTree), and displaying the data table by a graphical tree component.
2. And (4) binding the event.
The method comprises the steps of binding a dragging event of a data table, a dragging event and a correlation event of a field, and a clicking event of an operation menu, mapping keywords of an SQL statement to an event triggered by a DOM object (such as a node in a data tree) in a target page and attribute contents of the DOM object, and establishing a corresponding relation (or called mapping relation).
For example, the non-leaf node bdap. Act _ evt _ log in the area 31 in fig. 3 can be dragged into the sub-area 321 of the area 32, and the non-leaf node bdap. Act _ ge _ property in the area 31 can be dragged into the sub-area 322 of the area 32. The child nodes of the non-leaf node bdap.act _ evt _ log (e.g., TASK _ ID _ in field 3211 in sub-area 321) may be associated by dragging with the child nodes of the non-leaf node bdap.act _ ge _ property (e.g., NAME _ in field 3221 in sub-area 322).
3. And intercepting the user operation.
And intercepting the operation content of a target page of a user in the WEB platform through defining an event, such as a mouse click event, a dragging event and the like, acquiring the attribute content of an event object in the interception method, and organizing a data relationship through the corresponding relationship defined in the step 2.
And 4, converting data.
And (3) generating data relation and data content according to the corresponding relation defined in the step (2) for the collected event result and the attribute content in the event object, and processing and converting the data relation and the data content into JSON data based on a set rule. The JSON data is stored in a front-end cache during user operation. When the user needs to preview the SQL statement, the JSON data is converted into the SQL statement by the parsing method, and the SQL statement is displayed at the front end, for example, the generated SQL statement may be as shown in the area 51 in fig. 5.
And 5, storing the data.
JSON data and SQL sentences generated by the front end are stored in a database through a background interface.
Therefore, the online creation and editing of the SQL sentences on the WEB platform can be realized by adopting visual supporting, pulling, dragging, clicking and other modes.
The data processing method of the embodiment of the disclosure can realize effective generation of the data tree according to a plurality of data tables matched with the required service scene.
Corresponding to the data processing method provided in the embodiment of fig. 1 to 4, the present disclosure also provides a data processing apparatus, and since the data processing apparatus provided in the embodiment of the present disclosure corresponds to the data processing method provided in the embodiment of fig. 1 to 4, the implementation of the data processing method is also applicable to the data processing apparatus provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the data processing apparatus 600 may include: a query module 601, an acquisition module 602, and a generation module 603.
The query module 601 is configured to, in response to a first event triggered by a first node in a data tree displayed in a target page being intercepted, query a first keyword corresponding to the first node according to the first event; wherein the first key and each node in the data tree are used to generate a structured query statement.
The obtaining module 602 is configured to obtain a first attribute content of a first node.
The generating module 603 is configured to generate a target structured query statement according to the first keyword and the first attribute content, where the target structured query statement is configured to perform a data processing operation matched with the target structured query statement on the database.
In a possible implementation manner of the embodiment of the present disclosure, the generating module 603 is specifically configured to: querying at least one second node associated with the first node according to the first event; acquiring second attribute content of at least one second node; and generating a target structured query statement according to the first keyword, the first attribute content and the second attribute content.
In a possible implementation manner of the embodiment of the present disclosure, the generating module 603 is specifically configured to: generating structural information according to the first keyword, the incidence relation between the first node and at least one second node, and the first attribute content and the second attribute content; the structured information is converted into a target structured query statement.
In a possible implementation manner of the embodiment of the present disclosure, the data processing apparatus 600 may further include:
and the configuration module is used for responding to a second event triggered by a third node in the data tree in the target page and configuring the incidence relation between the third node and at least one fourth node according to the second event.
The first determining module is used for determining a second keyword from a plurality of keywords displayed in the target page.
And the establishing module is used for establishing a corresponding relation among the second event, the second keyword, the third node and at least one fourth node.
In a possible implementation manner of the embodiment of the present disclosure, the query module 601 is specifically configured to: and inquiring the corresponding relation according to the first event and the first node so as to determine a first keyword corresponding to the first event and the first node.
Correspondingly, the generating module 603 is specifically configured to: and inquiring the corresponding relation according to the first event and the first node so as to determine at least one second node corresponding to the first event and the first node.
In a possible implementation manner of the embodiment of the present disclosure, the data processing apparatus 600 may further include:
and the storage module is used for storing the corresponding relation between the structured information and the target structured query statement.
In a possible implementation manner of the embodiment of the present disclosure, the data processing apparatus 600 may further include:
and the second determining module is used for determining the target service scene.
And the loading module is used for loading a plurality of data tables matched with the target service scene.
And the processing module is used for generating a data tree according to the plurality of data tables and displaying the data tree on the target page.
In a possible implementation manner of the embodiment of the present disclosure, the processing module is specifically configured to: acquiring attribute contents of a plurality of data tables; generating non-leaf nodes in the data tree according to the attribute contents of the data tables; and generating leaf nodes in the data tree according to the field information contained in the plurality of data tables.
The data processing device of the embodiment of the disclosure queries a first keyword corresponding to a first node according to a first event by responding to the first event triggered by the first node in the data tree displayed in a target page; the first keyword and each node in the data tree are used for generating a structured query statement; acquiring first attribute content of a first node; and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on the database. Therefore, the structured query statement can be automatically generated in a mode that a user operates (such as clicking, dragging, selecting and the like) the node in the data tree displayed in the target page, so that data processing operation can be performed on the database according to the structured query statement without manually compiling the automatic query statement, the compiling or generating difficulty of the SQL statement can be reduced, and the use experience of the user can be improved.
In order to implement the foregoing embodiments, the present disclosure further provides an electronic device, where the electronic device may be any device with computing capability, and the electronic device includes: the present invention relates to a data processing method, and a computer program stored in a memory and executable on a processor, wherein the processor executes the program to implement the data processing method according to any of the embodiments of the present disclosure.
As an example, fig. 7 is a schematic structural diagram of an electronic device 700 shown in an exemplary embodiment of the disclosure, and as shown in fig. 7, the electronic device 700 may further include:
a memory 710 and a processor 720, a bus 730 connecting different components (including the memory 710 and the processor 720), wherein the memory 710 stores a computer program, and when the processor 720 executes the program, the page jump method according to the embodiment of the disclosure is implemented.
Bus 730 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 700 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 700 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 710 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 740 and/or cache memory 750. The server 700 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 760 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7 and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 730 through one or more data media interfaces. Memory 710 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 780 having a set (at least one) of program modules 770 may be stored, for example, in memory 710, such program modules 770 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which may comprise an implementation of a network environment. Program modules 770 typically perform the functions and/or methods of the embodiments described in this disclosure.
The electronic device 700 may also communicate with one or more external devices 790 (e.g., keyboard, pointing device, display 791, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur over input/output (I/O) interfaces 792. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 793. As shown, the network adapter 793 communicates with the other modules of the electronic device 700 over a bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
The processor 720 executes various functional applications and data processing by executing programs stored in the memory 710.
It should be noted that, for the implementation process and the technical principle of the electronic device of this embodiment, reference is made to the foregoing explanation of the data processing method of the embodiment of the present disclosure, and details are not described herein again.
In order to achieve the above embodiments, the present disclosure also proposes a non-transitory computer readable storage medium on which a computer program is stored, which when executed by a processor implements a data processing method as proposed in any one of the preceding embodiments of the present disclosure.
In order to implement the above embodiments, the present disclosure also proposes a computer program product, wherein when the instructions in the computer program product are executed by a processor, the data processing method proposed by any one of the foregoing embodiments of the present disclosure is executed.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In the description of the present disclosure, "a plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure, and that changes, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present disclosure.

Claims (10)

1. A method of data processing, the method comprising:
responding to a first event triggered by a first node in a data tree displayed in a target page, and inquiring a first keyword corresponding to the first node according to the first event; wherein the first keyword and each node in the data tree are used to generate a structured query statement;
acquiring first attribute content of the first node;
and generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database.
2. The method of claim 1, wherein generating the target structured query statement according to the first keyword and the first attribute content comprises:
querying at least one second node associated with the first node according to the first event;
acquiring second attribute content of the at least one second node;
and generating a target structured query statement according to the first keyword, the first attribute content and the second attribute content.
3. The method of claim 2, wherein generating a target structured query statement from the first keyword, the first attributed content, and the second attributed content comprises:
generating structured information according to the first keyword, the incidence relation between the first node and the at least one second node, and the first attribute content and the second attribute content;
converting the structured information into the target structured query statement.
4. The method of claim 2, further comprising:
responding to a second event triggered by a third node in the data tree in the target page, and configuring an incidence relation between the third node and at least one fourth node according to the second event;
determining a second keyword from a plurality of keywords displayed in the target page;
establishing a correspondence between the second event, the second keyword, the third node, and the at least one fourth node.
5. The method of claim 4, wherein querying the first keyword corresponding to the first node according to the first event comprises:
according to the first event and the first node, inquiring the corresponding relation to determine a first keyword corresponding to the first event and the first node;
correspondingly, the querying at least one second node associated with the first node according to the first event includes:
and inquiring the corresponding relation according to the first event and the first node so as to determine at least one second node corresponding to the first event and the first node.
6. The method according to any one of claims 1-5, further comprising:
and storing the corresponding relation between the structural information and the target structural query statement.
7. The method according to any one of claims 1-5, further comprising:
determining a target service scene;
loading a plurality of data tables matched with the target service scene;
and generating a data tree according to the data tables, and displaying the data tree on the target page.
8. The method of claim 7, wherein generating the data tree from the plurality of data tables comprises:
acquiring attribute contents of the plurality of data tables;
generating non-leaf nodes in the data tree according to the attribute contents of the data tables;
and generating leaf nodes in the data tree according to the field information contained in the data tables.
9. A data processing apparatus, characterized in that the apparatus comprises:
the query module is used for responding to a first event triggered by a first node in a data tree displayed in a target page, and querying a first keyword corresponding to the first node according to the first event; wherein the first keyword and each node in the data tree are used to generate a structured query statement;
an obtaining module, configured to obtain a first attribute content of the first node;
and the generating module is used for generating a target structured query statement according to the first keyword and the first attribute content, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to any of claims 1-8 when executing the program.
CN202211214014.4A 2022-09-30 2022-09-30 Data processing method, device, equipment and medium Active CN115576974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211214014.4A CN115576974B (en) 2022-09-30 2022-09-30 Data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211214014.4A CN115576974B (en) 2022-09-30 2022-09-30 Data processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN115576974A true CN115576974A (en) 2023-01-06
CN115576974B CN115576974B (en) 2023-12-12

Family

ID=84582796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211214014.4A Active CN115576974B (en) 2022-09-30 2022-09-30 Data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115576974B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116150436A (en) * 2023-04-14 2023-05-23 北京锐服信科技有限公司 Data display method and system based on node tree
CN116466932A (en) * 2023-03-27 2023-07-21 飞算数智科技(深圳)有限公司 Method, device, storage medium and electronic device for generating database statement
CN116501752A (en) * 2023-03-27 2023-07-28 中银金融科技有限公司 Data query method, device, electronic equipment and storage medium
CN116932839A (en) * 2023-07-14 2023-10-24 京东方科技集团股份有限公司 SQL interaction method of webpage end and electronic equipment
CN119179710A (en) * 2024-11-22 2024-12-24 之江实验室 Data analysis method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092594A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Virtualizing schema relations over a single database relation
CN110008232A (en) * 2019-04-11 2019-07-12 北京启迪区块链科技发展有限公司 Generation method, device, server and the medium of structured query sentence
CN112506946A (en) * 2020-12-03 2021-03-16 平安科技(深圳)有限公司 Service data query method, device, equipment and storage medium
CN114547076A (en) * 2022-02-21 2022-05-27 京东方科技集团股份有限公司 Data processing method and data processing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160092594A1 (en) * 2014-09-30 2016-03-31 International Business Machines Corporation Virtualizing schema relations over a single database relation
CN110008232A (en) * 2019-04-11 2019-07-12 北京启迪区块链科技发展有限公司 Generation method, device, server and the medium of structured query sentence
CN112506946A (en) * 2020-12-03 2021-03-16 平安科技(深圳)有限公司 Service data query method, device, equipment and storage medium
CN114547076A (en) * 2022-02-21 2022-05-27 京东方科技集团股份有限公司 Data processing method and data processing system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116466932A (en) * 2023-03-27 2023-07-21 飞算数智科技(深圳)有限公司 Method, device, storage medium and electronic device for generating database statement
CN116501752A (en) * 2023-03-27 2023-07-28 中银金融科技有限公司 Data query method, device, electronic equipment and storage medium
CN116150436A (en) * 2023-04-14 2023-05-23 北京锐服信科技有限公司 Data display method and system based on node tree
CN116150436B (en) * 2023-04-14 2023-08-08 北京锐服信科技有限公司 Data display method and system based on node tree
CN116932839A (en) * 2023-07-14 2023-10-24 京东方科技集团股份有限公司 SQL interaction method of webpage end and electronic equipment
CN119179710A (en) * 2024-11-22 2024-12-24 之江实验室 Data analysis method and device, storage medium and electronic equipment
CN119179710B (en) * 2024-11-22 2025-05-06 之江实验室 Data analysis method, device, storage medium and electronic device

Also Published As

Publication number Publication date
CN115576974B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
CN115576974B (en) Data processing method, device, equipment and medium
US12067007B1 (en) Analyzing a pipelined search to determine data on which to execute the pipelined search
CN109697066B (en) Method and system for realizing data sheet splicing and automatically training machine learning model
JP7209306B2 (en) Online work system for Excel documents based on templates
US9607060B2 (en) Automatic generation of an extract, transform, load (ETL) job
WO2021088724A1 (en) Testing method and apparatus
JP2006228210A (en) Using existing content to generate active content wizard executable file for execution of task
CN111324609A (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN113608955B (en) Log recording method, device, equipment and storage medium
CN110889013B (en) Data association method, device, server and storage medium based on XML
CN111813409A (en) A code generation method, device, device and storage medium for an interactive interface
KR102490941B1 (en) An online report creation system using Excel tool
US20250181826A1 (en) Displaying data dimension of a descendant worksheet and data from one or more non-direct ancestor worksheets of a client-side spreadsheet
CN118394835B (en) Analysis method, device, equipment and storage medium for power grid data
CN114201615B (en) Scientific research data change review method and server based on data snapshot
CN114661806A (en) Design data processing method, device, equipment and medium
CN112506512B (en) Human-computer interaction interface generation method, device and computer equipment
CN113918194A (en) A display method, device, electronic device and storage medium for page components
CN114297443B (en) Processing method, device, equipment and storage medium of graph data query statement
CN115577032A (en) A JSON-to-SQL method, device, terminal and storage medium
CN109814864A (en) A kind of data visualization method, visualization system, Web browsing system and equipment
CN115422221A (en) A query construction method, query builder, device and medium for a webpage form
JPH07282079A (en) Link display method
CN109271161B (en) Template code generation method and device, storage device and computer device
CN113626423A (en) Log management method, device and system of service database

Legal Events

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