CN111026931A - Data query method, device, equipment and medium - Google Patents

Data query method, device, equipment and medium Download PDF

Info

Publication number
CN111026931A
CN111026931A CN201911249593.4A CN201911249593A CN111026931A CN 111026931 A CN111026931 A CN 111026931A CN 201911249593 A CN201911249593 A CN 201911249593A CN 111026931 A CN111026931 A CN 111026931A
Authority
CN
China
Prior art keywords
query
data
elasticsearch
request
response
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
CN201911249593.4A
Other languages
Chinese (zh)
Inventor
吴轶峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN201911249593.4A priority Critical patent/CN111026931A/en
Publication of CN111026931A publication Critical patent/CN111026931A/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/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9032Query formulation

Abstract

The embodiment of the invention discloses a data query method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of an ElasticSearch; sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch; and converting the response data into target data according to the readability of the data, and using the target data as response information of the query request. The video search method provided by the embodiment of the invention can generate a query request meeting the requirement of the ElasticSearch query language according to the query parameters, and convert the data returned by the ElasticSearch into readable target data, so that the data query based on the ElasticSearch is more flexible.

Description

Data query method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the field of data query, in particular to a data query method, a data query device, data query equipment and a data query medium.
Background
According to the requirements of the financial industry, the online multi-billion customer transaction streams need to be integrated, the offline synchronization and manual additional recording are assisted, multi-dimensional aggregation and keyword fuzzy search are supported on the basis, and therefore data needs to be loaded into the ElasticSearch to support complex interaction requirements.
Currently, for online access to ElasticSearch, official high-version or low-version clients are typically used. The query of the high-version client needs to strictly correspond to the ElasticSearch version, and part of complex functions are not supported; and the low-version client only provides an http access interface, a complex JSON Jersen query body needs to be constructed in the application, JSON needs to be analyzed hierarchically for a returned result, and the complexity is high and is not favorable for maintenance and reuse. The method is based on the low level access of the ElasticSearch, aims to provide a flexibly configurable ElasticSearch access mode, can flexibly generate query configuration based on a request object, dynamically generates an index to be accessed, and aims to solve the problems of complex interactive access and difficult maintenance. .
Disclosure of Invention
The embodiment of the invention provides a data query method, a data query device, data query equipment and a data query medium, so that the flexibility of data query is improved, and the difficulty of system maintenance is reduced.
In a first aspect, an embodiment of the present invention provides a data query method, including:
acquiring query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of an ElasticSearch;
sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch;
and converting the response data into target data according to the readability of the data, and using the target data as response information of the query request.
In a second aspect, an embodiment of the present invention further provides a data query apparatus, including:
the query request generation module is used for acquiring query parameters and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of the ElasticSearch;
the response data acquisition module is used for sending the query request to the ElasticSearch and acquiring response data returned by the ElasticSearch;
and the response information determining module is used for converting the response data into target data according to the readability of the data and using the target data as the response information of the query request.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data query method as provided by any of the embodiments of the invention.
In a fourth aspect, the embodiments of the present invention further provide 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 provided in any embodiment of the present invention.
The method comprises the steps of generating a query request according to query parameters by obtaining the query parameters, wherein the data format of the query request is the same as the data query format of ElasticSearch; sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch; and converting the response data into target data according to the readability of the data, using the target data as response information of the query request, generating the query request meeting the requirement of the ElasticSearch query language according to the query parameters, and converting the data returned by the ElasticSearch into readable target data, so that the data query based on the ElasticSearch is more flexible.
Drawings
FIG. 1 is a flowchart of a data query method according to an embodiment of the present invention;
fig. 2a is a schematic diagram of a class diagram of a data query end according to a second embodiment of the present invention;
FIG. 2b is a diagram of a syntax configuration tree according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data query device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a data query method according to an embodiment of the present invention. The embodiment is applicable to the case of performing data query based on the ElasticSearch, and is particularly applicable to the case of performing data query based on the ElasticSearch of a low version. The method may be performed by a data query apparatus, which may be implemented in software and/or hardware, for example, the data query apparatus may be configured in a computer device. As shown in fig. 1, the method includes:
s110, obtaining query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of the ElasticSearch.
In this embodiment, a flexible data query method based on the ElasticSearch is provided, and when a user needs to perform data query, a query request recognizable by the ElasticSearch does not need to be automatically constructed according to a query requirement, and only a query parameter needs to be input. After detecting a data query request sent by an application terminal, the data query device acquires query parameters contained in the data query request, and then generates a query request recognizable by an ElasticSearch according to a pre-configured request generation rule based on the acquired query parameters. Generally, the format of the data query recognizable by the ElasticSearch is the JOSN format, that is, the query request is in the JOSN format.
Optionally, the query parameter may be a query condition meeting the query requirement. For example, assuming that the user needs to query the transaction data with the date of 2019/12/03, 2019/12/03 is input into the query terminal as a query parameter; assuming that a user needs to query transaction data of a specific transaction object, inputting an object identifier of the transaction object into a query terminal as a query parameter; assuming that a user needs to query transaction data of a certain transaction type (such as transfer, quick payment and the like) of a certain specific transaction object, an object identifier of the transaction object and the transaction type are input into a query terminal to serve as query parameters.
In an embodiment of the present invention, the generating a query request according to the query parameter includes: acquiring query parameters, generating query statements according to the query parameters and query logics corresponding to the query parameters, and converting the query statements into query requests according to a syntax configuration tree. In this embodiment, query logic may be preset, after the query parameters are obtained, a complete query statement is generated according to the query parameters and the query logic, and then the query statement is converted into a JSON-format query request. Optionally, different query logics may be set according to query requirements, and a query request is generated according to the query parameters and the query logics corresponding to the query parameters.
In one embodiment, before generating a query statement according to the query parameter and the query logic corresponding to the query parameter, the method further includes: and determining a query label corresponding to the query parameter, and determining a query logic corresponding to the query parameter according to the query label. Optionally, a query tag may be set for each query logic, the query tag is displayed on a query interface of the application end, when a user needs to perform data query, the query tag is selected on the query interface according to data query requirements, and query parameters are input, so that the application end generates a data query request according to the query tag selected by the user and the input query parameters, and sends the data query request to the data query device, the data query device parses the received data query request, obtains the query parameters and the query tags corresponding to the query parameters, takes the query logic corresponding to the query tags as the query logic corresponding to the query parameters, and generates a complete query statement according to the query parameters and the query logic corresponding to the query parameters. Optionally, the query tag includes at least one of isEqual, Iterate, isNotNull, and dynamic, and each query tag corresponds to a different query requirement.
In an embodiment of the present invention, the generating a query statement according to the query parameter and the query logic corresponding to the query parameter includes: and acquiring a query object identifier contained in the query parameter, acquiring an index corresponding to the query object identifier, and generating the query statement according to the index and the query logic. Optionally, in this embodiment, an index may be dynamically generated according to a query object input by a user, and a complete query statement may be generated based on the index and the query logic. For example, the corresponding relationship between the query object identifier and the index may be preset, and the index corresponding to the query request is determined according to the query object identifier carried in the data query request. The query object Identifier may be a Uniform Resource Identifier (URI) address that needs to be accessed.
S120, sending the query request to the ElasticSearch, and acquiring response data returned by the ElasticSearch.
In this embodiment, after the query request recognizable by the ElasticSearch is generated, the generated query request is sent to the ElasticSearch to perform data query. And after the ElasticSearch queries the data according to the query request, returning response data corresponding to the query request. Generally, the response data returned by the ElasticSearch is data in JSON format.
And S130, converting the response data into target data according to the readability of the data, and using the target data as response information of the query request.
The JOSN-format response data is nested with a data acquisition logic for acquiring the target data, if the JOSN-format response data is directly used as a data query request, the application terminal needs to acquire the target data readable by the front-end user from the ElasticSearch according to the data acquisition logic in the JSON-format response data, and the mode for acquiring the target data by the application terminal is complex and is not beneficial to maintenance and multiplexing of the application terminal. In this embodiment, the target data readable by the front-end user is directly sent to the application end, so as to simplify the data acquisition process of the application end and reduce the system maintenance difficulty of the application end.
In order to facilitate the application end to be readable, after response data returned by the ElasticSearch is obtained, the ElasticSearch in the JSON format is analyzed to obtain target data readable by a front-end user, and the target data is used as response information of a query request and sent to the application end. Alternatively, the target data may be in the form of a ResultSet result set, where ResultSet is a data table of the database result set, typically generated by executing a statement that queries the database.
In one embodiment of the present invention, the converting the response data into the target data according to data readability includes: analyzing the JOSN format data to obtain data acquisition logic, acquiring display data contained in the response data according to the data acquisition logic and a syntax configuration tree, and taking the display data as the target data. Optionally, the JSON data may be parsed to obtain a data obtaining logic of the target data, and then the display data may be obtained according to the syntax configuration tree and the data obtaining logic obtained from the elastic search, and the display data may be used as the target data. For example, the data obtaining logic may obtain data B according to the path a, then obtain presentation data D according to the data B and the path C, obtain the presentation data D from the elastic search according to the data obtaining logic and the syntax configuration tree, and take the presentation data D as target data.
The method comprises the steps of generating a query request according to query parameters by obtaining the query parameters, wherein the data format of the query request is the same as the data query format of ElasticSearch; sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch; and converting the response data into target data according to the readability of the data, using the target data as response information of the query request, generating the query request meeting the requirement of the ElasticSearch query language according to the query parameters, and converting the data returned by the ElasticSearch into readable target data, so that the data query based on the ElasticSearch is more flexible.
Example two
The present embodiment provides a preferred embodiment based on the above-described embodiments. The data query method provided by this embodiment may be implemented by an ElasticSearch-based restful client. In this embodiment, the data query module and the elastic search low-version client are encapsulated by the OSM, so as to obtain a data query end that provides multiple flexible dynamic tag settings and is simple to develop.
Optionally, a configuration file may be generated according to the connection configuration of the ElasticSearch, a syntax configuration tree may be generated after the configuration file is analyzed, and the connection pool may be created and stored based on the syntax configuration tree. The connection pool is used for generating a query request which can be identified by the ElasticSearch according to the query parameters input by the user and converting the JSON format data returned by the ElasticSearch into target data which can be read by the front-end user.
Fig. 2a is a schematic diagram of a class diagram of a data querying end according to an embodiment of the present invention. As shown in FIG. 2a, the data query side classes include a configuration class 210, an ESfactoryBuild220, an ESfactor 230, an ES syntax configuration parsing engine 240, an ES syntax tree multi-node 250, an ES access service 260 and an authentication interface 270. Illustratively, the configuration class 210 can provide connection configuration of an ElasticSearch set by a user, the factorybuilt class 220 creates a connection pool, the factorary class 230 stores the connection pool, the syntax configuration parsing engine 240 generates a syntax configuration tree according to the ES syntax tree multi-node 250, the ES access service 260 provides multiple access interfaces based on the connection configuration of the ElasticSearch, so that the data query end in the embodiment can be integrated in different application ends, and performs ORM packaging on a return result of the ElasticSearch to generate target data, and the authentication interface 270 is used for providing different authentication modes for the different application ends.
In this embodiment, a plurality of flexible dynamic tags can be provided in the connectivity configuration of the ElasticSearch, a user only needs to input query parameters and select a corresponding dynamic tag when performing data query, and the data query end generates a complete query statement according to the query logic and the query parameters corresponding to the dynamic tag. In addition, the corresponding relation between the query object identification and the index can be configured to realize dynamic generation of the index, a user only needs to input the query object identification when data query is carried out, and the data query end generates the corresponding index according to the query object identification.
Fig. 2b is a schematic diagram of a syntax configuration tree according to a second embodiment of the present invention. As shown in fig. 2b, the root node in the syntax configuration tree includes a plurality of namespaces and common configuration nodes, and each namespace is, according to the tree structure, from top to bottom: the method comprises the steps of inquiring public parameters, inquiry detailed configurations and nodes of the configuration in a single inquiry mode, calling a conventional node branch or calling a static leaf node branch when inquiring the detailed configurations, wherein a static state is arranged in the static leaf node branch, and calling a non-empty label node, a JOSN array node and a List label node after calling the conventional node, wherein a non-empty field is arranged in the non-empty label node, the non-empty label node can call the conventional node to call the conventional node of the static leaf node or call a dynamic leaf node, and the JOSN array node and the List label node can call the conventional node to call the dynamic leaf node, wherein a dynamic value, a dynamic key and a dynamic value position are arranged in the dynamic leaf node.
After receiving the query request and the request parameters, the data query end provided by the embodiment of the invention analyzes the query request and the request parameters through the syntax tree engine according to the specific incoming values (namely the request parameters), finally generates a query string meeting the requirement of the ElasticSearch, and sends an http request. After receiving the response result, ORM conversion is carried out according to the configuration, and convenient query result acquisition is provided. The usability and reusability of data query are improved, and the maintenance complexity of a data query end is reduced.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data query apparatus according to a third embodiment of the present invention. The data query device can be implemented in software and/or hardware, for example, the data query device can be configured in a computer device. As shown in fig. 3, the apparatus includes a query request generating module 310, a response data obtaining module 320, and a response information determining module 330, wherein:
the query request generating module 310 is configured to obtain a query parameter, and generate a query request according to the query parameter, where a data format of the query request is the same as a data query format of an ElasticSearch;
a response data obtaining module 320, configured to send the query request to the ElasticSearch, and obtain response data returned by the ElasticSearch;
the response information determining module 330 is configured to convert the response data into target data according to readability of the data, and use the target data as response information of the query request.
The embodiment of the invention obtains the query parameters through a query request generating module, and generates the query request according to the query parameters, wherein the data format of the query request is the same as the data query format of the ElasticSearch; the response data acquisition module sends the query request to an ElasticSearch and acquires response data returned by the ElasticSearch; the response information determining module converts the response data into target data according to the readability of the data, the target data are used as response information of the query request, the query request meeting the requirement of the ElasticSearch query language is generated according to the query parameters, and the data returned by the ElasticSearch is converted into readable target data, so that the data query based on the ElasticSearch is more flexible.
Optionally, on the basis of the above scheme, the query request generating module 310 is specifically configured to:
and generating a query statement according to the query parameter and the query logic corresponding to the query parameter, and converting the query statement into the query request according to a syntax configuration tree.
Optionally, on the basis of the above scheme, the apparatus further includes:
and the query logic determination module is used for determining a query label corresponding to the query parameter before generating a query statement according to the query parameter and the query logic corresponding to the query parameter, and determining the query logic corresponding to the query parameter according to the query label.
Optionally, on the basis of the above scheme, the query tag includes at least one of isEqual, Iterate, isNotNull, and dynamic.
Optionally, on the basis of the above scheme, the query request generating module 310 is specifically configured to:
and acquiring a query object identifier contained in the query parameter, acquiring an index corresponding to the query object identifier, and generating the query statement according to the index and the query logic.
Optionally, on the basis of the above scheme, the response data is data in a JOSN format, and the response information determining module 330 is specifically configured to:
analyzing the JOSN format data to obtain data acquisition logic, acquiring display data contained in the response data according to the data acquisition logic and a syntax configuration tree, and taking the display data as the target data.
Optionally, on the basis of the above scheme, the query request is in a JOSN format,
the data query device provided by the embodiment of the invention can execute the data query method provided by any embodiment, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention. The computer device 412 shown in FIG. 4 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 412 is in the form of a general purpose computing device. Components of computer device 412 may include, but are not limited to: one or more processors 416, a system memory 428, and a bus 418 that couples the various system components (including the system memory 428 and the processors 416).
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and processor 416, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 428 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)430 and/or cache memory 432. The computer device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Memory 428 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the computer device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, computer device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) through network adapter 420. As shown, network adapter 420 communicates with the other modules of computer device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 416 executes programs stored in the system memory 428 to perform various functional applications and data processing, such as implementing a data query method provided by an embodiment of the present invention, the method including:
acquiring query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of an ElasticSearch;
sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch;
and converting the response data into target data according to the readability of the data, and using the target data as response information of the query request.
Of course, those skilled in the art can understand that the processor can also implement the technical solution of the data query method provided by any embodiment of the present invention.
EXAMPLE five
The fifth embodiment of the present invention further 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 provided in the fifth embodiment of the present invention, where the method includes:
acquiring query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of an ElasticSearch;
sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch;
and converting the response data into target data according to the readability of the data, and using the target data as response information of the query request.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is 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.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments 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:
acquiring query parameters, and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of an ElasticSearch;
sending the query request to an ElasticSearch, and acquiring response data returned by the ElasticSearch;
and converting the response data into target data according to the readability of the data, and using the target data as response information of the query request.
2. The method of claim 1, wherein generating a query request according to the query parameters comprises:
and generating a query statement according to the query parameter and the query logic corresponding to the query parameter, and converting the query statement into the query request according to a syntax configuration tree.
3. The method of claim 2, before generating a query statement according to the query parameter and the query logic corresponding to the query parameter, further comprising:
and determining a query label corresponding to the query parameter, and determining a query logic corresponding to the query parameter according to the query label.
4. The method of claim 3, wherein the query tag comprises at least one of isEqual, Iterate, isNotNull, and dynamic.
5. The method of claim 2, wherein generating a query statement according to the query parameter and the query logic corresponding to the query parameter comprises:
and acquiring a query object identifier contained in the query parameter, acquiring an index corresponding to the query object identifier, and generating the query statement according to the index and the query logic.
6. The method of claim 1, wherein the response data is JOSN formatted data, and wherein converting the response data into target data according to data readability comprises:
analyzing the JOSN format data to obtain data acquisition logic, acquiring display data contained in the response data according to the data acquisition logic and a syntax configuration tree, and taking the display data as the target data.
7. The method of any of claims 1-6, wherein the query request is in JOSN format.
8. A data query apparatus, comprising:
the query request generation module is used for acquiring query parameters and generating a query request according to the query parameters, wherein the data format of the query request is the same as the data query format of the ElasticSearch;
the response data acquisition module is used for sending the query request to the ElasticSearch and acquiring response data returned by the ElasticSearch;
and the response information determining module is used for converting the response data into target data according to the readability of the data and using the target data as the response information of the query request.
9. A computer device, the device comprising:
one or more processors;
storage means 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 the data query method according to any one of claims 1 to 7.
CN201911249593.4A 2019-12-09 2019-12-09 Data query method, device, equipment and medium Pending CN111026931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911249593.4A CN111026931A (en) 2019-12-09 2019-12-09 Data query method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911249593.4A CN111026931A (en) 2019-12-09 2019-12-09 Data query method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN111026931A true CN111026931A (en) 2020-04-17

