A method, system and electronic device for querying data

By processing and analyzing the original information in the visual interface, the structured query language sentence is generated and executed, and the problem of low efficiency and poor accuracy of different users when querying big data in querying big data, and achieved efficient, accurate and convenient data query process.

CN113672638BActive Publication Date: 2025-01-24ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110902604.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-06
Publication Date
2025-01-24
Estimated Expiration
2041-08-06

AI Technical Summary

Technical Problem

When querying big data, it is difficult for the existing technology to take into account different user situations, resulting in low efficiency, poor accuracy and insufficient convenience in writing structured query language statements to obtain target data.

Method used

By obtaining the original information in the visual interface, determine whether it meets the preset conditions, and combine it in accordance with the preset parsing rules with the parsing template to generate an executable structured query language sentence, and perform the sentence to obtain the target data.

Benefits of technology

With different users, the target data are efficiently, accurately, and convenient to take care of different users, reduce the technical threshold, and improve the easy scalability and high availability of the query process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672638B_ABST
    Figure CN113672638B_ABST
Patent Text Reader

Abstract

The present application discloses a method, system and electronic device for querying data, the method comprising determining whether the original information obtained in the visual interface meets the preset conditions; when the original information meets the preset conditions, combining the original information with the preset parsing template according to the preset parsing rules to obtain an executable structured query language statement; executing the structured query language statement to obtain the target data. Based on the above method, it is possible to achieve efficient, accurate and convenient query of target data while taking into account different users, solving the problem in the prior art that it is difficult to obtain the target data by writing a structured query language statement while taking into account different users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a method, system and electronic device for querying data. Background Art

[0002] With the advent of the big data era, in order to quickly extract more valuable business data and models from massive big data assets, it is necessary to apply Structured Query Language (SQL) to operate, which becomes a new challenge for business personnel or developers who are not good at writing SQL.

[0003] In order to address the above challenges, two methods of graphical development, operator set construction and calling are proposed.

[0004] The graphical development method simplifies the difficulty of writing SQL statements in program development by connecting and splicing visual DAG operator components. However, this method does not clearly define the specific structure of the operator, requires users to have SQL theoretical knowledge, has a high threshold for use, and cannot observe the intermediate operator results, resulting in high debugging costs.

[0005] The method of constructing and calling operator sets standardizes the specifications and definitions of operator sets by unifying the interface parameter specifications in the operator units. However, this method does not clarify the specific structure of the upstream and downstream operators in the downstream operator receiving the upstream operator, and because it relies on network interface transmission, there is a problem of low work efficiency.

[0006] In summary, the above two methods have the problem that it is difficult to obtain target data by writing structured query language statements while taking into account different users. Summary of the invention

[0007] The present application provides a method, system and electronic device for querying data, which are used to take into account different users and query target data efficiently, accurately and conveniently.

[0008] In a first aspect, the present application provides a method for querying data, the method comprising:

[0009] Determine whether the original information obtained in the visualization interface meets the preset conditions;

[0010] When the original information meets the preset condition, combining the original information with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement;

[0011] Execute the structured query language statement to obtain target data.

[0012] Through the above method, different users can be taken into account while querying target data more efficiently, accurately and conveniently.

[0013] In a possible design, determining whether the original information obtained in the visualization interface meets a preset condition includes:

[0014] Determining whether there is any information gap in the first information in the original information;

[0015] Determine whether there is any information gap in the second information in the original information;

[0016] It is determined whether data in the third information in the original information matches the basic type of the data.

[0017] Through the above methods, the original information is unified, standardized and transparent.

[0018] In a possible design, before determining whether the original information obtained in the visualization interface meets a preset condition, the method further includes:

[0019] Acquire first information in the original information through the first display area in the visualization interface;

[0020] Acquire second information in the original information through the second display area in the visualization interface;

[0021] The third information in the original information is obtained through the third display area in the visualization interface.

[0022] Through the above method, the complexity of the underlying structured query language is shielded through a visual interface, which can match users with multiple levels of development and lower the technical threshold for obtaining target data.

[0023] In a possible design, the acquiring the first information in the original information through the first display area specifically includes one of the following situations:

[0024] Based on the first display area, obtaining original data selected by a user and obtaining the first information according to the original data;

[0025] Based on the first display area, executing a script statement, and obtaining the first information according to the execution result of the script statement;

[0026] Based on the first display area, the first information is obtained by docking with an upstream operator and according to an output result of the upstream operator.

