CN113032420A - Data query method and device and server - Google Patents

Data query method and device and server Download PDF

Info

Publication number
CN113032420A
CN113032420A CN202110442077.4A CN202110442077A CN113032420A CN 113032420 A CN113032420 A CN 113032420A CN 202110442077 A CN202110442077 A CN 202110442077A CN 113032420 A CN113032420 A CN 113032420A
Authority
CN
China
Prior art keywords
target
field
preset
pool
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110442077.4A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110442077.4A priority Critical patent/CN113032420A/en
Publication of CN113032420A publication Critical patent/CN113032420A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The specification provides a data query method, a data query device and a server. Based on the method relating to big data technology, firstly, determining the type of a target topic according to a query topic carried in a received query request; determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; moreover, a matched target source table is determined from a plurality of preset source tables; further, according to the target field pool and the target condition pool, a target field and a target data value related to the target field are obtained; automatically splicing and generating a corresponding target query statement according to the target subject type, the target field and the target data value; and then, the target query statement can be utilized to perform data query operation only aiming at the target source table in the preset source table, so that the user operation can be simplified, the target data meeting the specific requirements of the user can be efficiently queried and obtained, and the use experience of the user is improved.

Description

Data query method and device and server
Technical Field
The specification belongs to the technical field of big data, and particularly relates to a data query method, a data query device and a server.
Background
In some business data processing scenarios, a user (e.g., a business person, etc.) often needs to perform a query operation on a large number of source tables to obtain relevant data based on specific business processing requirements.
Based on the existing data query method, users are often required to write specific query statements by themselves so as to perform specific query operations; when a specific query operation is performed, the query statement is used to perform search and query operations on a large number of source tables, so that data to be queried can be found finally.
Therefore, when the existing data query method is implemented specifically, the technical problems of high operation difficulty of a user and low query efficiency often exist.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The specification provides a data query method, a data query device and a server, so that user operation is simplified, target data meeting specific requirements of a user are efficiently queried and obtained, and use experience of the user is improved.
The present specification provides a data query method, including:
receiving a query request; wherein, the query request at least carries a query subject;
according to the query theme, determining a matched target theme type from a plurality of preset theme types;
according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type;
acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool;
generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule;
and according to the target query statement, acquiring target data by querying the target source table.
In some embodiments, the preset field pool comprises: a preset type attribute field pool and/or a preset numerical value attribute field pool.
In some embodiments, the attribute field related to the target topic type includes: a category type attribute field associated with the target topic type, and/or a numeric type attribute field associated with the target topic type.
In some embodiments, obtaining a target field according to the target field pool and the target condition pool includes:
configuring a corresponding selection interface according to the target field pool and the target condition pool; the selection interface comprises a plurality of fields to be selected;
displaying the selection interface to a user;
receiving and determining a field to be selected by a user according to the selection operation of the user on the selection interface; and determining the field to be selected by the user as the target field.
In some embodiments, the target field pool and the target condition pool further store association relationships between fields respectively;
correspondingly, configuring a corresponding selection interface according to the target field pool and the target condition pool, including:
screening a first-level attribute field from the target field pool;
screening second-level attribute fields from the target field pool according to the association relationship among the fields, and screening associated fields to be selected from the target condition pool;
and configuring the selection interface by utilizing the first level attribute field, the second level attribute field and the relation field to be selected according to a preset configuration rule.
In some embodiments, obtaining a target field according to the target field pool and the target condition pool further includes:
displaying a text input interface to a user;
receiving text data which is input by a user and is related to data query through the text input interface;
performing word segmentation processing on the text data to obtain a custom text field;
and screening fields with the semantic similarity higher than a preset similarity threshold value with the custom text field from the target field pool and/or the target condition pool through semantic matching to serve as the target fields.
In some embodiments, obtaining a target data value associated with a target field includes:
generating a data value setting interface related to the target field according to the target field;
displaying the data value setting interface to a user;
and acquiring a target data value related to the target field through the data value setting interface.
In some embodiments, prior to receiving the query request, the method further comprises:
acquiring a historical query record; wherein the historical query record comprises a plurality of historical query statements;
dividing the plurality of historical query statements into a plurality of data groups; each data group in the plurality of data groups corresponds to a preset theme type;
and constructing a preset field pool and a preset condition pool corresponding to the preset theme type according to the historical query statement contained in the data group.
In some embodiments, constructing a preset field pool and a preset condition pool corresponding to a preset topic type according to a historical query statement included in a data set includes:
constructing a preset field pool and a preset condition pool corresponding to the current theme type according to the following modes:
determining a data group corresponding to the current theme type from the plurality of data groups as a current data group;
extracting a type attribute field, a numerical attribute field and a relation field from a historical query statement contained in a current data set;
counting the use frequency of each type attribute field, the use frequency of each numerical attribute field and the use frequency of each relation field;
screening a plurality of category type attribute fields with the use frequency meeting the requirement, and constructing a preset category type attribute field pool corresponding to the current theme type; screening out a plurality of numerical attribute fields with the use frequency meeting the requirements, and constructing a preset numerical attribute field pool corresponding to the current theme type; screening out a plurality of relation fields with the use frequency meeting the requirements, and constructing a preset condition pool corresponding to the current theme type.
In some embodiments, after dividing the plurality of historical query statements into a plurality of data groups, the method further comprises:
determining a preset source table which is historically inquired by the historical inquiry sentences in each data group according to the historical inquiry records;
and establishing a matching relation between a preset theme type and a preset source table according to the preset source table historically inquired by the historical inquiry sentences in each data group.
In some embodiments, the preset theme type includes at least one of: customer topic, account topic, contract topic, product topic.
In some embodiments, after obtaining target data by querying the target source table according to the target query statement, the method further comprises:
and displaying the target data to a user.
The present specification also provides a data query apparatus including:
the receiving module is used for receiving the query request; wherein, the query request at least carries a query subject;
the first determining module is used for determining a matched target topic type from a plurality of preset topic types according to the query topic;
the second determining module is used for determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type;
the first acquisition module is used for acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool;
the generating module is used for generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule;
and the second acquisition module is used for acquiring target data by inquiring the target source table according to the target inquiry statement.
The present specification also provides a server comprising a processor and a memory for storing processor-executable instructions, the instructions when executed by the processor implementing the steps of: receiving a query request; wherein, the query request at least carries a query subject; according to the query theme, determining a matched target theme type from a plurality of preset theme types; according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type; acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool; generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule; and according to the target query statement, acquiring target data by querying the target source table.
The present specification also provides a computer readable storage medium having stored thereon computer instructions which, when executed, perform the steps of: receiving a query request; wherein, the query request at least carries a query subject; according to the query theme, determining a matched target theme type from a plurality of preset theme types; according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type; acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool; generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule; and according to the target query statement, acquiring target data by querying the target source table.
Before specific implementation, the data query method, the data query device, and the server provided in this specification may first obtain and construct, according to a historical query record, a preset field pool and a preset condition pool that respectively correspond to a plurality of preset topic types, and establish a matching relationship between the preset topic types and a preset source table; in specific implementation, the matched target topic type can be determined according to the query topic carried in the received query request; determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; determining a target source table matched with the target theme type from a plurality of preset source tables; further, a target field and a target data value related to the target field can be obtained according to the target field pool and the target condition pool; automatically splicing and generating corresponding target query statements according to the target subject type, the target field and the target data value; and then, according to the target query statement, only the target source table in the preset source table is subjected to query operation to obtain target data to be queried. Therefore, the user operation can be effectively simplified, and the operation difficulty of the user is reduced; the user can efficiently and conveniently inquire and acquire the target data meeting the requirements of the user, and the use experience of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification, the drawings needed to be used in the embodiments will be briefly described below, and the drawings in the following description are only some of the embodiments described in the present specification, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a diagram illustrating an embodiment of a structural component of a system to which a data query method provided by an embodiment of the present specification is applied;
FIG. 2 is a flow diagram illustrating a data query method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a server according to an embodiment of the present disclosure;
fig. 4 is a schematic structural component diagram of a data query device provided in an embodiment of the present specification;
FIG. 5 is a diagram illustrating an embodiment of a data query method provided by an embodiment of the present specification;
FIG. 6 is a diagram illustrating an embodiment of a data query method provided by an embodiment of the present specification;
fig. 7 is a schematic diagram of an embodiment of a data query method provided by an embodiment of the present specification, in an example scenario.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Considering that based on the existing data query method, a user is often required to write a specific query statement, the requirement on the user is high, and the difficulty is high when the user operates; moreover, based on the existing data query method, all the source tables need to be retrieved and queried in sequence according to the query statement, so that the query process is relatively long in time consumption and relatively low in query efficiency. The above problem is more pronounced especially in cases where the amount of source table data involved is large.
For the root cause of the above problems, before the specific implementation is considered, the present specification may obtain in advance and configure corresponding preset field pools and preset condition pools for a plurality of different preset topic types according to historical query records; the preset condition pool stores a relation field related to the corresponding preset theme type. In specific implementation, the type of the target theme can be determined according to the query theme carried in the query request initiated by the user; determining a matched target field pool and a target condition pool from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; meanwhile, a matched target source table can be determined from a plurality of preset source tables according to the target theme type; further, the corresponding target field and the target data value related to the target field can be obtained according to the target field pool and the target condition pool; automatically generating a corresponding target query statement according to the target subject type, the target field and the target data value; and then, according to the target query statement, only the target source table in the preset source table is subjected to targeted data query, so that the user operation can be simplified, the user can conveniently and efficiently query the target data meeting the specific requirements, and the user experience is improved.
The embodiment of the specification provides a data query method, which can be particularly applied to a system comprising a server and a terminal device. In particular, reference may be made to fig. 1. The terminal equipment and the server can be connected in a wired or wireless mode to carry out specific data interaction.
In this embodiment, the server may specifically include a background server that is applied to a service data processing platform side and is capable of implementing functions such as data transmission and data processing. Specifically, the server may be, for example, an electronic device having data operation, storage function and network interaction function. Alternatively, the server may be a software program running in the electronic device and providing support for data processing, storage and network interaction. In the present embodiment, the number of servers is not particularly limited. The server may specifically be one server, or may also be several servers, or a server cluster formed by several servers.
In this embodiment, the terminal device may specifically include a front-end electronic device that is applied to a user side and can implement functions such as data acquisition and data transmission. Specifically, the terminal device may be, for example, a desktop computer, a tablet computer, a notebook computer, a smart phone, and the like. Alternatively, the terminal device may be a software application capable of running in the electronic device. For example, it may be some application running on a desktop computer, etc.
In this embodiment, the server further has a plurality of preset source tables.
Before specific implementation, the server can obtain historical query records; the historical query records comprise a plurality of historical query sentences.
Then, the server may divide the plurality of historical query statements into a plurality of data groups; wherein each data set corresponds to a preset theme type.
Further, the server may construct a preset field pool and a preset condition pool corresponding to each preset topic type according to the historical query statement included in each data group. The preset field pool stores attribute fields related to the corresponding preset theme type, and the preset condition pool stores relationship fields related to the corresponding preset theme type.
Meanwhile, the server can also determine a preset source table which is historically inquired by the historical inquiry sentences contained in each data group according to the historical inquiry records so as to establish a matching relation between the preset theme type and the preset source table.
In specific implementation, when a user wants to query a specific data in a specific source table, the user does not need to have complex professional programming knowledge and only needs to perform simple operation on terminal equipment to generate a query request at least carrying a query subject; and sends the query request to the server.
Correspondingly, the server receives the query request, responds to the query request, and determines a preset theme type matched with the query theme from a plurality of preset theme types as a target theme type.
Then, the server can determine a preset field pool and a preset condition pool which are matched with the target theme type from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type, and the preset field pools and the preset condition pools are used as a target field pool and a target condition pool; meanwhile, the preset source table matched with the target theme type can be determined from the plurality of preset source tables as the target source table according to the matching relationship between the preset theme type and the preset source table.
Further, the server may obtain the corresponding target field and the target data value related to the target field by performing corresponding interaction with the user according to the target field pool and the target condition pool.
Furthermore, the server can automatically generate the target query statement through splicing combination according to the target theme type, the target field and the target data value and based on a preset splicing rule.
Then, the server can perform query operation only for a target source table in a preset source table according to the target query statement to obtain corresponding target data; and feeds the inquired target data back to the terminal equipment.
Correspondingly, the terminal equipment receives the target data; and displaying the target data to a user.
Through the embodiment, the user operation can be effectively simplified, and the corresponding target query statement can be automatically generated; meanwhile, when specific query is carried out according to the target query statement, uniform query is not carried out on all source tables without distinguishing, and only the target source table matched with the target theme type is required to be subjected to targeted query, so that the data processing amount in the query process can be effectively reduced, the query time is shortened, the overall query efficiency is improved, and the target data meeting the requirements of the tool body can be efficiently and conveniently queried.
Referring to fig. 2, an embodiment of the present specification provides a data query method. The method is particularly applied to the server side. In particular implementations, the method may include the following.
S201: receiving a query request; wherein the query request carries at least a query subject.
In some embodiments, a user does not need to have professional programming knowledge, and can set a specific query theme by using a non-programming language such as a natural language and the like through simpler setting operation on terminal equipment and the like according to guidance and by combining specific query requirements of the user; and generating a corresponding query request by operating the indication terminal equipment. The query request may at least carry a query subject set by a user.
Further, the terminal device may send the query request to the server in a wired or wireless manner in response to a user operation. Correspondingly, the server receives the query request.
S202: and determining a matched target theme type from a plurality of preset theme types according to the query theme.
In some embodiments, the server may extract the query topic carried in the query request by performing data analysis on the query request. And determining a preset theme type similar to the query theme semantic based on a semantic layer from a plurality of preset theme types through semantic matching, wherein the preset theme type is used as a target theme type. The preset theme type can be obtained in advance according to a historical query record. The determination method of the preset theme type will be described later.
In some embodiments, the preset theme types may include a plurality of different theme types corresponding to different application scenarios. The following is a detailed description only taking a banking data processing scenario as an example.
In some embodiments, the preset theme type may specifically include at least one of the following: customer topic, account topic, contract topic, product topic, and the like. Of course, it should be noted that the above listed preset theme type is only an exemplary illustration. In specific implementation, according to specific situations and processing requirements, for a banking data processing scenario, the preset theme type may further include: employee topics, data statistics topics, risk prediction topics, and so forth. The present specification is not limited to these.
S203: according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type.
In some embodiments, the preset field pool and the preset condition pool correspond to a preset topic type respectively. Specifically, each preset field pool may store a plurality of attribute fields related to the corresponding preset topic type, and each preset condition pool may store a plurality of relationship fields related to the corresponding preset topic type. The preset field pool and the preset condition pool can be obtained in advance according to historical query records. The determination method of the preset field pool and the preset condition pool will be described in detail later.
Specifically, the relationship field may specifically include one or more of the following listed fields: and, or; greater than, equal to, less than, greater than or equal to, less than or equal to, and the like. Of course, the above listed relationship fields are only illustrative. In specific implementation, other types of relationship fields may also be included according to specific application scenarios and processing requirements. The present specification is not limited to these.
The preset source table may be obtained specifically according to service data held by the server or data in an accessed database. Wherein, each preset source table can be recorded with a large amount of data information. The preset source table may include a plurality of different types of data tables corresponding to different application scenarios.
Specifically, taking a banking data processing scenario as an example, the preset source table may include a basic information table of the customer, a tag information table of the customer, a benefit class information table of the customer, a held product information table of the customer, and the like. The basic information table of the customer may be recorded with data information such as sex, birthday, address, telephone number, etc. of each customer. The label information table of the customer can particularly record data information such as potential customer labels, private bank customer labels, large-amount consumption customer labels and the like of each customer. The benefit information table of the client can record data information such as comprehensive contribution degree of the client, product coverage degree of the client, comprehensive points of the client and the like. The product information table held by the customer may specifically store a product number of a fund product held by the customer, a transaction record of the fund product held by the customer, monthly balance data of the product held by the customer, and the like. Of course, the predetermined source table listed above is only an illustrative example. In specific implementation, the preset source table may further include other types of data tables with other contents according to specific situations and processing requirements. The present specification is not limited to these.
In some embodiments, in specific implementation, the server may retrieve a plurality of preset field pools and a plurality of preset condition pools, and find a preset field pool corresponding to the target topic type as a target field pool; and finding a preset condition pool corresponding to the target theme type in a matching mode to serve as a target condition pool.
The target field pool may store a plurality of attribute fields related to the target topic type, and the target condition pool may store a plurality of relationship fields related to the target topic type.
Meanwhile, the server can also retrieve a plurality of preset source tables based on the matching relationship between the preset theme type and the preset source tables, and find the preset source table corresponding to the target theme type to serve as the target source table. The target source table records data information that the user wants to query with a high probability.
Therefore, the subsequent server can only carry out targeted query operation on the target source table, and does not need to carry out query operation on all preset source tables in a unified way like the existing method, thereby effectively reducing the data processing amount related to the subsequent query process and shortening the query time.
In some embodiments, the preset field pool further may include: a preset type attribute field pool and/or a preset numerical value attribute field pool.
The preset category type attribute field pool may specifically store a category type attribute field described by using text type data. Such as the gender of the customer, the address of the customer, the occupation of the customer, etc.
The preset numeric attribute field pool may specifically store a numeric attribute field described by numeric data. Such as the customer's integrated points, the customer's financial balance, the customer's monthly profits, and the like.
Correspondingly, the attribute field related to the target topic type may specifically include: a category type attribute field associated with the target topic type, and/or a numeric type attribute field associated with the target topic type.
S204: and acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool.
In some embodiments, the target field may be specifically understood as a field for describing a specific query requirement of a user. Specifically, for example, the target field may be a field for describing data that needs to be queried, or may be a field for describing a specific query manner.
The above-mentioned target data values may be understood in particular as parameter values for defining the specific content of the target field. Specifically, for example, the target data value may be a specific number of data that needs to be queried and is indicated by the user, where the specific number is: no.01212, the query range set by the user can also be: [50, 55], and the like.
In some embodiments, in specific implementation, the server may perform certain interaction with the user according to the determined target field pool and the target condition pool, so as to determine and obtain a target field indicated by the user and a target data value related to the target field.
In some embodiments, the obtaining of the target field according to the target field pool and the target condition pool may include the following steps in specific implementation:
s1: configuring a corresponding selection interface according to the target field pool and the target condition pool; the selection interface comprises a plurality of fields to be selected;
s2: displaying the selection interface to a user;
s3: receiving and determining a field to be selected by a user according to the selection operation of the user on the selection interface; and determining the field to be selected by the user as the target field.
In this embodiment, in specific implementation, the server may first use the fields stored in the target field pool and the target condition pool as the fields to be selected, and configure the corresponding selection boundary.
And then the selection interface is displayed to the user through the terminal equipment. For example, a user may be presented with a drop-down box or the like that includes a plurality of candidate fields for selection by the user.
And further, the field to be selected by the user can be received and determined as the target field according to the selection operation of the user in the selection interface.
In some embodiments, for a more complex application scenario, the target field pool and the target condition pool may further store association relationships between fields respectively. The association relationship between the fields may be a hierarchical relationship between different fields, a type relationship between different fields, a causal relationship between different fields, or the like.
Correspondingly, configuring a corresponding selection interface according to the target field pool and the target condition pool may include, in specific implementation: screening a first-level attribute field from a target field pool; then according to the incidence relation among the fields, screening a second level attribute field from the target field pool, and screening a relevant relation field to be selected from the target condition pool; and then configuring the selection interface by utilizing the first level attribute field, the second level attribute field and the to-be-selected relation field according to a preset configuration rule.
Specifically, for example, the first-level attribute field may include: two fields of province and city under direct jurisdiction. Accordingly, the second hierarchy attribute field may include: "urban" and the like. The candidate relationship field may specifically be a field for describing a parallel relationship between the two first-level attribute fields during query: "and the like.
The selection interface generated and displayed for the user is more friendly to the user, and the logic of the displayed fields to be selected is clearer and easier to understand for the user. Therefore, the user can more efficiently and simply carry out corresponding operation in the selection interface to select the field to be selected as the target field.
In some embodiments, for more complex application scenarios, after the second-level attribute field is determined in the above manner, a third-level attribute field and a corresponding candidate relationship field may be further determined based on the second-level attribute field according to the association relationship between the fields. By analogy, a fourth-level attribute field, a corresponding candidate relationship field and the like can also be determined. And then according to the incidence relation among different fields, a plurality of different fields are combined to generate a selection interface which is more complex and more informative, but the user can still understand and process more easily.
In some embodiments, the obtaining of the target field according to the target field pool and the target condition pool may further include, in specific implementation, the following:
s1: displaying a text input interface to a user;
s2: receiving text data which is input by a user and is related to data query through the text input interface;
s3: performing word segmentation processing on the text data to obtain a custom text field;
s4: and screening fields with the semantic similarity higher than a preset similarity threshold value with the custom text field from the target field pool and/or the target condition pool through semantic matching to serve as the target fields.
In this embodiment, the field closest to the custom text field derived based on the user's text data can be automatically found as the target field from the fields stored in the target field pool and/or the target condition pool through semantic matching.
Through the embodiment, the user can be supported to describe the query requirement more freely in a self-defined text data mode according to specific conditions.
In some embodiments, the obtaining of the target data value related to the target field may include the following steps:
s1: generating a data value setting interface related to the target field according to the target field;
s2: displaying the data value setting interface to a user;
s3: and acquiring a target data value related to the target field through the data value setting interface.
In this embodiment, after determining the target field, the server may further detect whether the user is required to set a relevant target data value. When it is determined that the user is required to set the target data value related to the target field, a data value setting interface for guiding the user to set the related target data value can be generated according to the target field. And further, a specific data value set by a user can be received as a target data value through the data value setting interface.
For example, when the target field is determined to be "province", a data value setting interface "__ province" containing the following data may be configured and presented to the user through the terminal device. The user may enter the data value "Jiangsu" at "__" in the data value setting interface. Correspondingly, the server can acquire the data value through the data value setting interface as a target data value related to the target field 'province'.
In some embodiments, the server may further generate a data value setting interface including a plurality of data values to be selected, and display the interface to the user. In this way, the user can select a data value which meets the requirement from the displayed multiple data values to be selected. Accordingly, the server may determine the data value selected by the user in the data value setting interface as the target data value.
S205: and generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule.
In some embodiments, the preset splicing rule may be specifically understood as a template rule based on a programming language. Specifically, the template rule may be an SQL-based template rule. SQL (Structured Query Language) is understood to be a database Query and programming Language for accessing data and querying, updating and managing a relational database system.
In some embodiments, the target query statement may be specifically an SQL-based underlying query statement.
In some embodiments, in specific implementation, the server may splice and assemble the acquired target topic type, the target field, and the target data value based on the preset splicing rule to generate a bottom layer query statement meeting the query requirement of the user, and the bottom layer query statement is used as the target query statement. Thus, the user can obtain the bottom layer query statement meeting the specific query requirement without professional programming knowledge.
S206: and according to the target query statement, acquiring target data by querying the target source table.
In some embodiments, when data is specifically queried, the server may perform query operation only on a target source table in the plurality of preset source tables according to the target query statement, and does not need to perform query operation on all preset source tables, so that data required by the user can be efficiently queried and obtained as target data.
In some embodiments, after obtaining the target data by querying the target source table according to the target query statement, when the method is implemented, the method may further include: and displaying the target data to a user.
In this embodiment, specifically, the server may send the queried target data to a terminal device disposed in a user layer, and further may display the target data to the user through the terminal device.
Furthermore, the server can also receive feedback information of the user aiming at the displayed target data through the terminal equipment, and performs other associated queries according to the feedback information and the currently queried target data, so that more diversified query requirements of the user can be met.
In some embodiments, before the specific implementation, the server may further obtain and use the historical query record to determine in advance a plurality of preset topic types, a preset field pool and a preset condition pool corresponding to the plurality of preset topic types, and a matching relationship between the preset topic types and the preset source table.
In some embodiments, before receiving the query request, when the method is implemented, the following may be further included:
s1: acquiring a historical query record; wherein the historical query record comprises a plurality of historical query statements;
s2: dividing the plurality of historical query statements into a plurality of data groups; each data group in the plurality of data groups corresponds to a preset theme type;
s3: and constructing a preset field pool and a preset condition pool corresponding to the preset theme type according to the historical query statement contained in the data group.
In some embodiments, the server may obtain the historical query record by collecting a plurality of historical query statements occurring in history and obtaining data results based on a preset source table queried by the plurality of historical query statements.
In some embodiments, the server may obtain a plurality of clusters by clustering a plurality of historical query statements in the historical query records. Each cluster corresponds to one topic type, and the topic type corresponding to each cluster can be determined as a preset topic type. Meanwhile, the plurality of historical query statements contained in each cluster may be divided into one data group. Thus, a plurality of data sets respectively corresponding to a preset theme type can be obtained.
In some embodiments, the above-mentioned constructing a preset field pool and a preset condition pool corresponding to a preset topic type according to a historical query statement included in the data group may include the following contents in specific implementation: constructing a preset field pool and a preset condition pool corresponding to the current theme type according to the following modes: determining a data group corresponding to the current theme type from the plurality of data groups as a current data group; extracting a type attribute field, a numerical attribute field and a relation field from a historical query statement contained in a current data set; counting the use frequency of each type attribute field, the use frequency of each numerical attribute field and the use frequency of each relation field; screening a plurality of category type attribute fields with the use frequency meeting the requirement, and constructing a preset category type attribute field pool corresponding to the current theme type; screening out a plurality of numerical attribute fields with the use frequency meeting the requirements, and constructing a preset numerical attribute field pool corresponding to the current theme type; screening out a plurality of relation fields with the use frequency meeting the requirements, and constructing a preset condition pool corresponding to the current theme type.
The plurality of type attribute fields with satisfactory use frequency may be specifically a preset number (for example, 20) of type attribute fields with highest use frequency in the type attribute fields corresponding to the current topic type. Similarly, the plurality of numerical attribute fields with the usage frequency meeting the requirement may be a preset plurality of numerical attribute fields with the highest usage frequency in the numerical attribute fields corresponding to the current topic type. The relation fields with the usage frequency meeting the requirement may be preset number of relation fields with the highest usage frequency in relation fields corresponding to the current topic type.
Through the method, the preset field pool and the preset condition pool corresponding to each preset theme type can be respectively constructed.
In some embodiments, after dividing the plurality of historical query statements into a plurality of data groups, when the method is implemented, the method may further include: determining a preset source table which is historically inquired by the historical inquiry sentences in each data group according to the historical inquiry records; and establishing a matching relation between a preset theme type and a preset source table according to the preset source table historically inquired by the historical inquiry sentences in each data group. Thus, the preset source table (i.e., the preset source table matched with the preset topic type) related to each preset topic type and possibly involved in the query can be predetermined based on the historical query records. Therefore, when data is subsequently and specifically queried, query operation can be performed only on the part of the preset source tables which may be involved according to the type of the subject, and query operation is not required to be performed on all the preset source tables. Therefore, the data processing amount in the data query process can be effectively reduced, and the query time consumption is shortened.
In some embodiments, the server may also collect feedback information of the user for the presented target data through the terminal device. Further, the server may collect the feedback information acquired in a preset time period (e.g., one week) every other, and correspondingly adjust and update the determined preset topic type, the preset field pool and the preset condition pool corresponding to the preset topic type, and the matching relationship between the preset topic type and the preset source table according to the feedback information in the time period, so as to continuously improve the data query accuracy and the query efficiency.
As can be seen from the above, based on the data query method provided in the embodiments of the present specification, before specific implementation, a preset field pool and a preset condition pool respectively corresponding to a plurality of preset topic types may be obtained and constructed according to a historical query record, and a matching relationship between the preset topic types and a preset source table is established; in specific implementation, the matched target topic type can be determined according to the query topic carried in the received query request; determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; determining a target source table matched with the target theme type from a plurality of preset source tables; further, a target field and a target data value related to the target field can be obtained according to the target field pool and the target condition pool; automatically generating a corresponding target query statement according to the target subject type, the target field and the target data value; and then, according to the target query statement, performing data query only on a target source table in a preset source table to obtain target data to be queried. Therefore, the user operation can be effectively simplified, and the operation difficulty of the user is reduced; the user can efficiently and conveniently inquire and acquire the target data meeting the requirements, and the use experience of the user is improved.
Embodiments of the present specification further provide a server, including a processor and a memory for storing processor-executable instructions, where the processor, when implemented, may perform the following steps according to the instructions: receiving a query request; wherein, the query request at least carries a query subject; according to the query theme, determining a matched target theme type from a plurality of preset theme types; according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type; acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool; generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule; and according to the target query statement, acquiring target data by querying the target source table.
In order to more accurately complete the above instructions, referring to fig. 3, another specific server is provided in the embodiments of the present specification, wherein the server includes a network communication port 301, a processor 302, and a memory 303, and the above structures are connected by an internal cable, so that the structures may perform specific data interaction.
The network communication port 301 may be specifically configured to receive a query request; wherein the query request carries at least a query subject.
The processor 302 may be specifically configured to determine, according to the query topic, a matched target topic type from a plurality of preset topic types; according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type; acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool; generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule; and according to the target query statement, acquiring target data by querying the target source table.
The memory 303 may be specifically configured to store a corresponding instruction program.
In this embodiment, the network communication port 301 may be a virtual port that is bound to different communication protocols, so that different data can be sent or received. For example, the network communication port may be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for mail data communication. In addition, the network communication port can also be a communication interface or a communication chip of an entity. For example, it may be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it may also be a bluetooth chip.
In this embodiment, the processor 302 may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The description is not intended to be limiting.
In this embodiment, the memory 303 may include multiple layers, and in a digital system, the memory may be any memory as long as binary data can be stored; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as a RAM, a FIFO and the like; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card and the like.
An embodiment of the present specification further provides a computer storage medium based on the above data query method, where the computer storage medium stores computer program instructions, and when the computer program instructions are executed, the computer storage medium implements: receiving a query request; wherein, the query request at least carries a query subject; according to the query theme, determining a matched target theme type from a plurality of preset theme types; according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type; acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool; generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule; and according to the target query statement, acquiring target data by querying the target source table.
In this embodiment, the storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard Disk Drive (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects specifically realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and are not described herein again.
Referring to fig. 4, in terms of software, the embodiment of the present specification further provides a data query apparatus, which may specifically include the following structural modules:
the receiving module 401 may be specifically configured to receive a query request; wherein, the query request at least carries a query subject;
the first determining module 402 may be specifically configured to determine, according to the query topic, a matched target topic type from a plurality of preset topic types;
the second determining module 403 may be specifically configured to determine, according to the target topic type, a target field pool and a target condition pool that are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type;
a first obtaining module 404, configured to obtain a target field and a target data value related to the target field according to the target field pool and the target condition pool;
the generating module 405 may be specifically configured to generate a target query statement according to the target topic type, the target field, the target data value, and a preset splicing rule;
the second obtaining module 406 may be specifically configured to obtain the target data by querying the target source table according to the target query statement.
It should be noted that, the units, devices, modules, etc. illustrated in the above embodiments may be implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. It is to be understood that, in implementing the present specification, functions of each module may be implemented in one or more pieces of software and/or hardware, or a module that implements the same function may be implemented by a combination of a plurality of sub-modules or sub-units, or the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Therefore, the data query device provided based on the embodiment of the specification can simplify user operation, efficiently query and acquire target data meeting specific requirements of a user, and improve user experience.
In a specific scenario example, the data query method provided in this specification may be applied to implement data query based on configured fields and conditions. The specific implementation process can be carried out by referring to the following contents.
In the scenario example, the traditional data query method has flexibility under the influence of variable factors such as a data source table, a field, query conditions and the like, but has higher requirements on the skills of the user, and a certain threshold is caused for daily data query. Based on the method, by slightly reducing the query flexibility, a basket collocation scheme is formed by utilizing the field and condition subsets of the theme type (for example, a preset field pool and a preset condition pool which are matched with the target theme type), so that the user is endowed with the capability of carrying out limited free query in the query theme domain, the data query threshold is reduced, and the data use convenience is improved.
Before the implementation, the query topic (e.g., a preset topic type), the field pool, and the computation condition pool (e.g., a preset field pool and a preset condition pool) may be constructed as follows.
When the query topic is specifically constructed, in a certain specific application scenario (for example, a business data processing scenario of a bank), the database tables of the source are relatively definite, and the association relationship between the database tables can be grasped and determined by a skilled person. In this scenario example, the query topic may be preset (e.g., a preset topic type is determined); meanwhile, the association relation of the database table is configured logically (for example, a matching relation between a preset theme type and a preset source table is established), the relation between a business field and the database field is bound through business definition, a business-oriented data query theme is generated, and a unified underlying conversion engine supports a conversion structure of business logic and a data query SQL statement.
Further, some fields specific to the partial technology, such as MD5 verification code, record hash value, etc., can be avoided in the above query subject, and only fields with clear business meaning are opened for the user.
When the field pool and the computation condition pool are specifically constructed, part of the service fields from the relevant source table can be used as common query elements, for example, fields (for example, attribute fields) which are frequently used in a certain query subject area.
In the present scenario example, these above-mentioned common query elements may be sorted into a field pool from the perspective of the service user. The field pool may specifically store a text that can be understood by a service, such as an account number, a deposit balance, and the like. Further, dimensions (e.g., categorical attribute fields) may also be distinguished from metrics (e.g., numeric attribute fields) for fields in a field pool. In turn, a selectable condition pool (e.g., a preset category field pool) can be configured for the dimension field to support the user to flexibly filter dimension information, for example, an account property provides a drop-down selectable option, a date interval range is configured for the birth date, and an organization provides a mechanism tree visualization option. A computational condition pool (e.g., a preset numeric field pool) is configured for the metric field to support numeric comparison computations. Therefore, a simple, convenient, easy-to-use, flexible and changeable data query model can be provided for each theme for a user.
In this scenario example, when the configuration is specifically performed, personalized configuration of the query topic and the related data by the user may be supported according to service requirements of different scenarios.
Specifically, the user can use the source table (for example, a preset source table) in a personalized manner according to the service requirement, establish the field pool, and enrich the content of the field pool as required; and keeping the conditioning tank substantially stable. Common dimensions (e.g., themes) may include, among others: customers, accounts, contracts, products, employees, etc. Take data query of customer dimension as an example. The following field pool and calculation condition pool can be constructed by referring to the contents shown in table 1 and table 2.
TABLE 1 customer dimension scene field pool
Figure BDA0003035402550000181
TABLE 2 customer dimension scene condition pool
Figure BDA0003035402550000191
In specific implementation, a user can perform personalized configuration of query statements more conveniently and efficiently according to specific query requirements based on the query topic, the field pool and the calculation condition pool to obtain required data (marked as target data) by query.
In the example of the present scenario, based on the above structure, a user can be supported to select an index that needs to be used as a query condition from a field pool according to a business requirement under query topics of different scenarios; conditions are selected from the condition pool to automatically generate corresponding query statements. In particular, reference may be made to fig. 5 and 6.
First, the relationship between the conditions may be determined. "and", "or", etc. in the SQL statement are corresponded by selecting a field (e.g., a relationship field) of "or", "and", etc. in the combination type exposed by the condition area (e.g., the selection interface), and the selection is determined by clicking "add combination" in the interface.
Meanwhile, a corresponding field (as an attribute field) can be selected in the interface. Specifically, after selecting a field in the field area, a value may be entered in the condition area for the field, including the selected attribute, or the entered range of values (e.g., target data value), and the selection may be determined by clicking "add condition" in the interface.
In the scene example, the user can be supported to select the nodes in the expression area at any time for conditional supplementation. Wherein, the method also comprises the supplement of the incidence relation between the conditions of the high hierarchy and the low hierarchy. As can be seen in fig. 7.
In specific implementation, the user can select the fields needing to be displayed to the result from the field pool according to the needs. Accordingly, the underlying query engine flexibly generates query SQL statements (e.g., target query statements) according to the selection of the user field pool and the configuration of the condition pool. Therefore, performance optimization can be performed in the query engine, a business user does not need to be familiar with database operation skills, user operation is facilitated, and use experience of the user in data query is improved.
Through the scene example, a set of method for realizing data query through configuration fields and conditions can be formed. By constructing the field pool and the condition pool and assembling the query statement by using the fixed fields and the conditions in the field pool and the condition pool, the technical threshold of data query can be reduced, and a user can conveniently realize flexible and variable data query in a high-efficiency and boundary manner according to different application scenes.
Although the present specification provides method steps as described in the examples or flowcharts, additional or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an apparatus or client product in practice executes, it may execute sequentially or in parallel (e.g., in a parallel processor or multithreaded processing environment, or even in a distributed data processing environment) according to the embodiments or methods shown in the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. The terms first, second, etc. are used to denote names, but not any particular order.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus necessary general hardware platform. With this understanding, the technical solutions in the present specification may be essentially embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments in the present specification.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.

Claims (15)

1. A method for querying data, comprising:
receiving a query request; wherein, the query request at least carries a query subject;
according to the query theme, determining a matched target theme type from a plurality of preset theme types;
according to the target theme type, determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type;
acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool;
generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule;
and according to the target query statement, acquiring target data by querying the target source table.
2. The method of claim 1, wherein the preset field pool comprises: a preset type attribute field pool and/or a preset numerical value attribute field pool.
3. The method of claim 2, wherein the attribute field associated with the target topic type comprises: a category type attribute field associated with the target topic type, and/or a numeric type attribute field associated with the target topic type.
4. The method of claim 3, wherein obtaining the target field according to the target field pool and the target condition pool comprises:
configuring a corresponding selection interface according to the target field pool and the target condition pool; the selection interface comprises a plurality of fields to be selected;
displaying the selection interface to a user;
receiving and determining a field to be selected by a user according to the selection operation of the user on the selection interface; and determining the field to be selected by the user as the target field.
5. The method according to claim 4, wherein the target field pool and the target condition pool further store the association relationship between the fields respectively;
correspondingly, configuring a corresponding selection interface according to the target field pool and the target condition pool, including:
screening a first-level attribute field from the target field pool;
screening second-level attribute fields from the target field pool according to the association relationship among the fields, and screening associated fields to be selected from the target condition pool;
and configuring the selection interface by utilizing the first level attribute field, the second level attribute field and the relation field to be selected according to a preset configuration rule.
6. The method of claim 4, wherein obtaining a target field according to the target field pool and the target condition pool, further comprises:
displaying a text input interface to a user;
receiving text data which is input by a user and is related to data query through the text input interface;
performing word segmentation processing on the text data to obtain a custom text field;
and screening fields with the semantic similarity higher than a preset similarity threshold value with the custom text field from the target field pool and/or the target condition pool through semantic matching to serve as the target fields.
7. The method of claim 4, wherein obtaining the target data value associated with the target field comprises:
generating a data value setting interface related to the target field according to the target field;
displaying the data value setting interface to a user;
and acquiring a target data value related to the target field through the data value setting interface.
8. The method of claim 2, wherein prior to receiving the query request, the method further comprises:
acquiring a historical query record; wherein the historical query record comprises a plurality of historical query statements;
dividing the plurality of historical query statements into a plurality of data groups; each data group in the plurality of data groups corresponds to a preset theme type;
and constructing a preset field pool and a preset condition pool corresponding to the preset theme type according to the historical query statement contained in the data group.
9. The method of claim 8, wherein constructing a preset field pool and a preset condition pool corresponding to a preset topic type according to historical query statements contained in the data set comprises:
constructing a preset field pool and a preset condition pool corresponding to the current theme type according to the following modes:
determining a data group corresponding to the current theme type from the plurality of data groups as a current data group;
extracting a type attribute field, a numerical attribute field and a relation field from a historical query statement contained in a current data set;
counting the use frequency of each type attribute field, the use frequency of each numerical attribute field and the use frequency of each relation field;
screening a plurality of category type attribute fields with the use frequency meeting the requirement, and constructing a preset category type attribute field pool corresponding to the current theme type; screening out a plurality of numerical attribute fields with the use frequency meeting the requirements, and constructing a preset numerical attribute field pool corresponding to the current theme type; screening out a plurality of relation fields with the use frequency meeting the requirements, and constructing a preset condition pool corresponding to the current theme type.
10. The method of claim 8, wherein after dividing the plurality of historical query statements into a plurality of data groups, the method further comprises:
determining a preset source table which is historically inquired by the historical inquiry sentences in each data group according to the historical inquiry records;
and establishing a matching relation between a preset theme type and a preset source table according to the preset source table historically inquired by the historical inquiry sentences in each data group.
11. The method of claim 1, wherein the preset theme type comprises at least one of: customer topic, account topic, contract topic, product topic.
12. The method of claim 1, wherein after obtaining target data by querying the target source table according to the target query statement, the method further comprises:
and displaying the target data to a user.
13. A data query apparatus, comprising:
the receiving module is used for receiving the query request; wherein, the query request at least carries a query subject;
the first determining module is used for determining a matched target topic type from a plurality of preset topic types according to the query topic;
the second determining module is used for determining a target field pool and a target condition pool which are matched from a plurality of preset field pools and a plurality of preset condition pools according to the target theme type; determining a matched target source table from a plurality of preset source tables; the target field pool stores a plurality of attribute fields related to the target subject type, and the target condition pool stores a plurality of relation fields related to the target subject type;
the first acquisition module is used for acquiring a target field and a target data value related to the target field according to the target field pool and the target condition pool;
the generating module is used for generating a target query statement according to the target subject type, the target field, the target data value and a preset splicing rule;
and the second acquisition module is used for acquiring target data by inquiring the target source table according to the target inquiry statement.
14. A server comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 12.
15. A computer-readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any one of claims 1 to 12.
CN202110442077.4A 2021-04-23 2021-04-23 Data query method and device and server Pending CN113032420A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110442077.4A CN113032420A (en) 2021-04-23 2021-04-23 Data query method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110442077.4A CN113032420A (en) 2021-04-23 2021-04-23 Data query method and device and server

Publications (1)

Publication Number Publication Date
CN113032420A true CN113032420A (en) 2021-06-25

Family

ID=76457541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110442077.4A Pending CN113032420A (en) 2021-04-23 2021-04-23 Data query method and device and server

Country Status (1)

Country Link
CN (1) CN113032420A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468208A (en) * 2021-07-19 2021-10-01 网易(杭州)网络有限公司 Method and device for generating data query statement, server and storage medium
CN113535817A (en) * 2021-07-13 2021-10-22 浙江网商银行股份有限公司 Method and device for generating characteristic broad table and training business processing model
CN114706625A (en) * 2022-03-29 2022-07-05 智业软件股份有限公司 Method, device and storage medium for constructing patient information global query plug-in
CN117056343A (en) * 2023-10-11 2023-11-14 湖北华中电力科技开发有限责任公司 Multi-source data management method and system in power grid field and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535817A (en) * 2021-07-13 2021-10-22 浙江网商银行股份有限公司 Method and device for generating characteristic broad table and training business processing model
CN113535817B (en) * 2021-07-13 2024-05-14 浙江网商银行股份有限公司 Feature broad table generation and service processing model training method and device
CN113468208A (en) * 2021-07-19 2021-10-01 网易(杭州)网络有限公司 Method and device for generating data query statement, server and storage medium
CN114706625A (en) * 2022-03-29 2022-07-05 智业软件股份有限公司 Method, device and storage medium for constructing patient information global query plug-in
CN117056343A (en) * 2023-10-11 2023-11-14 湖北华中电力科技开发有限责任公司 Multi-source data management method and system in power grid field and electronic equipment
CN117056343B (en) * 2023-10-11 2024-01-23 湖北华中电力科技开发有限责任公司 Multi-source data management method and system in power grid field and electronic equipment

Similar Documents

Publication Publication Date Title
US11645321B2 (en) Calculating relationship strength using an activity-based distributed graph
CN113032420A (en) Data query method and device and server
US10504120B2 (en) Determining a temporary transaction limit
CN110795509B (en) Method and device for constructing index blood-margin relation graph of data warehouse and electronic equipment
CN110674228A (en) Data warehouse model construction and data query method, device and equipment
US11106719B2 (en) Heuristic dimension reduction in metadata modeling
US9129010B2 (en) System and method of partitioned lexicographic search
US7702609B2 (en) Adapting to inexact user input
US10956469B2 (en) System and method for metadata correlation using natural language processing
CN109255000B (en) Dimension management method and device for label data
CN113051362B (en) Data query method, device and server
CN111078776A (en) Data table standardization method, device, equipment and storage medium
CN113157947A (en) Knowledge graph construction method, tool, device and server
US11373101B2 (en) Document analyzer
CN110929134A (en) Investment and financing data management method and device, computer equipment and storage medium
CN110675238A (en) Client label configuration method, system, readable storage medium and electronic equipment
CN110807016A (en) Data warehouse construction method and device applied to financial business and electronic equipment
JP2022096632A (en) Computer-implemented method, computer system, and computer program (ranking datasets based on data attributes)
US11704345B2 (en) Inferring location attributes from data entries
CN117149804A (en) Data processing method, device, electronic equipment and storage medium
CN116955856A (en) Information display method, device, electronic equipment and storage medium
US11755633B2 (en) Entity search system
US11645283B2 (en) Predictive query processing
US11244007B2 (en) Automatic adaption of a search configuration
CN113761102A (en) Data processing method, device, server, system and storage medium

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