CN112131253A - Data query method, device, equipment and storage medium - Google Patents

Data query method, device, equipment and storage medium Download PDF

Info

Publication number
CN112131253A
CN112131253A CN201910553694.4A CN201910553694A CN112131253A CN 112131253 A CN112131253 A CN 112131253A CN 201910553694 A CN201910553694 A CN 201910553694A CN 112131253 A CN112131253 A CN 112131253A
Authority
CN
China
Prior art keywords
data
report
query
target
field
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
CN201910553694.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.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN201910553694.4A priority Critical patent/CN112131253A/en
Publication of CN112131253A publication Critical patent/CN112131253A/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/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • G06F16/2456Join operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data query method, a data query device, data query equipment and a storage medium. The method comprises the following steps: according to the query condition in the obtained query request, determining a target bottom report related to the fields to be matched, which are depended on by the screening and/or sorting operation, from the query reports to be connected; matching the target object meeting the query condition from the target bottom report according to the field to be matched, and obtaining target report data of the target object; and obtaining the associated data of the target object under other fields in the query report to be connected in an associated manner according to the target report data of the target object. The embodiment of the invention overcomes the technical problem of low data query efficiency caused by data query based on full information by adopting the technical means of dynamically adjusting the query processing sequence of the target bottom-layer report in the report to be queried, reduces the data query range, reduces the connection quantity of the data report, and further achieves the technical effects of improving the data query efficiency and saving memory resources.

Description