[0027] Through the above method, complex business scenarios can be targeted, and the operation of querying target data by users at different development levels can be made more concise and flexible.

[0028] In a possible design, the acquiring the third information through the third display area specifically includes one of the following situations:

[0029] Based on the third display area, according to the content and condition input by the user for filtering the first information, obtaining the third information;

[0030] Based on the third display area, the third information is obtained according to the content, condition and method input by the user for filtering the first information.

[0031] Through the above method, complex business scenarios can be targeted, and the operation of querying target data by users at different development levels can be made more concise and flexible.

[0032] In a possible design, when the original information meets the preset condition, the original information is combined with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement, including:

[0033] According to the preset parsing rules and the syntax of the structured query language, the first information, the second information and the third information in the input information are parsed into fragment statements of the structured query language respectively;

[0034] The structured query language fragment statement is inserted into a preset parsing template corresponding to the structured query language to generate an executable structured query language statement.

[0035] Through the above method, an executable structured query language statement is generated within the operator according to the original information obtained, according to the preset parsing rules and the preset parsing template. The user does not need to worry about how to write an executable structured query language statement, and through the corresponding preset parsing template, various structured query language engines can be adapted, which has the advantages of easy scalability and high availability.

[0036] In a second aspect, the present application provides a system for querying data, the system comprising:

[0037] A determination module determines whether the original information obtained in the visualization interface meets the preset conditions;

[0038] A parsing module, when the original information meets the preset condition, combines the original information with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement;

[0039] The execution module executes the structured query language statement to obtain target data.

[0040] In a possible design, the determination module is also used to determine whether there is an information gap in the first information in the original information; determine whether there is an information gap in the second information in the original information; and determine whether the data in the third information in the original information matches the basic type of the data.

[0041] In a possible design, the parsing module is further used to parse the first information, the second information and the third information in the input information into fragment statements of the structured query language according to the preset parsing rules and the grammar of the structured query language; insert the fragment statements of the structured query language into a preset parsing template corresponding to the structured query language to generate an executable structured query language statement.

[0042] In a third aspect, the present application provides an electronic device, the electronic device comprising:

[0043] Memory, used to store computer programs;

[0044] The processor is used to implement the above-mentioned method steps for detecting an object with abnormal motion state when executing the computer program stored in the memory.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method steps for detecting an object with an abnormal motion state are implemented.

[0046] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a possible operator visualization interface scenario provided in this application;

[0048] Figure 2 A flowchart of a method for querying data provided by this application;

[0049] Figure 3 A schematic diagram of a visualization interface of a simple operator provided in this application;

[0050] Figure 4 A schematic diagram of a visualization interface of a professional operator provided in this application;

[0051] Figure 5A schematic diagram of a visualization interface of a system operator provided in this application;

[0052] Figure 6 A schematic diagram of a system for querying data provided by the present application;

[0053] Figure 7 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0054] See also Figure 1 As shown, an embodiment of the present application proposes a possible operator visualization interface scenario.

[0055] exist Figure 1 The operator visualization interface scene shown includes a first display area 110 , a second display area 120 and a third display area 130 .

[0056] The first display area 110 is used to obtain first information including original data and input information. Here, the input information may include: first field information and first data information, wherein the first field information includes: field description, field name, field type, and the first data information includes: input name, input code, input description, and code is a special symbol in the placeholder.

[0057] The second display area 120 is used to obtain the second information, which may include: second field information and second data information, wherein the second field information includes: output field description, output field name, and the second data information includes: output name, output code, output description, and code is a special symbol in the placeholder.

[0058] The third display area 130 is used to obtain third information, and the third information may include: first parameter information, second parameter information or third parameter information, wherein the first parameter information includes: filter field, field description, field type, comparison operator, comparison value, the second parameter information includes: variable name, variable code, variable description, variable type, display method, display unit, default value, code is a special symbol in the placeholder, and the third parameter information includes: field description, field type, comparison operator, comparison value.

[0059] Based on the visualization interface scenario of the above operator, the embodiment of the present application provides a method, system and electronic device for querying data, which solves the problem in the prior art that it is difficult to obtain target data by writing structured query language statements while taking into account different users.

[0060] The method provided in the embodiments of the present application is further described in detail below in conjunction with the accompanying drawings.

[0061] See also Figure 2 As shown, the embodiment of the present application provides a method for querying data, and the specific process is as follows:

[0062] Step 201: Determine whether the original information in the visualization interface meets the preset conditions;

