CN110968679A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN110968679A
CN110968679A CN201811150896.6A CN201811150896A CN110968679A CN 110968679 A CN110968679 A CN 110968679A CN 201811150896 A CN201811150896 A CN 201811150896A CN 110968679 A CN110968679 A CN 110968679A
Authority
CN
China
Prior art keywords
data
query
category
target
service
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
CN201811150896.6A
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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201811150896.6A priority Critical patent/CN110968679A/en
Publication of CN110968679A publication Critical patent/CN110968679A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention discloses a data query method and a data query device. Wherein, the method comprises the following steps: acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category. The invention solves the technical problems of great time waste and low efficiency when data in a search engine library is extracted in the related technology.

Description

Data query method and device
Technical Field
The invention relates to the technical field of data processing, in particular to a data query method and device.
Background
In the related art, many users may need to derive some data through a search engine, and the data may be stored in a search engine library, for example, the data is stored in an elastic search, which is a search engine library for full-text retrieval. Different from a common relational database, the search engine libraries can lead to continuous screening and aggregation of the exported data due to inconsistency of conditions of the exported data and contents of results to be exported, and a programmer needs to write a data calling applet to obtain the desired data. However, in this process, the user needs to communicate with the programmer, and the data compiling program needs to be called each time, which not only causes unsmooth communication, but also takes time to program each time of calling, wastes a lot of time, and causes low efficiency of data export.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a data query method and a data query device, which are used for at least solving the technical problems of great time waste and low efficiency when data in a search engine library are extracted in the related art.
According to an aspect of an embodiment of the present invention, there is provided a data query method, including: acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category.
Further, generating a data query statement according to the data query condition and the field to be queried includes: acquiring a target index condition, wherein the target index condition at least comprises: the search engine library and index structure information are preset, and the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried; combining the data query conditions according to a preset combination mode by using the target index conditions to obtain a first query statement, wherein the preset combination mode at least comprises one of the following modes: or in combination, with, or without; and arranging the fields to be queried according to a preset arrangement mode by using the target index condition, and combining the arranged fields to be queried to obtain a second query statement, wherein the preset arrangement mode at least comprises the following steps: arranging a table; and generating the data query statement according to the first query statement and the second query statement.
Further, the obtaining of the target index condition includes: acquiring a cluster address of the preset search engine library; loading an index list according to the cluster address, wherein the index list is used for mapping the index structure information according to the cluster address; and determining the target index condition according to the cluster address and the index list.
Further, after determining the output data corresponding to the target service, the method further includes: acquiring a header of a preset report; the output data correspond to the header of the preset report one by one so as to export the output data to the preset report; and displaying the preset report.
Further, before acquiring the data query condition and the field to be queried for querying the target service, the method further includes: acquiring the mapping relation and the target display mode between the data category and the service category; and presenting the mapping relation on a target page according to the target display mode.
Further, after the mapping relationship is presented on the target page, the method further includes: acquiring mapping relation adjustment data, wherein the mapping relation adjustment data corresponds to the service data of the target service, and the mapping relation adjustment data at least comprises: adjustment data for a plurality of fields in the mapping relationship; and adjusting the mapping relation according to the mapping relation adjusting data.
According to another aspect of the embodiments of the present invention, there is also provided a data query apparatus, including: the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a data query condition and a field to be queried for querying a target service, and the data category corresponding to the target service is a service data category; the generating unit is used for generating a data query statement according to the data query condition and the field to be queried; the query unit is used for executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; a second obtaining unit, configured to obtain, in a mapping relationship between data categories and service categories, a service data category corresponding to the data category of the query data; and the determining unit is used for determining output data corresponding to the target service according to the query data and the service data type.
Further, the generation unit includes: a first obtaining module, configured to obtain a target index condition, where the target index condition at least includes: the search engine library and index structure information are preset, and the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried; a first combination module, configured to combine, by using the target index condition, the data query conditions in a preset combination manner to obtain a first query statement, where the preset combination manner at least includes one of: or in combination, with, or without; the second combining module is configured to arrange the fields to be queried according to a preset arrangement manner by using the target index condition, and combine the arranged fields to be queried to obtain a second query statement, where the preset arrangement manner at least includes: arranging a table; and the generating module is used for generating the data query statement according to the first query statement and the second query statement.
Further, the first obtaining module comprises: the first obtaining submodule is used for obtaining the cluster address of the preset search engine library; the loading submodule is used for loading an index list according to the cluster address, wherein the index list is used for mapping the index structure information according to the cluster address; and the determining submodule is used for determining the target index condition according to the cluster address and the index list.
Further, the data query apparatus further includes: the second acquisition module is used for acquiring the header of a preset report after the output data corresponding to the target service is determined; the export module is used for corresponding the output data to the header of the preset report one by one so as to export the output data to the preset report; and the display module is used for displaying the preset report.
Further, the data query apparatus further includes: the third acquisition module is used for acquiring the mapping relation between the data categories and the service categories and the target display mode before acquiring the data query conditions and the fields to be queried for the target service; and the presentation module is used for presenting the mapping relation on a target page according to the target presentation mode.
Further, the data query apparatus further includes: a fourth obtaining module, configured to obtain mapping relationship adjustment data after the mapping relationship is presented on a target page, where the mapping relationship adjustment data corresponds to service data of the target service, and the mapping relationship adjustment data at least includes: adjustment data for a plurality of fields in the mapping relationship; and the adjusting module is used for adjusting the mapping relation according to the mapping relation adjusting data.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium for storing a program, where the program, when executed by a processor, controls a device on which the storage medium is located to execute any one of the above data query methods.
According to another aspect of the embodiments of the present invention, there is also provided a processor, where the processor is configured to execute a program, where the program executes the data query method described in any one of the above.
In the embodiment of the invention, a data query condition and a field to be queried for querying a target service are obtained, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category. In the embodiment, the data query conditions and the fields to be queried can be data query statements, and output data corresponding to the target service is determined by using a mapping relation.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a data query method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a data query device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an alternative data query device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
To facilitate the understanding of the present invention, some terms or nouns related to the embodiments of the present invention are explained below:
an elastic search, ES for short, is a search server based on Lucene, which provides a full text search engine with distributed multi-user capability.
Different business data may be stored in a current search engine library, and then it is difficult for a user to customize export excel data, various different programs may be written to perform data export functions according to different export requirements of different businesses, a large amount of time and manpower are consumed, and because a demander cannot directly understand the dimension data of the search engine, an ordinary demander needs to find technical maintenance personnel to export the data, so that the workload of communication and technical export is increased, and the efficiency of data export is reduced. Aiming at the defects, the invention can design a tool or a device, and a user can check the popular and understandable dimensional data only by preparing a file with a mapping relation. In the following embodiments of the present invention, the file describing the mapping relationship may be a mapping rule file, and the mapping rule file may further record information dimension data and an excel table header.
The following embodiments of the present invention are described with respect to business data of business persons.
The following embodiment of the invention can specially set the functions of the index dimension and the excel header mapping rule and the visual screening condition and output value assembler, before the method is used, only one mapping rule file needs to be prepared, then each time the guidance table only needs to load the mapping rule file and then select the own screening condition and output value, and the export operation is executed, thereby reducing a large amount of time, and users only need to prepare the mapping rule file. The present invention will be described in detail with reference to examples.
Example one
In accordance with an embodiment of the present invention, there is provided a data query method embodiment, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The report output of the following embodiments may be to an elastic search engine, query report data from the engine, and then output the report data. The following embodiments may be applied to a report generation tool designed, on which a user may perform related operations, the tool may be set on a web page, a specific setting position of the tool may be set according to different requirements of each user, and after the setting is completed, the user may query desired report data by using the tool.
In the following embodiment, each time a user exports data, the user only needs to manage a predefined mapping rule file, and defines a query condition by itself in combination with an output value column of a data report desired by itself, so as to query the desired data of the data report.
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category;
step S104, generating a data query statement according to the data query condition and the field to be queried;
step S106, executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data;
step S108, acquiring a business data category corresponding to the data category of the query data in the mapping relation between the data category and the business category;
step S110, determining output data corresponding to the target service according to the query data and the service data category.
Acquiring a data query condition and a field to be queried for querying a target service through the steps, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category. In the embodiment, the data query conditions and the fields to be queried can be data query statements, and output data corresponding to the target service is determined by using a mapping relation.
The present invention will be described in detail with reference to the respective steps. The index database in the embodiment described below is an elastic search engine library.
Step S102, acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category.
The data query condition can be a query condition input by a user, the query conditions can be combined, including a combination of an or condition, an and condition and a non-condition, and the data query condition can be a data query condition and a field to be queried, which are input to a known target service and are related to the target service.
Optionally, the field to be queried may be an output result column in the finally output report, and the field to be queried may define a result to be output, such as name, gender, age, business type, and business data. The user can check out the desired output result for all the known output result columns.
As an optional example of the present invention, before acquiring a data query condition and a field to be queried for querying a target service, the method further includes: acquiring a mapping relation and a target display mode between a data category and a service category; and presenting the mapping relation on a target page according to the target display mode.
That is, the mapping relationship can be presented on the page in a manner including, but not limited to: and presenting a table and a check box. By presenting the mapping relation on the target page, business personnel can know the relation between the currently known business and the data category in the search engine library, so that whether the mapping relation needs to be adjusted or not is determined according to a specific business scene and business data.
As another optional example of the present invention, after rendering the mapping relationship on the target page, the method further includes: acquiring mapping relation adjustment data, wherein the mapping relation adjustment data corresponds to service data of a target service, and the mapping relation adjustment data at least comprises: adjustment data for a plurality of fields in the mapping relationship; and adjusting the mapping relation according to the mapping relation adjusting data.
The above example indicates that the business personnel can adjust the mapping relationship displayed on the target page to a mapping relationship that the business personnel can understand or conveniently check and receive, so that the business personnel can check and receive the data type that the business personnel want when outputting the data.
In the invention, the mapping relation can be stored in a preset mapping rule file, the mapping rule file is further maintained according to a tool standard format, and after the mapping rule file is loaded, a user can check the data information of all dimensions.
In the present invention, the service data category corresponds to each service, and the data category described below corresponds to data searched from a search engine library.
And step S104, generating a data query statement according to the data query condition and the field to be queried.
As an optional example of the present invention, generating a data query statement according to a data query condition and a field to be queried includes: acquiring a target index condition, wherein the target index condition at least comprises the following steps: presetting a search engine library and index structure information, wherein the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried; combining the data query conditions according to a preset combination mode by using the target index conditions to obtain a first query statement, wherein the preset combination mode at least comprises one of the following modes: or in combination, with, or without; and arranging the fields to be queried according to a preset arrangement mode by using the target index condition, and combining the arranged fields to be queried to obtain a second query statement, wherein the preset arrangement mode at least comprises the following steps: arranging a table; and generating a data query statement according to the first query statement and the second query statement.
The above example indicates that the data query condition and the field to be queried may be combined to obtain the data query statement.
In the embodiment of the present invention, the preset search engine library may be an elasticsearch engine library.
The index structure information indicates an arrangement manner of the plurality of data query conditions and the plurality of query fields displayed in the page or the table, for example, the plurality of data query conditions are arranged in a multi-dimensional transverse manner, or the fields to be queried are arranged through a plurality of check boxes.
In an optional example of the present invention, the obtaining the target index condition includes: acquiring a cluster address of a preset search engine library; loading an index list according to the cluster address, wherein the index list is used for mapping index structure information according to the cluster address; and determining a target index condition according to the cluster address and the index list.
Optionally, the corresponding index may be selected through the index list, and then the corresponding index structure information is loaded. That is, the program can automatically load the index list, select the corresponding index, and then automatically load the index structure information by using the cluster address of the index database which is input in advance.
And step S106, executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data.
That is, the query can be performed in the search engine library through the data query statement, so as to obtain the query data. For the data category, a category of data queried from the search engine library may be indicated, the category indicating the search engine library.
Step S108, in the mapping relation between the data categories and the business categories, the business data categories corresponding to the data categories of the query data are obtained.
That is, the service data category may be obtained through a mapping relationship between the data category and the service category, where the service data category indicates a category corresponding to the target service, and indicates the service. And preparing for obtaining output data corresponding to the target service subsequently according to the mapping relation between the service data type and the data type of the query data.
Step S110, according to the query data and the service data category, determining output data corresponding to the target service.
The above steps indicate that the type of the query data can be converted into output data corresponding to the type of the service data through the type of the service data, and the output data is data corresponding to the target service.
In this exemplary embodiment, after determining the output data corresponding to the target service, the method further includes: acquiring a header of a preset report; the output data are in one-to-one correspondence with the header of the preset report so as to lead the output data out of the preset report; and displaying the preset report.
The output data can be displayed through a preset report, the output data corresponds to the header of the report, the header of the report can correspond to the fields to be queried one by one, and the header of the report can indicate a one-dimensional field header, for example, fields corresponding to name, gender, age, service type and service data are displayed at every other column in the first row of the header of the preset report. And then, the output data is in one-to-one correspondence with each line of data, and then the preset report is displayed to business personnel.
The present invention is described below with reference to another alternative data query device, where the generating device may implement the data query method described above, fig. 2 is a schematic diagram of a data query device according to an embodiment of the present invention, and as shown in fig. 2, the device may include:
the index module 21 is configured to acquire a cluster address of a preset search engine library, load an index list, acquire index information obtained by selecting the index list, and load index structure information;
the mapping relation module 22 is configured to perform adjustment operation on the mapping relation according to the service scene and the service data to maintain a mapping rule file recording the mapping relation, then load the mapping rule file, and present the mapping relation on a target page;
the screening condition assembling module and output value assembling module 23 is configured to combine the data query conditions according to a preset combination mode by using the target index conditions, arrange the fields to be queried according to a preset arrangement mode, and combine the arranged fields to be queried to obtain report query conditions and fields to be queried;
the data query module 24 is configured to convert the report query condition and the field to be queried into a report query statement, and execute a query according to the report query statement to obtain a query result;
and the data export module 25 is used for converting the query result into mapping data according to the mapping relation and exporting the mapping data to the data report file.
Through the data query device, a user can prepare only one mapping rule file with the mapping relation between the business data type and the data type, and then the mapping rule file is loaded, so that the data wanted by the user can be queried, the user can directly operate the screening condition assembler and the output value assembler to export the data, the time for communication and technical realization is greatly shortened, the efficiency of data export is improved, the user only needs to manage one mapping rule file to automatically export the data, and the user and personnel who do not know the electronic search data structure can simply and easily operate and export the data.
In the embodiment of the invention, the device can be designed into a web application, so that a user can automatically export data through a browser without downloading any client.
The invention will now be described with reference to a further alternative embodiment.
Example two
Fig. 3 is a schematic diagram of another alternative data query device according to an embodiment of the present invention, as shown in fig. 3, the device may include: a first obtaining unit 31, a generating unit 32, an inquiring unit 33, a second obtaining unit 34, and a determining unit 35, wherein,
a first obtaining unit 31, configured to obtain a data query condition and a field to be queried for querying a target service, where a data category corresponding to the target service is a service data category;
the generating unit 32 is configured to generate a data query statement according to the data query condition and the field to be queried;
the query unit 33 is configured to execute a query in a preset search engine library according to the data query statement to obtain query data and a data category of the query data;
a second obtaining unit 34, configured to obtain, in the mapping relationship between the data categories and the service categories, service data categories corresponding to the data categories of the query data;
the determining unit 35 is configured to determine output data corresponding to the target service according to the query data and the service data category.
By the data query device, a first obtaining unit 31 is used to obtain a data query condition and a field to be queried for querying a target service, wherein a data category corresponding to the target service is a service data category; generating a data query statement by the generating unit 32 according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement through a query unit 33 to obtain query data and a data category of the query data; acquiring a service data category corresponding to the data category of the query data in the mapping relationship between the data category and the service category through the second acquiring unit 34; the determining unit 35 determines output data corresponding to the target service according to the query data and the service data category. In the embodiment, the data query conditions and the fields to be queried can be data query statements, and output data corresponding to the target service is determined by using a mapping relation.
Optionally, the generating unit includes: a first obtaining module, configured to obtain a target index condition, where the target index condition at least includes: presetting a search engine library and index structure information, wherein the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried; the first combination module is used for combining the data query conditions according to a preset combination mode by using the target index conditions to obtain a first query statement, wherein the preset combination mode at least comprises one of the following modes: or in combination, with, or without; the second combination module is used for arranging the fields to be queried according to a preset arrangement mode by using the target index condition, and combining the arranged fields to be queried to obtain a second query statement, wherein the preset arrangement mode at least comprises the following steps: arranging a table; and the generating module is used for generating a data query statement according to the first query statement and the second query statement.
In an embodiment of the present invention, the first obtaining module includes: the first acquisition submodule is used for acquiring the cluster address of a preset search engine library; the loading submodule is used for loading an index list according to the cluster address, wherein the index list is used for mapping index structure information according to the cluster address; and the determining submodule is used for determining a target index condition according to the cluster address and the index list.
Further, the data query apparatus further includes: the second acquisition module is used for acquiring the header of the preset report after the output data corresponding to the target service is determined; the export module is used for corresponding the output data to the header of the preset report one by one so as to export the output data to the preset report; and the display module is used for displaying the preset report.
In an optional example, the data query apparatus further includes: the third acquisition module is used for acquiring the mapping relation between the data categories and the service categories and the target display mode before acquiring the data query conditions and the fields to be queried for the target service; and the presentation module is used for presenting the mapping relation on the target page according to the target presentation mode.
Optionally, the data query apparatus further includes: a fourth obtaining module, configured to obtain mapping relationship adjustment data after the mapping relationship is presented on the target page, where the mapping relationship adjustment data corresponds to service data of the target service, and the mapping relationship adjustment data at least includes: adjustment data for a plurality of fields in the mapping relationship; and the adjusting module is used for adjusting the data according to the mapping relation and adjusting the mapping relation.
The data query device may further include a processor and a memory, where the first acquiring unit 31, the generating unit 32, the querying unit 33, the second acquiring unit 34, the determining unit 35, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory. The kernel can be set to be one or more, and output data corresponding to the target service is determined according to the query data and the service data category by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium for storing a program, where the program, when executed by a processor, controls a device in which the storage medium is located to execute the data query method of any one of the above.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes a data query method according to any one of the above.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category.
Optionally, when the processor executes the program, the following steps may be further implemented: acquiring a target index condition, wherein the target index condition at least comprises the following steps: presetting a search engine library and index structure information, wherein the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried; combining the data query conditions according to a preset combination mode by using the target index conditions to obtain a first query statement, wherein the preset combination mode at least comprises one of the following modes: or in combination, with, or without; and arranging the fields to be queried according to a preset arrangement mode by using the target index condition, and combining the arranged fields to be queried to obtain a second query statement, wherein the preset arrangement mode at least comprises the following steps: arranging a table; and generating a data query statement according to the first query statement and the second query statement.
Optionally, when the processor executes the program, the following steps may be further implemented: acquiring a cluster address of a preset search engine library; loading an index list according to the cluster address, wherein the index list is used for mapping index structure information according to the cluster address; and determining a target index condition according to the cluster address and the index list.
Optionally, when the processor executes the program, the following steps may be further implemented: after output data corresponding to the target service is determined, a header of a preset report is obtained; the output data are in one-to-one correspondence with the header of the preset report so as to lead the output data out of the preset report; and displaying the preset report.
Optionally, when the processor executes the program, the following steps may be further implemented: before acquiring a data query condition and a field to be queried for querying a target service, acquiring a mapping relation between a data category and a service category and a target display mode; and presenting the mapping relation on a target page according to the target display mode.
Optionally, when the processor executes the program, the following steps may be further implemented: after the mapping relationship is presented on the target page, mapping relationship adjustment data is obtained, wherein the mapping relationship adjustment data corresponds to the service data of the target service, and the mapping relationship adjustment data at least comprises: adjustment data for a plurality of fields in the mapping relationship; and adjusting the mapping relation according to the mapping relation adjusting data.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category; generating a data query statement according to the data query condition and the field to be queried; executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data; acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category; and determining output data corresponding to the target service according to the query data and the service data category.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple 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, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for querying data, comprising:
acquiring a data query condition and a field to be queried for querying a target service, wherein the data category corresponding to the target service is a service data category;
generating a data query statement according to the data query condition and the field to be queried;
executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data;
acquiring a business data category corresponding to the data category of the query data in a mapping relation between the data category and the business category;
and determining output data corresponding to the target service according to the query data and the service data category.
2. The method of claim 1, wherein generating a data query statement according to the data query condition and the field to be queried comprises:
acquiring a target index condition, wherein the target index condition at least comprises: the search engine library and index structure information are preset, and the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried;
combining the data query conditions according to a preset combination mode by using the target index conditions to obtain a first query statement, wherein the preset combination mode at least comprises one of the following modes: or in combination, with, or without;
and arranging the fields to be queried according to a preset arrangement mode by using the target index condition, and combining the arranged fields to be queried to obtain a second query statement, wherein the preset arrangement mode at least comprises the following steps: arranging a table;
and generating the data query statement according to the first query statement and the second query statement.
3. The method of claim 2, wherein obtaining a target index condition comprises:
acquiring a cluster address of the preset search engine library;
loading an index list according to the cluster address, wherein the index list is used for mapping the index structure information according to the cluster address;
and determining the target index condition according to the cluster address and the index list.
4. The method of claim 1, wherein after determining the output data corresponding to the target service, further comprising:
acquiring a header of a preset report;
the output data correspond to the header of the preset report one by one so as to export the output data to the preset report;
and displaying the preset report.
5. The method of claim 1, before obtaining the data query condition and the field to be queried for the target service, further comprising:
acquiring the mapping relation and the target display mode between the data category and the service category;
and presenting the mapping relation on a target page according to the target display mode.
6. The method of claim 5, after rendering the mapping relationship on a target page, further comprising:
acquiring mapping relation adjustment data, wherein the mapping relation adjustment data corresponds to the service data of the target service, and the mapping relation adjustment data at least comprises: adjustment data for a plurality of fields in the mapping relationship;
and adjusting the mapping relation according to the mapping relation adjusting data.
7. A data query apparatus, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a data query condition and a field to be queried for querying a target service, and the data category corresponding to the target service is a service data category;
the generating unit is used for generating a data query statement according to the data query condition and the field to be queried;
the query unit is used for executing query in a preset search engine library according to the data query statement to obtain query data and the data category of the query data;
a second obtaining unit, configured to obtain, in a mapping relationship between data categories and service categories, a service data category corresponding to the data category of the query data;
and the determining unit is used for determining output data corresponding to the target service according to the query data and the service data type.
8. The apparatus of claim 7, wherein the generating unit comprises:
a first obtaining module, configured to obtain a target index condition, where the target index condition at least includes: the search engine library and index structure information are preset, and the index structure information indicates a plurality of data query conditions to be displayed and an arrangement mode of a plurality of fields to be queried;
a first combination module, configured to combine, by using the target index condition, the data query conditions in a preset combination manner to obtain a first query statement, where the preset combination manner at least includes one of: or in combination, with, or without;
the second combining module is configured to arrange the fields to be queried according to a preset arrangement manner by using the target index condition, and combine the arranged fields to be queried to obtain a second query statement, where the preset arrangement manner at least includes: arranging a table;
and the generating module is used for generating the data query statement according to the first query statement and the second query statement.
9. A storage medium storing a program, wherein the program, when executed by a processor, controls an apparatus in which the storage medium is located to execute the data query method according to any one of claims 1 to 6.
10. A processor, configured to run a program, wherein the program when running performs the data query method of any one of claims 1 to 6.
CN201811150896.6A 2018-09-29 2018-09-29 Data query method and device Pending CN110968679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811150896.6A CN110968679A (en) 2018-09-29 2018-09-29 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811150896.6A CN110968679A (en) 2018-09-29 2018-09-29 Data query method and device