Data query method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data query method, a data query device, data query equipment and a storage medium.
Background
With the rapid development of the internet technology, a large number of data reports are generated in various systems for query and use all the time.
At present, in the process of connecting and querying multiple data tables, all data tables are generally connected first to obtain an intermediate table containing all summary information, so that query and associated data display are performed according to query conditions on the basis of the intermediate table with full information. For example, the Prefix join, Bloom filter join and Mysql join multi-data table connection query modes, and query operations such as sorting and screening are performed based on the total connection information.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: data query is carried out on the basis of all report connection, so that the connection quantity of data is increased, huge IO and memory resources are wasted, and the data query cardinality is increased for the sequencing and screening operation of subsequent data, thereby reducing the data query efficiency.
Disclosure of Invention
The embodiment of the invention provides a data query method, a data query device, data query equipment and a storage medium, which can improve the query efficiency of data.
In a first aspect, an embodiment of the present invention provides a data query method, including:
according to the query condition in the obtained query request, determining a target bottom report related to the fields to be matched, which are depended on by the screening and/or sorting operation, from the query reports to be connected;
matching the field to be matched from the target bottom report to obtain a target object meeting the query condition, and obtaining target report data of the target object;
and obtaining the associated data of the target object under other fields from the query report to be connected in an associated manner according to the target report data of the target object.
In a second aspect, an embodiment of the present invention provides a data query apparatus, including:
the target bottom-layer report determining module is used for determining a target bottom-layer report related to the fields to be matched, which are depended by the screening and/or sorting operation, from the query reports to be connected according to the query conditions in the obtained query request;
the target object query module is used for obtaining a target object meeting the query condition from the target bottom report by matching according to the field to be matched and obtaining target report data of the target object;
and the data association module is used for associating and obtaining the associated data of the target object under other fields from the query report to be connected according to the target report data of the target object.
In a third aspect, an embodiment of the present invention provides an apparatus, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the data query method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data query method according to any embodiment of the present invention.
The method and the device have the advantages that the fields to be matched used in the screening and/or sorting operation in the inquiry process are determined based on the inquiry condition in the inquiry request, the bottom report where the fields to be matched are located is determined as the target bottom report, the screening and/or sorting operation on the target bottom report is adjusted to be executed before the full connection of the inquiry reports to be connected, the target object and the target report data which accord with the inquiry condition are obtained firstly, and finally, the association of multiple data reports is carried out, and the associated data of the target object under other fields is obtained. Therefore, in the process of multi-data table connection query, the technical means of dynamically adjusting the query processing sequence of the target bottom-layer report in the report to be queried is adopted, the technical problem of low data query efficiency caused by data query based on full information is solved, the data used for screening or sorting are preferentially processed, the full reports are connected based on the preferentially processed result to obtain associated data, the data query range is narrowed, the data report connection amount is reduced, and the technical effects of improving the data query efficiency and saving memory resources are achieved.
Drawings
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention;
FIG. 2 is a prior art data query flow diagram;
FIG. 3 is a flow chart of a data query after dynamic adjustment according to an embodiment of the present invention;
fig. 4 is a flowchart of a data query method according to a second embodiment of the present invention;
fig. 5 is a diagram illustrating an exemplary data query process after dynamically adjusting field expansion according to a second embodiment of the present invention;
fig. 6 is another exemplary diagram of a data query process after dynamically adjusting field expansion according to a second embodiment of the present invention;
FIG. 7 is a diagram illustrating another example of a data query process after dynamically adjusting field expansion according to a second embodiment of the present invention;
fig. 8 is a flowchart of data query after dynamically adjusting field expansion according to a second embodiment of the present invention;
fig. 9 is a schematic structural diagram of a data query device according to a third embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and that no limitation of the invention is intended. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
Example one
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention, where the present embodiment is applicable to a data query based on a large data report, and the method may be executed by a data query apparatus, and the apparatus may be implemented in software and/or hardware. The method specifically comprises the following steps:
and step 110, determining a target bottom-layer report form related to the fields to be matched and depended on by the screening and/or sorting operation from the query reports to be connected according to the query conditions in the obtained query request.
In the embodiment of the present invention, the connection query is mainly a query mode for the relational database, and includes an internal connection, an external connection, a cross connection, a left connection, a right connection, and the like. Multiple table queries can be implemented by join operators. In a relational database management system, the relationships between data need not be determined at the time of table creation, and all information for an entity is often stored in a table. When retrieving data, information of different entities stored in a plurality of tables is queried through a join operation.
Correspondingly, the inquiry report to be connected is all data reports for connection inquiry in the bottom layer. The to-be-connected query report may originate from different data sources, such as generated by different underlying systems. The report forms can comprise one or more data description entities, the entities can be described by data values under different fields, different report forms can be associated with description data of the same entity under different fields, and different report forms can have a hierarchical relationship. For example, in the student reports, table 1 is a grade report of a school, table 2 is a class report, table 3 is a student report and may include fields of student ID, name, gender, age, and the like, and table 4 is a student report and may include fields of student ID and subject scores and the like.
In this embodiment, the query request includes a query condition, and the query condition may be defined from each field dimension of all the query reports to be connected. It is understood that, in the data query process, based on the query condition, the query process may include at least one of data screening and data sorting, and accordingly, the data sorting operation is further associated with an entity data operation of a limited rank in the query condition. For example, entity data meeting the query condition is screened out through data filtering, or entity data with the highest rank is obtained through data sorting, and the like.
Correspondingly, the query process is based on at least one field dimension to perform matching query, so that the fields which are used for screening and/or sorting operation in the query condition are the fields to be matched. The field to be matched can be a certain field in the query report to be connected, and can also be obtained by splicing or calculating a plurality of fields in the query report to be connected, which are positioned in the same report or different reports. In this embodiment, in order to reduce the data query basis and the data connection amount, the report where the field to be matched or the field constituting the field to be matched is located is determined as a target bottom-layer report, so as to perform data query within a small range of data of the target bottom-layer report, and further connect and associate other data based on the query result. For example, in the report of the student, if the male student information is queried, the field to be matched is the gender, and the report in which the gender field is located is determined as the target bottom-layer report.
Specifically, in this embodiment, after the query request is obtained, all the reports to be queried are not immediately connected to generate the intermediate report, but the target bottom report associated with the field to be matched, on which the screening and/or sorting operation depends, is first determined from all the reports to be connected according to the query condition in the query request, so that a basis is provided for small-range and accurate data query.
And step 120, matching the field to be matched from the target underlying report to obtain a target object meeting the query condition, and obtaining target report data of the target object.
In the connection query process of this embodiment, query operations such as screening and/or sorting do not need to be performed based on the total information after all the to-be-connected query reports are connected, but after the target bottom-layer report is determined, the screening and/or sorting operations on the target bottom-layer report, which are depended on when the to-be-matched fields are matched, are adjusted to be performed before the total connection of the to-be-connected query reports. Namely, the specific processing process in the query process is dynamically adjusted according to the query conditions, so that the operation capable of minimizing the data processing range is dynamically adjusted to be executed in the early stage, and the data query efficiency is improved.
In this embodiment, the target object may be a data value under a field to be matched obtained by querying the target underlying report, or an entity associated with the data value. When the screening and/or sorting operation of the target bottom report depended on when the fields to be matched are matched is dynamically adjusted to the early stage, the query condition can be matched with the data value under the fields to be matched in the target bottom report, the successfully matched data value or the entity associated with the data value is determined as the target object, and the data of the target object under each field in the target bottom report is determined as the target report data of the target object.
For example, assuming that male student information is queried in a student report, and the report where a gender field is located is a target bottom-layer report, before all reports to be connected and queried are processed, the gender field is first used as a field to be matched, screening is performed in the target bottom-layer report, a data value under the gender field is a male, and/or an entity associated with the data value is determined as a target object, and data under all fields of the male student in the target bottom-layer report are all used as target report data of the target object.
And step 130, obtaining the associated data of the target object under other fields in the query report to be connected in an associated manner according to the target report data of the target object.
In the embodiment of the invention, the target report data of the target object is the data of the target object in the target underlying report. In the data query scene of the connection query, the associated data of the target object in all the query reports to be connected need to be displayed. It can be understood that the query condition is only one or more fields in the query report to be connected as the query condition, the query aims to obtain the complete data information of the queried entity, and the data in other fields may be the valid data information to be obtained by the query. Therefore, in the embodiment, after the target object is obtained through the data screening and/or sorting processing based on the small range, the target report data of the target object is connected with at least one other report except the target bottom-layer report in the query report to be connected in the form of a report, so as to obtain the associated data of the target object under other fields from the connected intermediate report. And finally, displaying the target report data of the target object and the associated data of the target object under other fields as connection query result data.
For example, in the connection query process, multiple data table connection operations join, filtering, order by, and limit of the first few operations associated with the order operation are usually involved. Suppose that the query report to be connected includes 4 reports, table 1 includes a student ID field and a student name field, table 2 includes a student ID field and a gender field, table 3 includes a student ID field and an age field, and table 4 includes a student ID field and a parent information field. Suppose that the query condition is to query male student information. The data query process in the prior art is as shown in fig. 2, i.e., join is performed on tables 1 to 4 to obtain an intermediate report containing the full amount of information, and then filter operation is performed according to query conditions based on the full amount of information in the intermediate report to screen out male students from the full amount of information. That is to say, in the prior art, data query needs to be performed from all report information, so that not only is the connection of the report occupied by a large amount of IO and memory, but also the data base number is large during subsequent screening.
In the above example, the data query flow after dynamic adjustment in this embodiment is as shown in fig. 3, that is, first, it is determined that table 2 is a target underlying report, filter operation is performed in table 2 according to the query condition, data of male students in table 2 is obtained, data screening is completed, and a target object report is generated. And finally, performing join on the screened target object report and other tables 1, 3 and 4 to obtain other information of the male students through association. That is to say, in this embodiment, by dynamically adjusting the processing procedures such as join, filter, order by, and limit in the data query, the operations that relate to the data query and can reduce the data processing amount or narrow the data processing range are dynamically adjusted to the previous processing, so that not only the resource occupation of IO and memory during the later data connection is reduced, but also the data base number during the previous screening is greatly reduced.
The technical scheme of the embodiment has the advantages that the fields to be matched used in the screening and/or sorting operation in the inquiry process are determined based on the inquiry condition in the inquiry request, the bottom report where the fields to be matched are located is determined as the target bottom report, the screening and/or sorting operation on the target bottom report is adjusted to be executed before the full connection of the inquiry reports to be connected, the target object and the target report data which accord with the inquiry condition are obtained firstly, and finally, the association of multiple data reports is carried out, so that the associated data of the target object under other fields are obtained. Therefore, in the process of multi-data table connection query, the technical means of dynamically adjusting the query processing sequence of the target bottom-layer report in the report to be queried is adopted, the technical problem of low data query efficiency caused by data query based on full information is solved, the data used for screening or sorting are preferentially processed, the full reports are connected based on the preferentially processed result to obtain associated data, the data query range is narrowed, the data report connection amount is reduced, and the technical effects of improving the data query efficiency and saving memory resources are achieved.
Example two
On the basis of the first embodiment, the present embodiment provides a preferred implementation of the data query method, which can dynamically adjust the calculation process of the real-time extension data. Fig. 4 is a flowchart of a data query method according to a second embodiment of the present invention, as shown in fig. 4, the method includes the following specific steps:
and step 410, determining a target bottom-layer report form related to the fields to be matched and depended on by the screening and/or sorting operation from the query reports to be connected according to the query conditions in the obtained query request.
And step 420, if the field to be matched is determined to be an extended field obtained by real-time calculation based on the field in the target bottom-layer report according to the query condition, performing extended calculation according to the field in the target bottom-layer report on which the extended field associated with the query condition depends to obtain the field to be matched.
In the specific embodiment of the present invention, the extension field refers to a field that does not exist in the query report to be connected, and can be obtained by processing such as splicing or calculation of other fields. The reports generated in the underlying system may be different as time changes, and thus the extended fields need to be processed in real time during data query. Correspondingly, when the expanded fields are determined to be required to be processed, the generation operation of the expanded fields, which is depended on by the query condition query, is adjusted to be executed before the screening and sorting operation of the target underlying report. The generating and processing process of the expansion field in the query process is dynamically adjusted according to the query conditions for use in screening and sorting operations, so that the operations capable of minimizing the data processing range are dynamically adjusted to be executed in the early stage, and the data query efficiency is improved.
The fields on which the extended field generation depends may be different fields in the same report or different fields in different reports. The generation operation of the extension field may include splicing or calculating the field, and the processing modes of the target underlying report are also different for different generation modes and the report on which the field depended by the extension field generation is located.
Specifically, if the fields depended on by the generation of the extension fields are located in the same report, the extension columns can be directly generated in the report, and the data values obtained by splicing or calculation based on different fields are added to the extension columns. For example, table 1 includes a click number field and a presentation number field, and if the query condition is a click rate, the data query process is as shown in fig. 5, and first, an extended column may be generated in table 1, and a ratio between the click number and the presentation number is used as a corresponding data value of the extended field. For another example, if the query condition is 20 years old male, an extended column may be generated in table 1, and the age field and the gender field are concatenated to form a new attribute as a corresponding extended field data value. Illustratively, based on the two examples described above, the data query flow including field extension is shown in fig. 5. In fig. 5, firstly, it is determined that table 1 is a target bottom-layer report, and field expansion is performed on table 1 according to query conditions; secondly, on the basis of generating the extension field in real time, screening or sorting data of the table 1 containing the extension field according to the query condition and the extension field; and finally, generating a target object report form by the screened data, and performing join with other tables 2 and N to obtain other field information in a correlated manner.
If the fields depended on by the extended field generation are located in different reports and the extended fields need to be generated by splicing, connecting the different reports where the fields depended on by the extended field generation, generating extended columns in the connected reports, and splicing the fields corresponding to the extended field generation. For example, if table 1 includes an age field, table 2 includes a gender field, and the query condition is 20 years old male, the data query process is as shown in fig. 6, that is, firstly, table 1 and table 2 are determined to be target underlying reports, secondly, table 1 and table 2 are connected, an extended column is generated in the connected reports, the age field and the gender field are spliced to form a new attribute as a corresponding extended field data value, then, on the basis of generating the extended field in real time, a middle report which includes the extended field and is connected between table 1 and table 2 is subjected to data screening or sorting according to the query condition and the extended field, and finally, the screened data is generated into a target object report and is subjected to join with other tables 3 and N to obtain other field information through association. For another example, in the Redis database, a combination of multidimensional features is usually used as a primary Key value Key, and when data is queried, a Key needs to be first generated by calculation based on a query report to be connected, a target underlying report is connected based on the Key, and a Key column is used as an extension column to generate an extension field for data query of the Key.
In addition, if the fields depended on by the extended field generation are located in different reports and the extended fields need to be generated by calculation, the data values of the fields corresponding to the same entity can be directly obtained, and the data values under the extended fields can be directly generated by calculation. For example, table 1 includes a click number field, table 2 includes a display number field, the query condition is a click rate, the data query process is as shown in fig. 7, that is, firstly, table 1 and table 2 are determined as target underlying reports, secondly, an extended column is generated in any report or a new report of table 1 or table 2, the ratio between the click number and the display number is used as a corresponding extended field data value, then, on the basis of generating an extended field in real time, table 1 or table 2 including the extended field is connected with another target underlying report, or a new report including the extended field is connected with table 1 and table 2, on the basis of an intermediate report including the extended field after the target underlying report is connected, data is screened or sorted according to the query condition and the extended field, and finally, the screened data is generated into a target object report and is joined with other tables 3 and table N, to correlate to obtain other field information.
Illustratively, fig. 8 is a flow chart of a data query after dynamically adjusting field expansion. As shown in fig. 8, in view of the difference of specific query conditions and the difference of fields contained in the report, the extension process of extending the fields may occur at various stages in the data query process, such as before the screening of the target underlying report, before the connection of the target underlying report, after the connection of the target underlying report, or after the screening or sorting of the target underlying report. The expansion process is split, the expansion processes depending on the screening and/or sorting are adjusted to be before the screening and/or sorting, and the rest of the expansion processes are processed after the screening and/or sorting.
Optionally, generating a data value under a required field according to the query condition and the field to be matched, and determining a data value with an association relationship under the required field according to the association relationship among the data values in the target underlying report; and generating an extended data value associated with the data value under the extended field according to the data value with the association relation under the required field.
In this embodiment, the field required for generating the field to be matched may be determined according to the query condition; in addition, data values of the same entity under different fields have an association relationship, and the data values jointly describe the description information of the entity under different fields. And then, data values with incidence relations under fields required by field generation to be matched can be determined, and the expanded data values associated with the data values are generated under the expanded fields through splicing or calculation of the determined data values.
Illustratively, assume that table 1 includes a student ID field, a student name field, and a gender field, and assume that the name of the query is male information of a. It can be determined that the field to be matched is a combination of name and gender according to the query condition, but such a field does not exist in table 1. An extension field is thus generated in table 1, i.e. the name field is concatenated with the gender field. Correspondingly, the data values of the entities in the name field and the gender field in table 1 are spliced to generate the data value of the entity in the extension field.
Optionally, before determining the data value having the association relationship under the required field, the method further includes: and if the expanded fields are determined to be the splicing of the fields in the at least two target bottom-layer reports according to the query conditions, connecting the at least two target bottom-layer reports.
If the extension field is a data value obtained by real-time calculation, for example, the click rate is calculated according to the click number and the display number, no matter whether the click number field and the display number field are in the same report, the associated click number data value and the display number data value can be directly extracted for calculation, and a specific data value under the extension field, i.e., the click rate field, is obtained. In addition, if the extended field is a character string obtained by real-time splicing, it needs to first determine whether the fields to be spliced are in the same report. If the fields to be spliced are in the same report, generating extension fields in the report directly and splicing the character strings; if the fields to be spliced are not in the same report, the report where the fields to be spliced are located needs to be connected first, and then the fields are spliced according to the connected report to obtain the extended fields.
Step 430, matching the query condition with the data value under the field to be matched in the target bottom report, and determining the successfully matched data value as a target object; and determining the data of the target object under each field in the target underlying report as the target report data of the target object.
In the specific embodiment of the invention, the query operations such as screening and/or sorting and the like do not need to be carried out based on the total information after all the to-be-connected query reports are connected, but the screening and/or sorting operations of the target bottom report, which are depended when the to-be-matched fields are matched, are adjusted to be executed before the total connection of the to-be-connected query reports after the target bottom report is determined. Namely, the specific processing process in the query process is dynamically adjusted according to the query conditions, so that the operation capable of minimizing the data processing range is dynamically adjusted to be executed in the early stage, and the data query efficiency is improved.
Step 440, connecting the target object report formed by the target report data of the target object with at least one other report except the target bottom report in the query report to be connected; and determining the associated data of the target object under other fields from the connected intermediate report.
In the embodiment of the invention, the target report data of the target object is the data of the target object in the target underlying report. In the data query scene of the connection query, the associated data of the target object in all the query reports to be connected need to be displayed. It can be understood that the query condition is only one or more fields in the query report to be connected as the query condition, the query aims to obtain the complete data information of the queried entity, and the data in other fields may be the valid data information to be obtained by the query. Therefore, after the target object is obtained through the data screening and/or sorting processing based on the small range, the target report data of the target object can be connected with at least one other report except the target bottom report in the query report to be connected in the form of a report, that is, the target object report is formed, so as to obtain the associated data of the target object under other fields from the connected intermediate report.
In this embodiment, the report connection mode is not limited, and any connection mode capable of retaining the target object may be applied to this embodiment. For example, it is preferable to adopt a left connection mode, that is, taking the target object report as a left table, taking the other reports as a right table, and generating a complete set of the left table, where a matching table in the right table has a value, and an unmatched table in the right table is replaced by a NULL value.
And step 450, displaying the target report data of the target object and the associated data of the target object in other fields as connection query result data.
In an embodiment of the present invention, the data is divided into two parts, namely, the data part on which the screening or sorting depends and the data part on which the sorting depends, by dynamically adjusting the operations of connection, screening, sorting, and the like. Correspondingly, after the data is queried, the query result is also divided into two parts, namely the query result of the data which is depended on by screening or sorting and the query result obtained by correlating the independent data parts. And finally, displaying the two parts of query results together as a connection query result.
The technical scheme of the embodiment has the advantages that the fields to be matched used for screening and/or sorting operation in the inquiry process are determined based on the inquiry conditions in the inquiry request, if the fields to be matched are the extended fields generated in real time, the generation operation sequence of the extended fields is dynamically adjusted, firstly, the generation operation of the extended fields is executed, secondly, the screening and/or sorting operation of the target bottom-layer report is executed, and finally, the association of multiple data reports is carried out, and the associated data is obtained and displayed. Therefore, in the process of multi-data table connection query, the technical means of dynamically adjusting the query processing sequence of the target bottom-layer report in the report to be queried is adopted, the technical problem of low data query efficiency caused by data query based on full information is solved, the data used for screening or sorting are preferentially processed, the full reports are connected based on the preferentially processed result to obtain associated data, the data query range is narrowed, the data report connection amount is reduced, and the technical effects of improving the data query efficiency and saving memory resources are achieved.
EXAMPLE III
Fig. 9 is a schematic structural diagram of a data query device according to a third embodiment of the present invention, where this embodiment is applicable to a situation where data query is performed based on a large data report, and the device may implement the data query method according to any embodiment of the present invention. The device specifically includes:
a target bottom-layer report determining module 910, configured to determine, from the query reports to be connected, a target bottom-layer report associated with the to-be-matched field on which the screening and/or sorting operation depends, according to the query condition in the obtained query request;
a target object query module 920, configured to obtain a target object meeting the query condition from the target underlying report according to the field to be matched, and obtain target report data of the target object;
and a data association module 930, configured to associate and obtain associated data of the target object in other fields from the query report to be connected according to the target report data of the target object.
Optionally, the target underlying report determining module 910 is specifically configured to:
matching the query condition with a data value under a field to be matched in the target bottom report, and determining the successfully matched data value as a target object;
and determining the data of the target object under each field in the target underlying report as the target report data of the target object.
Further, the apparatus further includes an extended field processing module 940; the extended field processing module 940 is specifically configured to:
before the target object meeting the query condition is obtained from the target underlying report by matching according to the field to be matched, and the target report data of the target object is obtained, the method further comprises the following steps: and if the field to be matched is determined to be an extended field obtained by real-time calculation based on the field in the target bottom report according to the query condition, performing extended calculation according to the field in the target bottom report on which the extended field associated with the query condition depends to obtain the field to be matched.
Optionally, the extended field processing module 940 is specifically configured to:
generating a data value under a required field according to the query condition and the field to be matched and determining a data value with an association relation under the required field according to the association relation among the data values in the target bottom report;
and generating an extended data value associated with the data value under the extended field according to the data value with the association relation under the required field.
The extended field processing module 940 is specifically configured to:
and before determining the data value with the incidence relation under the required field, if the expanded field is determined to be the splicing of the fields in at least two target bottom-layer reports according to the query condition, connecting the at least two target bottom-layer reports.
Optionally, the data association module 930 is specifically configured to:
connecting a target object report formed by the target report data of the target object with at least one other report except the target bottom report in the query report to be connected;
and determining the associated data of the target object under other fields from the connected intermediate report.
Further, the apparatus further comprises a query data presentation module 950; the query data presentation module 950 is specifically configured to:
after the associated data of the target object under other fields are obtained from the query report to be connected in an associated manner according to the target report data of the target object, the method further includes: and displaying the target report data of the target object and the associated data of the target object under other fields as connection query result data.
According to the technical scheme of the embodiment, through the mutual cooperation of the functional modules, the functions of dynamic adjustment of connection query, determination of the field to be matched, calculation of the extension field, determination of the target underlying report, matching of the target object, association and display of data and the like are realized. Therefore, in the process of multi-data table connection query, the technical means of dynamically adjusting the query processing sequence of the target bottom-layer report in the report to be queried is adopted, the technical problem of low data query efficiency caused by data query based on full information is solved, the data used for screening or sorting are preferentially processed, the full reports are connected based on the preferentially processed result to obtain associated data, the data query range is narrowed, the data report connection amount is reduced, and the technical effects of improving the data query efficiency and saving memory resources are achieved.
Example four
Fig. 10 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. As shown in fig. 10, the apparatus specifically includes: one or more processors 1010, one processor 1010 being illustrated in FIG. 10; a memory 1020 for storing one or more programs that, when executed by the one or more processors 1010, cause the one or more processors 1010 to implement the data query method of any embodiment of the present invention. The processor 1010 and the memory 1020 may be connected by a bus or other means, such as the bus connection shown in fig. 10.
Memory 1020, which may be a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions corresponding to data query methods in embodiments of the present invention (e.g., dynamic adjustment of real-time extended field computations and dynamic adjustment of screening and/or ranking). The processor 1010 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the memory 1020, that is, implements the data query method described above.
The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 1020 may further include memory located remotely from the processor 1010, which may be connected to devices over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as computer-executable instructions) is stored, where the computer program is used for executing a data query method when executed by a processor, and the method includes:
according to the query condition in the obtained query request, determining a target bottom report related to the fields to be matched, which are depended on by the screening and/or sorting operation, from the query reports to be connected;
matching the field to be matched from the target bottom report to obtain a target object meeting the query condition, and obtaining target report data of the target object;
and obtaining the associated data of the target object under other fields from the query report to be connected in an associated manner according to the target report data of the target object.
Of course, the computer-readable storage medium provided by the embodiments of the present invention has computer-executable instructions that are not limited to the method operations described above, and may also perform related operations in the data query method provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the embodiments of the present invention can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better implementation in many cases. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device) execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for querying data, comprising:
according to the query condition in the obtained query request, determining a target bottom report related to the fields to be matched, which are depended on by the screening and/or sorting operation, from the query reports to be connected;
matching the field to be matched from the target bottom report to obtain a target object meeting the query condition, and obtaining target report data of the target object;
and obtaining the associated data of the target object under other fields from the query report to be connected in an associated manner according to the target report data of the target object.
2. The method according to claim 1, wherein the obtaining of the target report data of the target object by matching the target object meeting the query condition from the target underlying report according to the field to be matched comprises:
matching the query condition with a data value under a field to be matched in the target bottom report, and determining the successfully matched data value as a target object;
and determining the data of the target object under each field in the target underlying report as the target report data of the target object.
3. The method according to claim 1, wherein before obtaining the target object meeting the query condition from the target underlying report by matching according to the field to be matched, and obtaining the target report data of the target object, the method further comprises:
and if the field to be matched is determined to be an extended field obtained by real-time calculation based on the field in the target bottom report according to the query condition, performing extended calculation according to the field in the target bottom report on which the extended field associated with the query condition depends to obtain the field to be matched.
4. The method according to claim 3, wherein the performing an extended calculation according to the field in the target underlying report on which the extended field associated with the query condition depends to obtain the field to be matched comprises:
generating a data value under a required field according to the query condition and the field to be matched and determining a data value with an association relation under the required field according to the association relation among the data values in the target bottom report;
and generating an extended data value associated with the data value under the extended field according to the data value with the association relation under the required field.
5. The method of claim 4, further comprising, before said determining the data value having an association under the required field:
and if the expanded fields are determined to be the splicing of the fields in at least two target bottom reports according to the query conditions, connecting the at least two target bottom reports.
6. The method according to claim 1, wherein the obtaining the association data of the target object under other fields from the query report to be connected in association according to the target report data of the target object comprises:
connecting a target object report formed by the target report data of the target object with at least one other report except the target bottom report in the query report to be connected;
and determining the associated data of the target object under other fields from the connected intermediate report.
7. The method according to claim 1, wherein after the obtaining the associated data of the target object under other fields from the query report to be connected in association according to the target report data of the target object, further comprising:
and displaying the target report data of the target object and the associated data of the target object under other fields as connection query result data.
8. A data query apparatus, comprising:
the target bottom-layer report determining module is used for determining a target bottom-layer report related to the fields to be matched, which are depended by the screening and/or sorting operation, from the query reports to be connected according to the query conditions in the obtained query request;
the target object query module is used for obtaining a target object meeting the query condition from the target bottom report by matching according to the field to be matched and obtaining target report data of the target object;
and the data association module is used for associating and obtaining the associated data of the target object under other fields from the query report to be connected according to the target report data of the target object.
9. An apparatus, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the data query method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a data query method according to any one of claims 1 to 7.
CN201910553694.4A 2019-06-25 2019-06-25 Data query method, device, equipment and storage medium Pending CN112131253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910553694.4A CN112131253A (en) 2019-06-25 2019-06-25 Data query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910553694.4A CN112131253A (en) 2019-06-25 2019-06-25 Data query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112131253A true CN112131253A (en) 2020-12-25