[0063] In the visualization interface, it is determined whether the first information, the second information, and the third information in the original information meet the preset conditions.

[0064] Specifically, confirming that the first information meets the preset condition: determine whether the first field information in the first information is missing, and if the first field information is not missing, then confirming that the first information meets the preset condition. Further, determine whether the first data information in the first information is missing, and if neither the first field information nor the first data information is missing, then confirming that the first information meets the preset condition. In addition, it is also necessary to verify whether the original data in the first information exists.

[0065] Confirming that the second information meets the preset condition: determining whether the second field information in the second information is missing, and if the second field information is not missing, then confirming that the second information meets the preset condition. Further, determining whether the second data information in the second information is missing, and if neither the second field information nor the second data information is missing, then confirming that the second information meets the preset condition.

[0066] Confirm that the third information meets the preset condition: In one possible case, it is determined whether the comparison value in the first parameter information or the third parameter information matches the field type, for example: if the comparison value is "18" and the field type is "i nt", because "18" is of the "i nt" type, the comparison value matches the field type, and the third information meets the preset condition; if the comparison value is "Amy" and the field type is "i nt", because "Amy" is not of the "i nt" type, the comparison value does not match the field type, and the third information does not meet the preset condition. In another possible case, it is also possible to determine whether the default value in the second parameter information matches the variable type, for example: the default value is "Huayuan City First Street", the variable type is "string", because "Huayuan City First Street" is of the "string" type, the default value matches the variable type, and the third information meets the preset condition; if the default value is "Huayuan City First Street", the variable type is "float", because "Huayuan City First Street" is not of the "float" type, the default value does not match the variable type, and the third information does not meet the preset condition.

[0067] Through the above method, the original information of the operator is unified and standardized, and the input information used to implement SQL development is made transparent.

[0068] Step 202: When the original information meets the preset condition, the original information is combined with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement;

[0069] First, a parsing rule is preset, that is, the data in the first information, the second information and the third information in the original information are parsed into fragment statements of the structured query language respectively, and then the above fragment statements are inserted into the preset parsing template to obtain an executable structured query language statement.

[0070] Specifically, according to the preset parsing rules and based on the grammar of the structured query language, the data in the first information, the second information and the third information in the original information are respectively parsed into fragment statements of the structured query language, and then the above-mentioned fragment statements of the structured query language are inserted into the preset parsing template of the corresponding structured query language to generate executable structured query language statements.

[0071] In addition, the preset parsing template may be a pre-built-in structured query language template, and the structured query language generated by the preset parsing template can perform corresponding operations more efficiently. For example, a possible preset parsing template is shown in Example 1 below:

[0072] create table if not exist${output}(${field_clause})comment'${table_comment}'stored as parquet;

[0073] (Example 1)insert overwrite table${output}select${select_clause}from${input}t where${where_clause};

[0074] Among them, "create table if not exist${output}(${field_clause})comment'${table_comment}'stored as parquet" is a preset parsing template for structured query language statements for data creation, and "${output}", "${field_clause}", and "${table_comment}" correspond to the second information; "insert overwrite table${output}select${select_clause}from${input}t where${where_clause}" is a preset parsing template for structured query language statements for data insertion, "${select_clause}", "${input}" correspond to the first information, and "${where_clause}" corresponds to the third information.

[0075] For example, based on the above possible preset template, if the original information: the first information includes field descriptions of "id", "name" and "age", the second information includes output field descriptions of "name" and "age", and the screening condition in the third information is "age=18", then the above original information is first parsed according to the structured query language syntax, and then the executable structured query language statement is generated by the preset parsing template, as shown in Example 2 below:

[0076] create table if not exists result_1000100421('name' string comment' name', 'age' int comment' age') comment' 18-year-old youth' stored as parquet; (Example 2) insert overwrite table result_1000100421 select 'name' as 'name' from

[0077] 'age'as'age'from di_test__db.person t where age=18;

[0078] Among them, "create table if not exists result_1000100421 ('name' string comment 'Name', 'age' int comment 'Age') comment 'Youth with an age of 18' stored as parquet" means to create a data table named 'Youth with an age of 18', and the data table includes 'Name' and 'Age'; "insert overwrite table result_1000100421 select 'name' as 'name' from 'age' as 'age' from di_test__db.person t where age = 18" means to insert the content of the data that meets the age equal to 18 in the above data table: 'Name' and 'Age'.