Family

ID=70208292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911249593.4A Pending CN111026931A (en) 2019-12-09 2019-12-09 Data query method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111026931A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597187A (en) * 2021-03-03 2021-04-02 北京冠新医卫软件科技有限公司 GraphQL query method and device based on FHIR standard
CN112784139A (en) * 2021-01-13 2021-05-11 多点(深圳)数字科技有限公司 Query method, query device, electronic equipment and computer readable medium
CN113190215A (en) * 2021-05-24 2021-07-30 上海万物新生环保科技集团有限公司 Query method and device based on search component
CN114357276A (en) * 2021-12-23 2022-04-15 北京百度网讯科技有限公司 Data query method and device, electronic equipment and storage medium
CN114896272A (en) * 2022-06-15 2022-08-12 北京奇艺世纪科技有限公司 Information acquisition method and device, electronic equipment and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528797A (en) * 2016-11-10 2017-03-22 上海轻维软件有限公司 DSL query method based on Elasticsearch
CN106997393A (en) * 2017-04-10 2017-08-01 深圳乐信软件技术有限公司 Data query method, device, server and storage medium
CN107122418A (en) * 2017-03-31 2017-09-01 北京奇艺世纪科技有限公司 A kind of querying method and device
CN107133267A (en) * 2017-04-01 2017-09-05 北京京东尚科信息技术有限公司 Inquire about method, device, electronic equipment and the readable storage medium storing program for executing of elasticsearch clusters
CN108491415A (en) * 2018-02-05 2018-09-04 武汉国贸通大数据有限公司 A kind of searching method and search system of international trade data
CN108520037A (en) * 2018-03-30 2018-09-11 新华三大数据技术有限公司 Data query method, apparatus and data visualisation system
CN109145014A (en) * 2017-06-15 2019-01-04 北京京东尚科信息技术有限公司 The method and apparatus for generating elastic searching request
CN110020006A (en) * 2017-07-27 2019-07-16 北京国双科技有限公司 The generation method and relevant device of query statement

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528797A (en) * 2016-11-10 2017-03-22 上海轻维软件有限公司 DSL query method based on Elasticsearch
CN107122418A (en) * 2017-03-31 2017-09-01 北京奇艺世纪科技有限公司 A kind of querying method and device
CN107133267A (en) * 2017-04-01 2017-09-05 北京京东尚科信息技术有限公司 Inquire about method, device, electronic equipment and the readable storage medium storing program for executing of elasticsearch clusters
CN106997393A (en) * 2017-04-10 2017-08-01 深圳乐信软件技术有限公司 Data query method, device, server and storage medium
CN109145014A (en) * 2017-06-15 2019-01-04 北京京东尚科信息技术有限公司 The method and apparatus for generating elastic searching request
CN110020006A (en) * 2017-07-27 2019-07-16 北京国双科技有限公司 The generation method and relevant device of query statement
CN108491415A (en) * 2018-02-05 2018-09-04 武汉国贸通大数据有限公司 A kind of searching method and search system of international trade data
CN108520037A (en) * 2018-03-30 2018-09-11 新华三大数据技术有限公司 Data query method, apparatus and data visualisation system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784139A (en) * 2021-01-13 2021-05-11 多点(深圳)数字科技有限公司 Query method, query device, electronic equipment and computer readable medium
CN112597187A (en) * 2021-03-03 2021-04-02 北京冠新医卫软件科技有限公司 GraphQL query method and device based on FHIR standard
CN112597187B (en) * 2021-03-03 2021-06-29 北京冠新医卫软件科技有限公司 GraphQL query method and device based on FHIR standard
CN113190215A (en) * 2021-05-24 2021-07-30 上海万物新生环保科技集团有限公司 Query method and device based on search component
CN114357276A (en) * 2021-12-23 2022-04-15 北京百度网讯科技有限公司 Data query method and device, electronic equipment and storage medium
CN114357276B (en) * 2021-12-23 2023-08-22 北京百度网讯科技有限公司 Data query method, device, electronic equipment and storage medium
CN114896272A (en) * 2022-06-15 2022-08-12 北京奇艺世纪科技有限公司 Information acquisition method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11290415B2 (en) Method and apparatus for unified message adaptation
CN111026931A (en) Data query method, device, equipment and medium
CN108519967B (en) Chart visualization method and device, terminal and storage medium
US9495429B2 (en) Automatic synthesis and presentation of OLAP cubes from semantically enriched data sources
US9075833B2 (en) Generating XML schema from JSON data
US8726229B2 (en) Multi-language support for service adaptation
CN109062563B (en) Method and device for generating page
US20010039540A1 (en) Method and structure for dynamic conversion of data
US20110161942A1 (en) Service adaptation definition language
US20100241978A1 (en) Dynamic generation of user interfaces and automated mapping of input data for service-oriented architecture-based system management applications
CN111158795A (en) Report generation method, device, medium and electronic equipment
US20210149895A1 (en) Query conversion for querying disparate data sources
US20180307692A1 (en) Software application interface for mediating access to services of a centralized data store
US10726004B2 (en) Enterprise integration processing for mainframe COBOL programs
CN113761428A (en) Page rendering method, device and system, storage medium and electronic equipment
CN111913922B (en) Binary structured log generation method, device, equipment and storage medium
CN109033456B (en) Condition query method and device, electronic equipment and storage medium
CN113254519B (en) Access method, device, equipment and storage medium of multi-source heterogeneous database
CN111988384B (en) Information transmission method and device, electronic equipment and storage medium
CN113760961B (en) Data query method and device
CN112417016A (en) Data exchange method, system, equipment and storage medium
KR102407941B1 (en) User interface generation method of electronic device calling function or procedure of external device based on remote procedure call(rpc), program and electronic device thereof
CN109241164A (en) A kind of data processing method, device, server and storage medium
CN111447268B (en) File structure conversion method, device, equipment and storage medium
US10838781B1 (en) Eventually consistent metadata exchange between software applications and services

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
TA01 Transfer of patent application right

Effective date of registration: 20220916

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right