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

Data processing method, device, equipment and medium Download PDF

Info

Publication number
CN115576974B
CN115576974B CN202211214014.4A CN202211214014A CN115576974B CN 115576974 B CN115576974 B CN 115576974B CN 202211214014 A CN202211214014 A CN 202211214014A CN 115576974 B CN115576974 B CN 115576974B
Authority
CN
China
Prior art keywords
node
event
data
query statement
target
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.)
Active
Application number
CN202211214014.4A
Other languages
Chinese (zh)
Other versions
CN115576974A (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

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

Abstract

The disclosure provides a data processing method, a device, equipment and a 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 method and the device can automatically generate the structured query statement in a mode that a user operates (such as clicking, dragging, selecting and the like) the nodes in the data tree displayed in the target page, so that the data processing operation can be performed on the database according to the structured query statement, the automatic query statement does not need to be manually written, and the writing or generating difficulty of the SQL statement can be reduced.

Description

Data processing method, device, equipment and medium
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a data processing method, a device, equipment and a medium.
Background
For WEB (World Wide WEB) platform data class systems or database systems, data processing operations (such as query operations, storage operations, add-delete operations, update operations, etc.) may be performed on the data class systems or database systems by SQL (Structured Query Language ) statements.
In the related art, an SQL statement is manually written by a user to perform a data processing operation on a data class system or a database system according to the manually written SQL statement.
However, the above manner of manually writing the SQL sentence is difficult for the user who is not proficient in SQL, and is more prone to grammar errors.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
The present disclosure proposes a data processing method, apparatus, device, and medium, so as to automatically generate a structured query statement by a user operating (such as clicking, dragging, selecting, etc.) a node in a data tree displayed in a target page, so that the data processing operation can be performed on a database according to the structured query statement, without manually writing an automated query statement, writing or generating difficulty of an SQL statement can be reduced, and use experience of the user is improved.
An embodiment of a 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 each node in the first keyword and the data tree is 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.
According to the data processing method, a first event triggered to a first node in a data tree displayed in a target page is detected, and a first keyword corresponding to the first node is inquired according to the first event; wherein each node in the first keyword and the data tree is 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 method and the device can automatically generate the structured query statement in a mode that a user operates (such as clicking, dragging, selecting and the like) the nodes in the data tree displayed in the target page, so that the data processing operation can be performed on the database according to the structured query statement, the automatic query statement does not need to be manually written, 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 proposes a data processing apparatus including:
the query module is used for responding to the first event triggered by the first node in the data tree displayed in the target page, and querying a first keyword corresponding to the first node according to the first event; wherein each node in the first keyword and the data tree is used to generate a structured query statement;
the acquisition module is used for acquiring the first attribute content of the first node;
and the generation 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.
According to the data processing device, a first keyword corresponding to a first node is inquired according to a first event, wherein the first event is triggered by the first node in a data tree displayed in a target page; wherein each node in the first keyword and the data tree is 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 method and the device can automatically generate the structured query statement in a mode that a user operates (such as clicking, dragging, selecting and the like) the nodes in the data tree displayed in the target page, so that the data processing operation can be performed on the database according to the structured query statement, the automatic query statement does not need to be manually written, 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 third aspect of the present disclosure provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a data processing method as set forth in an embodiment of the first aspect of the disclosure when the program is executed.
An embodiment of a fourth aspect of the present disclosure proposes a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data processing method as proposed by an embodiment of the first aspect of the present disclosure.
Embodiments of a fifth aspect of the present disclosure propose a computer program product, which when instructions in the computer program product are executed by a processor, performs a data processing method as proposed by embodiments of the first aspect of the present disclosure.
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, in which:
fig. 1 is a flow chart of a data processing method according to an embodiment of the disclosure;
FIG. 2 is a flow chart of another data processing method according to an embodiment of the disclosure;
FIG. 3 is a schematic diagram of a target page according to an embodiment of the disclosure;
FIG. 4 is a flowchart of another data processing method according to an embodiment of the present disclosure;
FIG. 5 is a second schematic diagram of a target page according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram of a data processing apparatus according to an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
Currently, for a WEB platform data class system, an SQL statement may be manually written by a user to perform a data processing operation on the data class system according to the manually written SQL statement. Alternatively, the SQL statement may be generated at other platforms and copied to the current WEB platform data class system for use.
However, for a user who is not proficient in SQL, the difficulty of manually writing SQL sentences is high, and grammar errors are unavoidable; for users familiar with SQL, writing errors are easy to occur because no code prompt exists and the data table and field information are manually input. In addition, for the manually written SQL statement, the difficulty of checking grammar errors is also relatively large because of no grammar restriction.
Accordingly, in view of at least one of the above-mentioned problems, the present disclosure proposes a data processing method, apparatus, electronic device, and storage medium.
Data processing methods, apparatuses, devices, and media of 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, general technical words are first introduced:
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, JS object profile) is a lightweight data exchange format.
Fig. 1 is a flow chart of a data processing method according to an embodiment of the disclosure.
In the embodiment of the disclosure, the data processing method can be applied to any electronic device, so that the electronic device can execute the data processing function.
The electronic device may be any device with computing capability, for example, a PC (Personal Computer ), an industrial computer, a mobile terminal, a server, etc., and the mobile terminal may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, etc., which has various hardware devices including an operating system, a touch screen, and/or a display screen.
As shown in fig. 1, the data processing method may include the steps of:
step 101, 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 each node in the first key and the data tree is used to generate a structured query statement.
In the embodiment of the disclosure, the target page may be a page in a WEB platform (such as a data service platform, a data management platform, etc.), 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 embodiments, 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 select event, a touch event, and the like.
In the embodiment of the present disclosure, the first keyword is used to generate a structured query term (such as an SQL term), for example, the first keyword may include, but is not limited to, select, from, where (filtering keyword, acting on a table, filtering records before aggregation), group by, handling (filtering keyword, acting on a group, filtering records after grouping), order by, limit, left join (left join, also called left outer join), inner join, and the like.
In the disclosed embodiment, each node in the data tree is used to generate a structured query statement (e.g., an SQL statement), where the data tree may be exposed on the target page in a graphical tree component.
In the 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 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) event interception technology may be used to intercept events triggered on DOM objects in a target page, where each node in a data tree shown in the target page may be regarded as a DOM object. In the case of monitoring a first event triggered to a first node in a data tree presented in a target page, a first keyword corresponding to the first node may be queried according to the first event.
As an example, correspondence between different nodes, events, and keywords may be preconfigured, so in the present disclosure, the correspondence may be queried according to a first node and a first event to obtain a first keyword corresponding to the first node and the first event.
Step 102, obtaining first attribute content of a first node.
In the embodiments of the present disclosure, attribute contents of the node may include, but are not limited to, a name, a value, a type, and the like of the node.
In the embodiment of the present disclosure, attribute content of the first node may be obtained, which is denoted as first attribute content in the present disclosure.
And step 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 an embodiment of the disclosure, a target structured query statement (such as 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 (such as 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 for example, assuming that the 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 include 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 for example, assuming that a first node is associated with another node, a target SQL statement may be generated according to attribute contents of the other node associated with the first node and first attribute contents of the first node, and according to a first keyword, where the target SQL statement includes an association relationship in the statement.
According to the data processing method, a first event triggered to a first node in a data tree displayed in a target page is detected, and a first keyword corresponding to the first node is inquired according to the first event; wherein each node in the first keyword and the data tree is 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 method and the device can automatically generate the structured query statement in a mode that a user operates (such as clicking, dragging, selecting and the like) the nodes in the data tree displayed in the target page, so that the data processing operation can be performed on the database according to the structured query statement, the automatic query statement does not need to be manually written, 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 embodiment, the present disclosure further proposes a data processing method.
Fig. 2 is a flowchart 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, 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 each node in the first key and the data tree is used to generate a structured query statement.
The explanation of step 201 may be referred to the relevant description in any embodiment of the present disclosure, and will not be repeated here.
Step 202, at least one second node associated with a first node is queried according to a first event.
The second node may be a leaf node in the data tree, or may be a non-leaf node in the data tree, as this disclosure is not limited.
In an 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, correspondence between different nodes, other nodes associated with the nodes, and the event and the keyword may be preconfigured, so in the present disclosure, the correspondence may be queried according to the first event and the first node to determine a 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 at least one second node corresponding to the first event and the first node.
In one possible implementation manner of the embodiments of the present disclosure, the above correspondence may be established by 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 the association relationship 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 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 select event, a touch event, and the like.
In the embodiment of the disclosure, when a second event triggered to 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, where the sub-area 311 in the area 31 shows a root node, and the sub-area 312 in the area 32 shows non-leaf nodes (i.e., each line of character string in the sub-area 312 is a name of a non-leaf node), where no leaf node is shown in the area 31. A leaf node under a certain non-leaf node in the sub-area 312 may be shown in the area 32 by clicking or dragging, for example, a leaf node under a non-leaf node bdap. Act_evt_log (not shown in the sub-area 312) is shown in the sub-area 321 of the area 32; for example, a leaf node under the non-leaf node bdap. Act_ge_property (not shown in sub-region 312) is shown in sub-region 322 of region 32.
When the association relationship is configured, the child node of the non-leaf node bdap.act_evt_log (for example, task_id_ shown by a region 3211 in the sub-region 321) may be associated with the child node of the non-leaf node bdap.act_ge_property (for example, name_ shown by a region 3221 in the sub-region 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 an association relationship between the leaf node (task_id_) and the leaf node (name_) may be established through interception of the drag event. Further, an association relationship between the non-leaf node (bdap. Act_evt_log) and the non-leaf node (bdap. Act_ge_property) may also be established.
(2) And determining a second keyword from the plurality of keywords displayed in the target 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, illustrated in fig. 3 with a target page, a plurality of keywords are shown in the area 33 in fig. 3, and a technician may select a 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 illustrated BY keywords including SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY, but the disclosure is not limited thereto, and the target page may also show other keywords in practical application, 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 embodiment of the disclosure, a correspondence relationship among the second event, the second keyword, the third node, and the at least one fourth node may be established.
That is, the correspondence may be configured in advance by a related technician in a visual manner, so that a structured query sentence may be generated based on the correspondence.
Step 203, obtaining first attribute content of the first node and second attribute content of at least one second node.
In the embodiment of the 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 disclosure, the 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, etc.) matched with the target structured query statement on the database.
As a possible implementation manner, in order to improve the accuracy of the target structural query statement generating result, structural information (such as JSON format data (hereinafter referred to as JSON data), that is, data in the form of Key (Key) Value pair) may be generated according to the first keyword, the association relationship between the first node and at least one second node, and the first attribute content and the second attribute content, so that the structural information may be converted into the target structural query statement.
As an example, taking the structured information as JSON data and the structured query statement as an SQL statement, JSON data may be converted into an SQL statement based on a set conversion rule, where 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 comparison of the disclosure is not limited. For example, the SQL sentence can be generated by splicing and assembling key names and value values to different positions of the final SQL sentence (character string) according to different key values of the JSON data through a loop sentence.
In a possible implementation manner of the embodiment of the present disclosure, a correspondence between the structured information and the target structured query statement may also be saved, so that the correspondence may be provided for other platforms to use, to help a user 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 multiple times without repeatedly generating the same structured query statement.
In addition, taking the structured query statement as an example of an SQL statement, the SQL statement is generally used when performing a certain function (such as data quality analysis), a function module using the SQL statement is to store data, and storing the SQL statement is a requirement of a module that invokes the function. Therefore, in the present disclosure, the correspondence between the structured information and the target structured query statement is saved, so that the normal execution of the above functions can be realized.
According to the data processing method, the target structured query statement can be effectively generated 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 of the above embodiments, the present disclosure also proposes a data processing method.
Fig. 4 is a flowchart of another data processing method according to an embodiment of the disclosure.
As shown in fig. 4, the data processing method may include the steps of:
in step 401, a target business scenario is determined.
It should be noted that, for different business scenarios, the generated SQL statements may be different, and the data tree used to generate the SQL statements may be different.
Therefore, in the present disclosure, in order to enable the generated structured query statement to meet the actual service requirement, a service scenario corresponding to a WEB platform (such as a data service platform, a data management platform, etc.) may be determined, which is denoted as a target service scenario in the present disclosure.
Step 402, loading a plurality of data tables matched with the target business scenario.
In the embodiment of the disclosure, a plurality of data tables matched with a target business scene can 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 in the present disclosure, the mapping relationship may be queried according to a target service scene to determine a plurality of data tables matched with the target service scene, and a plurality of data tables matched with the target service scene may be loaded.
As an example, multiple data tables matching the target business scenario may be loaded through an interface provided by the WEB platform.
Step 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 disclosure, the data tree may be generated according to a plurality of data tables, for example, attribute contents (such as names, values, types, etc.) of the plurality of data tables may be acquired, 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 contained in the plurality of data tables.
As an example, the data tree may be as shown in region 31 in fig. 3, where sub-region 311 in region 31 is the root node and sub-region 312 in region 32 is a non-leaf node generated from the name of the data table, where no leaf node is shown in region 31. Further, a leaf node under a certain non-leaf node in the area 312 may be shown in the area 32 by clicking or dragging, for example, a leaf node under a non-leaf node bdap. Act_evt_log (a name of a data table) is shown in the area 32, where a sub-area 321 in the area 32 is shown as each leaf node, and each leaf node is each field information 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 region 31 of FIG. 3.
Step 404, 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 each node in the first key and the data tree is used to generate a structured query statement.
Step 405, obtain first attribute content of a first node.
And step 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, the relevant person drags the non-leaf node bdap.act_evt_log FROM the data tree shown by the area 31 in fig. 3 into the area 32, the data in the structuring information (such as JSON data) FROM the node frame may be generated according to the attribute content (such as table name) of the non-leaf node bdap.act_evt_log, the relevant person clicks the leaf node task_id_ in the sub-area 321 of the area 32, and the data in the SELECT node in the array under the structuring information (such as JSON data) FROM the attribute content (such as field name) of the leaf node task_id_.
As another example, assuming that the first node is associated with another node, and a related person drags the non-leaf nodes bdap_evt_log and bdap_act_ge_property FROM the data tree shown in the area 31 in fig. 3 into the area 32, structural information (such as JSON data) is generated according to attribute contents (such as table NAMEs) of the non-leaf nodes bdap_evt_log and attribute contents (such as table NAMEs) of the non-leaf nodes bdap_act_property, and the related person can create association information (such as JSON data) in the frame node by clicking ON the leaf node task_id_ (shown in the area 321 of the area 32) and associating the leaf node task_id_ with the leaf node name_ (shown in the area 3221) in the area 322 of the area 32 by way, and can create association information (such as field NAMEs) of the leaf node task_id_ with the leaf node NAME and attribute contents (such as table NAMEs) of the leaf node NAME) in the area 322, and association information (such as JSON data) in the area under the leaf node in the area 321 of the area 32.
The structured information (e.g., JSON data) can then be converted into a target structured query statement (e.g., SQL statement) based on the set conversion rules. The structured information is taken as JSON data, the structured query statement is taken as SQL statement for example, the set conversion rule can be the existing JSON-SQL rule or can be the JSON-SQL rule customized by related technicians, and the comparison of the present disclosure is not limited. For example, the SQL sentence can be generated by splicing and assembling key names and value values to different positions of the final SQL sentence (character string) according to different key values of the JSON data through a loop sentence.
The explanation of steps 404 to 406 may be referred to the relevant descriptions in any embodiment of the disclosure, and are not repeated here.
As an example, the structured query statement is taken as an SQL statement for example, the SQL statement can be generated and edited in an online visual manner 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 under the condition of unfamiliar with the SQL technique.
The visual generation of the SQL sentence can be realized on the WEB platform through the following steps:
1. the data table is loaded.
And loading a related data table (containing field information) for generating SQL sentences through an interface provided by a WEB platform, putting the data table into a data tree (dataTree), and displaying the data table in a graphical tree component.
2. Binding the event.
Binding a dragging event of a data table, a dragging event of a field, an association event and a clicking event of an operation menu, mapping keywords of an SQL sentence 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 referred to as a mapping relation).
For example, the non-leaf node bdap. Act_evt_log in region 31 in fig. 3 may be dragged into sub-region 321 of region 32, and the non-leaf node bdap. Act_ge_property in region 31 may be dragged into sub-region 322 of region 32. The child node of the non-leaf node bdap. Act_evt_log (e.g., task_id_ in region 3211 in sub-region 321) may be associated with the child node of the non-leaf node bdap. Act_ge_property (e.g., name_ in region 3221 in sub-region 322) by way of dragging.
3. And intercepting the user operation.
By defining the event, the operation content of a target page in a WEB platform, such as events of clicking, dragging and the like of a user, is intercepted, the attribute content of an event object is obtained in the interception method, and the data relationship is organized through the corresponding relationship defined in the step 2.
And 4, data conversion.
And (3) generating a data relation and a data content according to the corresponding relation defined in the step (2) by collecting the event result and the attribute content in the event object, and converting the data relation and the data content into JSON data based on a set rule. JSON data is stored in the front-end cache during user operations. When the user needs to preview the SQL sentence, the JSON data is converted into the SQL sentence by an parsing method, and the SQL sentence is displayed at the front end, for example, the generated SQL sentence can be shown as a region 51 in FIG. 5.
And 5, data storage.
And the JSON data and SQL sentences generated at the front end are stored into a database through a background interface.
Therefore, the SQL sentence can be created and edited on line on the WEB platform in a visual mode such as supporting, pulling, dragging and clicking.
The data processing method of the embodiment of the disclosure can effectively generate the data tree according to a plurality of data tables matched with the required service scene.
Corresponding to the data processing method provided by the embodiments of fig. 1 to 4, the present disclosure also provides a data processing apparatus, and since the data processing apparatus provided by the embodiments of the present disclosure corresponds to the data processing method provided by the embodiments of fig. 1 to 4, the implementation of the data processing method is also applicable to the data processing apparatus provided by the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
Fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the 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 query, in response to detecting a first event triggered to a first node in a data tree displayed in a target page, a first keyword corresponding to the first node according to the first event; wherein each node in the first key and the data tree is used to generate a structured query statement.
An obtaining module 602, configured to obtain first attribute content of a first node.
A generating module 603, 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 on the database that matches the target structured query statement.
In one 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 based on 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 one 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 association relation between the first node and at least one second node, and the first attribute content and the second attribute content; and converting the structured information into a target structured query statement.
In one possible implementation of the embodiments of the present disclosure, the data processing apparatus 600 may further include:
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 association relationship between the third node and at least one fourth node according to the second event.
And the first determining module is used for determining a second keyword from the keywords displayed in the target page.
The building module is used for building the corresponding relation among the second event, the second keyword, the third node and at least one fourth node.
In one possible implementation of the embodiment of the disclosure, the query module 601 is specifically configured to: and inquiring the corresponding relation according to the first event and the first node 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 to determine at least one second node corresponding to the first event and the first node.
In one possible implementation of the embodiments 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 one possible implementation of the embodiments of the present disclosure, the data processing apparatus 600 may further include:
and the second determining module is used for determining the target business scene.
And the loading module is used for loading a plurality of data tables matched with the target business 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 one possible implementation manner of the embodiment of the 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 attribute contents of the data tables; leaf nodes in the data tree are generated according to field information contained in the plurality of data tables.
According to the data processing device, a first keyword corresponding to a first node is inquired according to a first event, wherein the first event is triggered by the first node in a data tree displayed in a target page; wherein each node in the first keyword and the data tree is 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 method and the device can automatically generate the structured query statement in a mode that a user operates (such as clicking, dragging, selecting and the like) the nodes in the data tree displayed in the target page, so that the data processing operation can be performed on the database according to the structured query statement, the automatic query statement does not need to be manually written, the writing or generating difficulty of the SQL statement can be reduced, and the use experience of the user is improved.
In order to implement the above embodiment, the present disclosure further proposes an electronic device, where the electronic device may be any device with computing capability, and the electronic device includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a data processing method as set forth in any of the foregoing embodiments of the present disclosure when the program is executed.
As an example, fig. 7 is a schematic structural diagram of an electronic device 700 according to an exemplary embodiment of the present disclosure, and as shown in fig. 7, the electronic device 700 may further include:
memory 710 and processor 720, bus 730 connecting the different components (including memory 710 and processor 720), memory 710 storing a computer program that when executed by processor 720 implements the page skip method described in embodiments of the disclosure.
Bus 730 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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 can 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. 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 or write to non-removable, non-volatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 730 through one or more data medium interfaces. Memory 710 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 780 having a set (at least one) of program modules 770 may be stored in, for example, 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 or some combination of which may include an implementation of a network environment. Program modules 770 typically carry out 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.), one or more devices that enable a user to interact with the electronic device 700, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 792. Also, the electronic device 700 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 793. As shown, the network adapter 793 communicates with other modules of the electronic device 700 over the bus 730. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 700, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 720 executes various functional applications and data processing by running programs stored in the memory 710.
It should be noted that, the implementation process and the technical principle of the electronic device in this embodiment refer to the foregoing explanation of the data processing method in the embodiment of the disclosure, and are not repeated herein.
To achieve the above embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data processing method as proposed in any of the foregoing embodiments of the present disclosure.
To achieve the above embodiments, the present disclosure also proposes a computer program product which, when executed by a processor, performs a data processing method as proposed in any of the previous embodiments of the present disclosure.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means 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, schematic representations of the above terms are not necessarily directed 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, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "a plurality" is at least two, such as two, three, etc., unless explicitly specified 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 specific logical functions or steps of the process, and additional 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.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing 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). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may 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-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
Furthermore, each functional unit in the embodiments of the present disclosure may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present disclosure have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the present disclosure, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the present disclosure.