[0079] Through the above method, inside the encapsulated operator, according to the obtained original information, based on the preset parsing rules and preset parsing templates, executable structured query language statements are generated. Users do not need to care about how to write executable structured query language statements, and through the corresponding preset parsing templates, various structured query language engines can be adapted, which has the advantages of easy expansion and high availability.

[0080] Step 203: Execute the structured query language statement to obtain the target data.

[0081] Perform the operation of executing the above-generated structured query language statement to obtain the target data. Here, the target data can be displayed in a result table. Moreover, the obtained target data can be used as the input for the downstream operator in model orchestration.

[0082] To better implement the above method, the embodiments of the present application also provide three different visualization interfaces for different users, which will be elaborated in detail below with reference to the accompanying drawings.

[0083] Through the above method, while taking into account different users, the process of obtaining target data using structured query language is made more efficient, accurate, and convenient.

[0084] See Figure 3 As shown, the embodiments of the present application provide a visualization interface for a simple operator, specifically for users who do not have SQL theory knowledge or basic knowledge of other development languages. In the visualization interface of the simple operator, users only need to perform simple operations such as selection, input, or addition and deletion to achieve efficient, accurate, and convenient SQL development.

[0085] In Figure 3In the visualization interface of the simple operator shown, the user can select a database and a data table under the database through the first display area 310, wherein the black inverted triangle symbol is a selection area provided for the user. Here, the database and the data table can be data from a third party or other data that meets the metadata standard. In addition, the database and the data table can be obtained in a network-based manner, for example, through a relational database management system storage engine.

[0086] exist Figure 3 In the visualization interface of the simple operator shown, the user can observe the first field information of the first information obtained in the first display area 310 through the second display area 320, such as "field description", "field name" and "field type". Then the user needs to fill in all the contents under the second field information according to the first field information. For example, there are three pieces of data in the second display area 320. The user needs to fill in the second field information corresponding to each piece of data according to the first field information, that is, fill in the "output field description" and "output field name". The filled-in second field information can be different from the corresponding first field information. Taking "name" and "name" as examples, the filled-in "output field description" and "output field name" can be consistent with "name" and "name", or they can be different. However, it is worth noting that the user should complete the contents under "output field description" and "output field name" to ensure that there are no vacancies.

[0087] exist Figure 3 In the visualization interface of the simple operator shown, the user can set different first parameter information in the third display area 330. For example, the user can select "Filter Field", "Field Description" and "Comparison Operator", and the user can fill in the information in the "Comparison Value". Here, "Filter Field" means to filter out the "Field Description" in the second display area 320, "Field Description" is the "Field Description" after being filtered out by "Filter Field", and "Field Type" can be automatically generated according to the "Field Description" selected by the user, or it can be filled in by the user himself. In addition, the "Comparison Operator" is automatically generated according to the "Field Type" for the user to choose. For example, if the field type is "int", the comparison operators available for the user to choose are ">", "<", "=", "≥" or "≤".

[0088] See also Figure 4 As shown, the embodiment of the present application provides a visual interface of a professional operator, which is specifically for users with SQL theoretical knowledge or basic knowledge of other development languages. In the visual interface of the professional operator, users can write scripting languages ​​according to the development languages ​​they master, combined with selection, input, or addition and deletion operations, to achieve more flexible and efficient complex SQL development.

[0089] exist Figure 4 In the visualization interface of the professional operator shown, the first area 411 of the first display area 410 is used for the user to select and write script statements to obtain the original data of the first information.

[0090] The user can select a script type such as SQL, Python (computer programming language), Java (computer programming language), etc. according to the black inverted triangle icon in the first area 411, and write a corresponding script statement to obtain the original data of the first information. For example, taking the script type of "SQL" as an example, the user can write "insert overwrite table${output}select col1,col2 from${input}where col3=${param}" to obtain the original data. It should be noted that "output", "input" or "param" in "${output}", "${input}" or "${param}" are special symbols of placeholders in script statements, that is, corresponding codes, which can be written by the user himself.

[0091] Furthermore, if the user only needs part of the original data obtained by the above method, he can continue to write other script statements to implement different operations, such as writing "insert overwrite table${output}select name,age,address from${input}where age=${param}" to filter the above original data and obtain the required original data of the first information. In other words, here the user selects different script types and writes corresponding script statements as needed to obtain the original data of the first information. In another possible case, the original data of the first information can also be obtained by passing it through the upstream operator.