Publications (1)

Publication Number Publication Date
CN110968679A true CN110968679A (en) 2020-04-07

Family

ID=70027489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811150896.6A Pending CN110968679A (en) 2018-09-29 2018-09-29 Data query method and device

Country Status (1)

Country Link
CN (1) CN110968679A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597202A (en) * 2020-12-28 2021-04-02 江苏苏宁物流有限公司 Data query method and device, computer equipment and storage medium
CN113268502A (en) * 2020-12-23 2021-08-17 上海右云信息技术有限公司 Method and equipment for providing information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750681A (en) * 2013-12-25 2015-07-01 中国移动通信集团辽宁有限公司 Method and device for processing mass data
CN106570022A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Cross-data-source query method, apparatus and system
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
CN107038207A (en) * 2017-02-20 2017-08-11 阿里巴巴集团控股有限公司 A kind of data query method, data processing method and device
US20180095972A1 (en) * 2016-10-04 2018-04-05 Datavard Gmbh Method and system for determining data usage behavior in a database system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750681A (en) * 2013-12-25 2015-07-01 中国移动通信集团辽宁有限公司 Method and device for processing mass data
CN106570022A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Cross-data-source query method, apparatus and system
CN106959963A (en) * 2016-01-12 2017-07-18 杭州海康威视数字技术股份有限公司 A kind of data query method, apparatus and system
US20180095972A1 (en) * 2016-10-04 2018-04-05 Datavard Gmbh Method and system for determining data usage behavior in a database system
CN107038207A (en) * 2017-02-20 2017-08-11 阿里巴巴集团控股有限公司 A kind of data query method, data processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268502A (en) * 2020-12-23 2021-08-17 上海右云信息技术有限公司 Method and equipment for providing information
CN112597202A (en) * 2020-12-28 2021-04-02 江苏苏宁物流有限公司 Data query method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10747762B2 (en) Automatic generation of sub-queries
CN109597974B (en) Report generation method and device
CN113342821A (en) Report configuration method, device, equipment and computer storage medium
CN101405728B (en) Relational database architecture with dynamic load capability
CN105205071A (en) Method and system for showing data table
CN110968380B (en) Data visualization method and system
US20140067548A1 (en) Saving on device functionality for business calendar
CN106940721B (en) Data processing method and system for user-defined selection box
CN102567032A (en) Common interface configuration method and computer
CN111597238A (en) Method and device for dynamically displaying table data based on database
CN107451280B (en) Data communication method and device and electronic equipment
CN110968679A (en) Data query method and device
CN114741392A (en) Data query method and device, electronic equipment and storage medium
CN112527918A (en) Data processing method and device
CN111444177B (en) Report configuration method and device
CN116049153B (en) Database data processing method and device, electronic equipment and storage medium
CN112035555A (en) Information display method, device and equipment
JP5738943B2 (en) Pivot analysis method using condition group
CN112948441B (en) Multi-dimensional data collection method and equipment for financial data
CN115617338A (en) Method and device for quickly generating service page and readable storage medium
CN114840551A (en) Database table processing method and device, electronic equipment and storage medium
CN112905558A (en) Report system implementation method and system based on database configuration
CN110020101B (en) Method, device and system for restoring real-time search scene
CN112632115A (en) BI-based data query method and system
CN108241679B (en) Data processing method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200407

RJ01 Rejection of invention patent application after publication