Claims (7)

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 corresponding relations among different preset nodes, other nodes associated with the nodes and the event and keywords according to the first node and the first event so as to determine the first event and the first keyword corresponding to the first node; wherein each node in the first keyword and the data tree is used to generate a structured query statement;
according to the first event and the first node, searching different preset nodes, other nodes associated with the nodes, and corresponding relations between the event and keywords, so as to determine at least one second node associated with the first event and the first node;
Acquiring second attribute contents of the at least one second node;
acquiring first attribute contents of the first node and second attribute contents of the at least one second node;
generating structured information 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;
converting the structured information into the target structured query statement, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database;
the establishment of the corresponding relation among the preconfigured different nodes, other nodes associated with the nodes, the event and the keywords comprises the following steps:
responding to a second event triggered by a third node in the data tree in the target page, and configuring an association relationship 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;
and establishing a corresponding relation among the second event, the second keyword, the third node and the at least one fourth node.
2. The method of claim 1, wherein querying a first keyword corresponding to the first node based on the first event comprises:
inquiring the corresponding relation according to the first event and the first node to determine a first keyword corresponding to the first event and the first node;
accordingly, 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 to determine at least one second node corresponding to the first event and the first node.
3. The method according to any one of claims 1-2, wherein the method further comprises:
and storing the corresponding relation between the structured information and the target structured query statement.
4. The method according to any one of claims 1-2, wherein the method further comprises:
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 plurality of data tables, and displaying the data tree on the target page.
5. The method of claim 4, wherein generating a 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 attribute contents of the plurality of data tables;
and generating leaf nodes in the data tree according to the field information contained in the data tables.
6. A data processing apparatus, the apparatus comprising:
the query module is used for responding to the detection of a first event triggered by a first node in a data tree displayed in a target page, and querying corresponding relations among different preset nodes, other nodes associated with the nodes and the event and keywords according to the first node and the first event so as to determine the first event and the first keyword corresponding to the first node; wherein each node in the first keyword and the data tree is used to generate a structured query statement;
the acquisition module is used for acquiring the first attribute content of the first node;
the generation module is used for inquiring different preset nodes, other nodes related to the nodes and corresponding relations between the events and keywords according to the first event and the first node so as to determine at least one second node related to the first event and the first node; acquiring second attribute contents of the at least one second node; generating structured information 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; converting the structured information into the target structured query statement, wherein the target structured query statement is used for executing data processing operation matched with the target structured query statement on a database;
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 association relationship 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;
the establishing module is used for establishing the corresponding relation among the second event, the second keyword, the third node and the at least one fourth node.
7. 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 of any of claims 1-5 when the program is executed.
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 CN115576974A (en) 2023-01-06
CN115576974B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116466932A (en) * 2023-03-27 2023-07-21 飞算数智科技(深圳)有限公司 Database statement generation method and device, storage medium and electronic equipment
CN116150436B (en) * 2023-04-14 2023-08-08 北京锐服信科技有限公司 Data display method and system based on node tree

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9805136B2 (en) * 2014-09-30 2017-10-31 International Business Machines Corporation Virtualizing schema relations over a single database relation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN115576974A (en) 2023-01-06