[0092] exist Figure 4 In the visualization interface of the professional operator shown, the user can fill in the first data information in the first information according to his / her needs through the second area 412 in the first display area 410, for example, fill in "input name" as "input table", "input code" as "input", and "input description" as "personnel information table". It should be noted that the "input" in the "input code" here is the same as the "input" in the "${input}" filled in the script statement in the first area 411, that is, the declaration of the placeholder. At the same time, the user can also fill in the first field information in the first information through the "settings" under the "input field".

[0093] exist Figure 4In the visualization interface of the professional operator shown, the user can fill in the second data information of the second information through the second display area 420, for example, fill in "output name" as "output table", "output code" as "output", and "output description" as "minor information table". At the same time, the user can also fill in the first field information of the second information through "settings" under "output field".

[0094] exist Figure 4 In the visualization interface of the professional operator shown, the user can fill in the second parameter information of the third information through the third display area 430. For example, the user can fill in "variable name" as "age", "variable code" as "param", "variable description" as "less than 18", "display unit" as "years", and can select "variable type" as "int", "display mode" as "input box", and can also fill in or not fill in the "default value", but it should be noted that the corresponding content of the "default value" should match the selected "variable type".

[0095] In addition, the "param" corresponding to the "variable code" mentioned above should be the same as the "param" in the "${param}" filled in the script statement in the first display area 411, that is, the declaration of the placeholder. At the same time, the user can also add more second parameter information through the black plus sign.

[0096] See also Figure 5 As shown, the embodiment of the present application provides a visual interface of a system operator, which is specifically for users who do not have theoretical knowledge of SQL or basic knowledge of other development languages. The difference between a system operator and a simple operator is that a system operator depends on an upstream operator and uses the output data of the upstream operator as raw data. Therefore, when obtaining the raw data of the first information, the difference between a simple operator and a system operator requires user specification. In the visual interface of the system operator, users only need to perform simple operations such as selection, input, or addition and deletion to achieve efficient, accurate, and convenient SQL development.

[0097] exist Figure 5 In the visualization interface of the system operator shown, the user can observe the first field information in the first information through the first display area 510, for example, corresponding to "field description", "field name", "name", "string", etc. under "field type".

[0098] exist Figure 5In the visualization interface of the system operator shown, the user can observe the first field information in the first information through the second display area 520, and then the user needs to fill in all the contents under the second field information according to the first field information. For example, there are three pieces of data here, and the user needs to fill in the second field information corresponding to each piece of data according to the first field information, that is, to complete the contents under "output field description" and "output field name". The filled-in information can be different from the displayed information. Taking the first row of data as an example, the filled-in contents in "output field description" and "output field name" can be consistent with "name" and "name", or they can be different. However, it is worth noting that the user should complete the contents under "output field description" and "output field name" corresponding to each piece of data to ensure that there are no vacancies.

[0099] exist Figure 5 In the visual interface of the system operator shown, the user can select different "field descriptions" and "price symbols" in the third display area 530, and fill in the "comparison value", where the "field type" will be automatically generated according to the "field description" selected by the user. For example, if the user selects "age" as the "field description", "equal to" as the "comparison symbol", and fills in "18" as the "comparison value", the "field type" will be automatically generated as "int" according to the "age" in the "field description".

[0100] Through the above method, target data can be obtained efficiently, conveniently and flexibly for complex business scenarios and users with different development levels. Through the visual interface, the complexity of the underlying structured query language can be shielded, and users with multiple levels of development can be matched, reducing the technical threshold for obtaining target data, and providing a variety of operators to increase the scalability and reusability of operators. In addition, in the embodiment of the present application, the operator structures are independent of each other and have low coupling, which will effectively reduce the debugging cost during operator arrangement and support real-time viewing of the operation results of the operators.

[0101] Based on the same inventive concept, the present application also provides a data query system for effectively querying target data while taking into account different users, solving the problem that it is difficult to obtain target data by writing structured query language statements while taking into account different users, and effectively improving the efficiency, accuracy and convenience of querying target data, see Figure 6 The system comprises:

[0102] Determination module 601, determining whether the original information obtained in the visualization interface meets the preset conditions;

[0103] The parsing module 602 combines the original information with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement when the original information meets the preset condition;

[0104] The execution module 603 executes the structured query language statement to obtain target data.

[0105] In a possible design, the determination module 601 is also used to determine whether there is an information gap in the first information in the original information; determine whether there is an information gap in the second information in the original information; and determine whether the data in the third information in the original information matches the basic type of the data.