Family

ID=73849367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910553694.4A Pending CN112131253A (en) 2019-06-25 2019-06-25 Data query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112131253A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288444A1 (en) * 2007-05-16 2008-11-20 John Francis Edwards Evaluating Multi-Table Join Selectivity in a Computer Database
WO2015184782A1 (en) * 2014-10-22 2015-12-10 中兴通讯股份有限公司 Data query method and device
CN105574052A (en) * 2014-11-06 2016-05-11 中兴通讯股份有限公司 Database query method and apparatus
CN106897340A (en) * 2016-07-05 2017-06-27 阿里巴巴集团控股有限公司 A kind of data table updating method and device
CN107368493A (en) * 2016-05-12 2017-11-21 百度在线网络技术(北京)有限公司 Data base query method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288444A1 (en) * 2007-05-16 2008-11-20 John Francis Edwards Evaluating Multi-Table Join Selectivity in a Computer Database
WO2015184782A1 (en) * 2014-10-22 2015-12-10 中兴通讯股份有限公司 Data query method and device
CN105574052A (en) * 2014-11-06 2016-05-11 中兴通讯股份有限公司 Database query method and apparatus
CN107368493A (en) * 2016-05-12 2017-11-21 百度在线网络技术(北京)有限公司 Data base query method and device
CN106897340A (en) * 2016-07-05 2017-06-27 阿里巴巴集团控股有限公司 A kind of data table updating method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: "SQL关联查询 直接Join和子查询的区别", pages 1 - 2, Retrieved from the Internet <URL:https://blog.51cto.com/u_10705830/2315247> *