Similar Documents

Publication Publication Date Title
CN115576974B (en) Data processing method, device, equipment and medium
US9607060B2 (en) Automatic generation of an extract, transform, load (ETL) job
US10324828B2 (en) Generating annotated screenshots based on automated tests
WO2021088724A1 (en) Testing method and apparatus
US10409892B2 (en) Formatting data by example
US6502233B1 (en) Automated help system for reference information
US8375356B2 (en) Tabular completion lists
US8601438B2 (en) Data transformation based on a technical design document
CN109697066B (en) Method and system for realizing data sheet splicing and automatically training machine learning model
JP2006228210A (en) Using existing content to generate active content wizard executable file for execution of task
CN111324609B (en) Knowledge graph construction method and device, electronic equipment and storage medium
US11880323B2 (en) System and method for building and implementing automated workflows
JP7209306B2 (en) Online work system for Excel documents based on templates
WO2023125032A1 (en) Scientific research data change review method based on data snapshot, and server
Bao et al. Tracking and Analyzing Cross-Cutting Activities in Developers' Daily Work (N)
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN114297443B (en) Processing method, device, equipment and storage medium of graph data query statement
CN110889013A (en) Data association method, device, server and storage medium based on XML
CN115687704A (en) Information display method and device, electronic equipment and computer readable storage medium
US11847448B2 (en) Automatic generation of exporter configuration rules
CN113885774B (en) Bank counter assembly information real-time acquisition and processing method, system and electronic device
JP6287267B2 (en) Comment management system, comment management method, and program thereof
CN115328478A (en) Page point burying method and device, electronic equipment and medium
CN117707678A (en) Editing method and device of script file, computer equipment and storage medium
CN116737216A (en) Method, apparatus, device, storage medium and program product for managing technical resources

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