[0106] In a possible design, the parsing module 602 is further used to parse the first information, the second information and the third information in the input information into fragment statements of the structured query language according to the preset parsing rules and the grammar of the structured query language; insert the fragment statements of the structured query language into a preset parsing template of the corresponding structured query language to generate an executable structured query language statement.

[0107] Based on the above system, efficient, accurate and convenient query of target data is achieved, and different users are taken into account, thereby solving the problem that it is difficult to obtain target data by writing structured query language statements when taking different users into account.

[0108] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the functions of the aforementioned system for querying data, referring to Figure 7 , the electronic device comprises:

[0109] At least one processor 701, and a memory 702 connected to the at least one processor 701. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application. Figure 7 In the example, the processor 701 and the memory 702 are connected via a bus 700. Figure 7 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 700 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 7 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 701 can also be called a controller, and there is no limitation on the name.

[0110] In the embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701. The at least one processor 701 can execute the method for querying data discussed above by executing the instructions stored in the memory 702. The processor 701 can implement Figure 7 The functions of each module in the system are shown.

[0111] Among them, processor 701 is the control center of the system, which can use various interfaces and lines to connect various parts of the entire control device, and monitor the system as a whole by running or executing instructions stored in memory 702 and calling data stored in memory 702, various functions of the system and processing data.

[0112] In one possible design, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0113] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the query data method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0114] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other system that can realize a storage function, for storing program instructions and / or data.

[0115] By designing and programming the processor 701, the code corresponding to the data query method described in the above embodiment can be fixed into the chip, so that the chip can execute the query method when running. Figure 2 The steps of the data query method of the embodiment shown are as follows: How to design and program the processor 701 is a technology well known to those skilled in the art and will not be described in detail here.

[0116] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the data query method discussed above.

[0117] In some possible implementations, various aspects of the data query method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of the data query method according to various exemplary implementations of the present application described above in this specification.

[0118] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0119] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0120] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0122] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for querying data, characterized in that: The method comprises: Acquiring the first information in the original information through the first display area in the visualization interface specifically includes one of the following situations: Based on the first display area, obtaining original data selected by a user and obtaining the first information according to the original data; Based on the first display area, executing a script statement, and obtaining the first information according to the execution result of the script statement; Based on the first display area, by connecting to an upstream operator, and obtaining the first information according to an output result of the upstream operator; Acquiring second information in the original information through a second display area in the visualization interface; acquiring third information in the original information through a third display area in the visualization interface; and determining whether the original information acquired in the visualization interface satisfies a preset condition, including: Determining whether there is any information gap in the first information in the original information; Determining whether there is any information gap in the second information in the original information; determining whether data in the third information in the original information matches the basic type of the data; When the original information meets the preset condition, combining the original information with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement; Execute the structured query language statement to obtain target data.

2. The method according to claim 1, characterized in that The acquiring the third information through the third display area specifically includes one of the following situations: Based on the third display area, according to the content and condition input by the user for filtering the first information, obtaining the third information; Based on the third display area, the third information is obtained according to the content, condition and method input by the user for filtering the first information.

3. The method according to claim 1, characterized in that When the original information meets the preset condition, the original information is combined with the preset parsing template according to the preset parsing rule to obtain an executable structured query language statement, including: According to the preset parsing rules and the syntax of the structured query language, the first information, the second information and the third information in the input information are parsed into fragment statements of the structured query language respectively; The structured query language fragment statement is inserted into a preset parsing template corresponding to the structured query language to generate an executable structured query language statement.

4. A system for querying data, characterized in that: The system comprises: The determination module obtains the first information in the original information through the first display area in the visualization interface, specifically including one of the following situations: Based on the first display area, obtaining original data selected by a user and obtaining the first information according to the original data; Based on the first display area, executing a script statement, and obtaining the first information according to the execution result of the script statement; Based on the first display area, by connecting to an upstream operator, and obtaining the first information according to an output result of the upstream operator; Acquire the second information in the original information through the second display area in the visualization interface; acquire the third information in the original information through the third display area in the visualization interface; determine whether the original information acquired in the visualization interface meets the preset conditions, including: determining whether there is an information gap in the first information in the original information; determining whether there is an information gap in the second information in the original information; determining whether the data in the third information in the original information matches the basic type of the data; A parsing module, when the original information meets the preset condition, combines the original information with a preset parsing template according to a preset parsing rule to obtain an executable structured query language statement; The execution module executes the structured query language statement to obtain target data.

5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method steps of any one of claims 1 to 3 when executing a computer program stored in the memory.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Database data operation method and system and server

    CN112650766A