Similar Documents

Publication Publication Date Title
CN107273506B (en) Method for multi-table combined query of database
US9239853B2 (en) Automatic consistent sampling for data analysis
US7020661B1 (en) Techniques for pruning a data object during operations that join multiple data objects
US20180239800A1 (en) Data query method and apparatus
US20080077569A1 (en) Integrated Search Service System and Method
WO2017096892A1 (en) Index construction method, search method, and corresponding device, apparatus, and computer storage medium
CN105550241A (en) Multidimensional database query method and apparatus
CN110674358A (en) Enterprise information comparison analysis method and device, computer equipment and storage medium
CN112765282B (en) Data online analysis processing method, device, equipment and storage medium
CN111339171B (en) Data query method, device and equipment
CN109086376B (en) SPARQL query language-based multi-query method and device
TW201820175A (en) Data base transformation server and data base transformation method thereof
US20140019454A1 (en) Systems and Methods for Caching Data Object Identifiers
CN110674359A (en) Method and system for displaying relation map in multiple scenes
US20160092134A1 (en) Scalable, multi-dimensional search for optimal configuration
CN113918605A (en) Data query method, device, equipment and computer storage medium
CN109241100B (en) Query method, device, equipment and storage medium
CN115062016A (en) Incidence relation extraction method and device and computer equipment
CN109656947B (en) Data query method and device, computer equipment and storage medium
US10482076B2 (en) Single level, multi-dimension, hash-based table partitioning
CN104199924B (en) The method and device of network form of the selection with snapshot relation
CN106991116B (en) Optimization method and device for database execution plan
CN109542912B (en) Interval data storage method, device, server and storage medium
CN109697234B (en) Multi-attribute information query method, device, server and medium for entity
CN112131253A (en) Data query method, device, equipment 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