CN114896279A - Data query method, device, equipment and readable storage medium - Google Patents
Data query method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN114896279A CN114896279A CN202210553809.1A CN202210553809A CN114896279A CN 114896279 A CN114896279 A CN 114896279A CN 202210553809 A CN202210553809 A CN 202210553809A CN 114896279 A CN114896279 A CN 114896279A
- Authority
- CN
- China
- Prior art keywords
- target data
- query
- data
- data source
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000006243 chemical reaction Methods 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 abstract description 14
- 238000007405 data analysis Methods 0.000 abstract description 2
- 238000013500 data storage Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a data query method, a data query device, data query equipment and a readable storage medium, and relates to the field of data analysis. The method comprises the following steps: receiving a query request, wherein the query request indicates data information of target data in a universal language format, and the data information comprises a target data source identifier of a data source where the target data is located and query keywords of the target data; based on the target data source identification, positioning a target data source where the target data is located, wherein registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used for realizing conversion between the language format of the data sources and the universal language format; and acquiring target data from the target data source based on the query keywords and the registration information. The time for inquiring different data source data is reduced to a certain extent, and the repeated writing work caused by exporting converted files generated in the inquiring process is avoided to a certain extent.
Description
Technical Field
The embodiment of the application relates to the field of data analysis, in particular to a data query method, a data query device, data query equipment and a readable storage medium.
Background
With the improvement of office automation, each field is provided with a corresponding automatic office system, the office automation system of each field is independently developed, and has an independent software system and data with own characteristics, and data systems in different fields need to do complex data format conversion and export/import work.
In data query in different fields in the related art, generally, one conversion of intermediate data is needed, specifically, a source system exports data required by a target system to become an intermediate file; and converting the intermediate file into a data file which can be processed by a target system; and then importing the data file into a target system to realize data query among different data sources.
However, in the related art, each time of exporting, converting and rewriting of data requires a large number of Input/Output (IO) operations, which is time-consuming and may have a certain influence on the normal operation of the online service; when different data sources are queried, each system continuously generates new data, regular data synchronization is needed, each data synchronization inevitably needs to be repeatedly subjected to export conversion and write, and a large amount of repeated work is generated.
Disclosure of Invention
The embodiment of the application provides a data query method, a data query device, data query equipment and a readable storage medium, and can improve query speed in a data query process. The technical scheme is as follows:
in one aspect, a data query method is provided, where the method includes:
receiving a query request, wherein the query request indicates data information of target data in a universal language format, and the data information comprises a target data source identifier of a data source where the target data is located and query keywords of the target data;
based on the target data source identification, positioning a target data source where the target data is located, wherein registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used for realizing conversion between the language format of the data source and the universal language format;
and acquiring the target data from the target data source based on the query keyword and the registration information.
In an optional embodiment, before locating the target data source where the target data is located based on the target data source identifier, the method further includes:
receiving storage data information uploaded by the at least two data sources in the universal language format, wherein the storage data information comprises data source identifiers of the at least two data sources, data source data information and data source path information, the data source identifiers are used for uniquely indicating the data sources, and the data source data information is used for indicating data contents of the data sources;
and registering the stored data information to obtain the registration information, and configuring data query interfaces for the at least two data sources.
In an optional embodiment, the proxy query server includes a registration information table;
the registering the stored data information to obtain registration information includes:
registering the stored data information into the registration information table to obtain registration information respectively corresponding to the at least two data sources;
or,
and respectively registering the stored data information corresponding to the at least two data sources into corresponding registration information tables to obtain the registration information tables respectively corresponding to the at least two data sources, wherein the ith registration information table comprises the registration information corresponding to the ith data source, and i is a positive integer.
In an optional embodiment, the locating, based on the target data source identifier, a target data source where the target data is located includes:
analyzing the query request to obtain the target data source identification in the query request;
and determining a target data source path corresponding to the target data source identifier based on the target data source identifier, wherein the target data source path is a storage positioning path of the target data source.
In an optional embodiment, the obtaining the target data from the target data source based on the query keyword and the registration information includes:
determining a target data query interface corresponding to the target data source identification based on the target data source identification;
and acquiring the target data from the target data source stored on the target data source path through the target data query interface based on the query keyword.
In an optional embodiment, the obtaining, through the target data query interface and based on the query keyword, the target data from the target data source stored on the target data source path includes:
converting the query keyword into a query statement corresponding to the target data source through the target data query interface;
sending the query statement to the target data source based on the target data source path;
and receiving the target data fed back by the target data source.
In an optional embodiment, the query request further includes a target computation requirement;
after the target data is acquired from the target data source, the method further includes:
calculating the target data based on the target calculation requirement to obtain a query result corresponding to the target data;
and sending the query result to a data processing terminal.
In another aspect, a data query apparatus is provided, the apparatus including:
a receiving module, configured to receive a query request, where the query request indicates data information of target data in a universal language format, and the data information includes a target data source identifier of a data source where the target data is located and a query keyword of the target data;
the positioning module is used for positioning a target data source where the target data is located based on the target data source identification, registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used for realizing conversion between the language format of the data sources and the universal language format;
and the acquisition module is used for acquiring the target data from the target data source based on the query keyword and the registration information.
In another aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the data query method according to any one of the embodiments of the present application.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, and loaded and executed by the processor to implement the data query method as described in any of the embodiments of the present application.
In another aspect, a computer program product is provided, which when run on a computer causes the computer to execute the data query method as described in any of the embodiments of the present application.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
before inquiring data information in different data sources, at least two data sources register corresponding registration information into a proxy inquiry server, and the proxy inquiry server configures corresponding data inquiry interfaces for at least two data sources; therefore, when the proxy query server receives the query request, the corresponding data source can be selected from the multiple data sources for data query and acquisition based on the target data source identification and the query keyword, the time for acquiring data from different data sources is reduced, and the repeated writing work caused by exporting the converted file generated in the query process is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a data query method provided by an exemplary embodiment of the present application;
FIG. 3 is a flow chart of a data query method provided by another exemplary embodiment of the present application;
FIG. 4 is a flow chart of a data query method provided by another exemplary embodiment of the present application;
FIG. 5 is a block diagram of a data query device according to an exemplary embodiment of the present application;
FIG. 6 is a block diagram of a data query device according to another exemplary embodiment of the present application;
fig. 7 is a block diagram of a proxy query server according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, as shown in fig. 1, the implementation environment includes a terminal 110, a proxy query server 120, and a plurality of data sources 130, where the terminal 110 includes a terminal a111 and a terminal B112, and the plurality of data sources 130 includes a data source a131, a data source B132, and a data source c 133.
The user sends a query request to the proxy query server 120 through the terminal 110 to query the data information in the data source 130, where the query request includes the data source identifier and the query keyword.
In the embodiment of the present application, a universal proxy query server 120 is constructed, and a plurality of data sources 130 register respective corresponding stored data information into the proxy query server 120, where the stored data information includes a data source identifier, a data storage location path, and structure information, the structure information is used to indicate a storage structure of data content in the data source, and in some embodiments, the structure information includes a query keyword used by a user when querying target data. For example: storing payroll details of company personnel in the data source, wherein the payroll details comprise months corresponding to the personnel and the personnel, and the data values are included under the corresponding relationship between the personnel and the months, such as: the corresponding relation between zhang san and october includes a data value 5000, which is used to indicate that the wage of zhang san in october is 5000, when the data value is registered in the proxy query server 120, the structural information corresponding to zhang san and october is stored in the proxy query server 120, and when the user queries, zhang san can be selected as a query keyword in the terminal to query the wage condition corresponding to zhang san in the data source.
Optionally, the stored data information of different data sources is registered in the proxy Query server 120 through a universal Language format to obtain the registered information, where the universal Language format is Structured Query Language (SQL).
Optionally, when the plurality of data sources 130 register corresponding registration information into the proxy query server 120, register corresponding data source identifiers, structural information, and data storage location paths into corresponding registration information tables, and when a user queries target data, the proxy query server 120 parses the query request and obtains target data source identifiers and query keywords; based on the target data source identifier and the query keyword, the proxy query server 120 obtains the target data corresponding to the query keyword from the target data source through the target data query interface corresponding to the target data source.
The proxy query server 120 includes data query interfaces (not shown in fig. 1) corresponding to the respective data sources 130. For example, the proxy query server 120 receives the registration information from the data source a131, the data source b132, and the data source c133, and formulates the query interface 1 for the data source a131, the query interface 2 for the data source b132, and the query interface 3 for the data source c133, respectively.
The proxy query server 120 receives a query request from the terminal a 111; analyzing the query request to obtain a target data source identifier and a query keyword; the proxy query server 120 locates the target data source based on the target data source identifier, and queries the target data through the target query interface corresponding to the target data source. In some embodiments, the query request includes a target data source identification for a single target data source, indicating that target data is to be obtained from the single data source; or, the query request includes target data source identifiers of a plurality of target data sources, which indicates that target data is acquired from the plurality of data sources.
Optionally, the query request includes a computation requirement for the target data, and the proxy query server 120 performs corresponding computation processing on the target data based on the computation requirement. For example, the calculation requirements include data calculation, data classification, data statistics, and data projection.
The proxy query server 120 processes the target data based on the computational requirements to obtain query results. The proxy query server 120 feeds the query result back to the preset position of the terminal 110 for display. For example, the user initiates an inquiry request at the terminal a111, the proxy inquiry server 120 obtains a final inquiry result according to the inquiry request, and feeds the inquiry result back to the terminal B112; alternatively, the terminal a111 may be configured to receive the query result, and the terminal B may be configured to initiate the query request, which is not limited in this application.
It should be noted that the terminal 110 may be implemented as a mobile terminal such as a mobile phone, a tablet computer, a wearable device, a portable laptop computer, or may also be implemented as a terminal such as a desktop computer, an electronic game machine, which is not limited in the embodiments of the present application.
The proxy query server 120 may be implemented as one server or a server cluster composed of multiple servers, and the server 120 may be implemented as a physical server or a cloud server, which is not limited in this embodiment of the application.
With reference to the foregoing implementation environment, a data query method involved in the embodiment of the present application is described, and fig. 2 is a flowchart of an exemplary data query method provided in the present application, and the method is applied to a proxy query server, as shown in fig. 2, the method includes:
The application scenario of the user for inquiring the target data in the terminal comprises at least one of the following situations:
firstly, an application program for inquiring a plurality of data source data is installed in a terminal, and corresponding target data is selected from an inquiry interface in the application program for inquiry; for example, a user may type a corresponding query keyword in a query interface to perform a query.
Secondly, a platform or a system for inquiring data of a plurality of data sources is arranged in the terminal, and illustratively, a user selects corresponding target data to inquire in a webpage interface correspondingly provided with an inquiry service.
It should be noted that the above application scenarios are only exemplary, and the application scenarios for querying the target data in the present application are not limited.
Aiming at the mode that the terminal sends the query request to the server, the method comprises at least one of the following conditions:
firstly, a user types in a terminal provided with a query application program, wherein the query keyword is used for positioning target data in a data source, and the query keyword comprises a target data source keyword corresponding to the target data and a keyword corresponding to data content. Illustratively, taking the user's query for payroll as an example, the user types a keyword at the terminal: "Zhang San" and "October" are used to indicate the payroll details in October of Zhang San. A terminal receives a keyword input by a user; and the query statement converted into the universal language format is attached to the query request and uploaded to the proxy query server, the proxy query server queries the payroll details of Zhang thirty October in a corresponding data source, and returns the target data obtained by query to the terminal.
Secondly, a corresponding data acquisition scheme is preset in the terminal, the data acquisition scheme comprises a target data source identifier and query keywords, when a user queries target data, the data acquisition scheme corresponding to the target data queried by the user is selected in the terminal, and the terminal converts the data acquisition scheme selected by the user into a query statement in a universal language format, attaches the query statement to a query request and uploads the query statement to the proxy query server; and the proxy query server positions the target data source based on the query statement and acquires the target data from the target data source according to the query keyword.
Thirdly, a functional control corresponding to the query target data is arranged in the terminal, a user carries out data query by clicking the corresponding control in the query interface, and the functional control is correspondingly provided with a corresponding target data source identifier and a query keyword; and after the user clicks the control, the terminal converts the target data source identification and the query keyword into a query statement in a universal language format, attaches the query statement to the query request, and uploads the query statement to the proxy query server.
In some embodiments, when different data sources store corresponding registration information into the proxy query server, the registration information is stored in a universal language format, and the proxy query server analyzes the query request in the universal language format to obtain a target data source identifier and a query keyword included in the query request.
Before the proxy query server receives the query request, the process of registering the data source with the proxy query service is also included.
Namely, the proxy query server receives the stored data information uploaded by at least two data sources in the universal language format, wherein the stored data information comprises data source identifications, data source data information and data source path information of the at least two data sources. The data source identification is used for uniquely indicating the data source, and the data source information is used for indicating the data source content of the data source. It is noted that the data source information is not implemented as the data source content itself in the data source, but is storage information for indicating data in the data source, such as: storage format, storage structure, etc.
In the embodiment of the application, at least two data source information uploads the stored data information corresponding to the data source information to the proxy query server in an SQL language format to complete registration.
In some embodiments, after receiving the stored data information uploaded by the data sources, the proxy query server registers the stored data information to obtain registration information, and at least two data sources are not configured with the data query structure.
In some embodiments, the registration process of the data source is actively performed by the data source side; alternatively, the registration process for the data source is completed based on the registration indication of the proxy query server. Illustratively, when a data storage structure in the data source is changed or a data storage format in the data source is changed, a registration update request is sent to the proxy query server to implement update registration in the proxy query server (i.e. an active registration process of the data source); or, at the initial stage of setting the proxy query server, after the proxy query server establishes connection with each data source, the proxy query server sends a registration instruction to each data source, so that each data source sends the stored data information to the proxy query server for registration based on the registration instruction.
The data source path information is used for indicating a storage location path of the data source, and for example, the storage data information includes "Hive", "http// c.html", which means that the data source is stored on the data path of http// c.html.
It should be noted that the format of the stored data information mentioned in the above examples is only exemplary, and the stored data information may also be expressed in other formats, which is not limited in this application.
And the proxy query server registers the stored data information to obtain registration information and configures a data query interface for the corresponding data source. Illustratively, the proxy query server registers based on the stored data information of the data source Hive and the data source HDFS, and configures a Hive data query interface and an HDFS data query interface for the data source Hive and the data source HDFS, respectively.
After receiving the query request, the proxy query server analyzes the query request to obtain a target data source identifier and a query keyword which are included in the query request; and determining a target data source path corresponding to the target data source identifier based on the target data source identifier, wherein the target data source path is a storage positioning path of the target data source.
Before receiving a query request, at least two data sources register self-generated storage data information to a proxy query server in a form of a registration information table; therefore, the proxy server includes a registration information table, and after the proxy query server obtains the target data source identifier, the proxy query server queries the corresponding target data source in the registration information table based on the target data source identifier in the query request.
That is, the proxy query server includes a registration information table, and in the registration process, the stored data information is registered in the registration information table to obtain registration information corresponding to at least two data sources respectively; or respectively registering the stored data information corresponding to the at least two data sources in the corresponding registration information tables to obtain registration information tables corresponding to the at least two data sources, wherein the ith registration information table comprises the registration information corresponding to the ith data source, and i is a positive integer.
That is, the registration information table is implemented as a table containing the registration information of the entire data source; alternatively, the registration information table is implemented as a separate table for each data source.
In some embodiments, when the data source is registered with the proxy query server, the proxy query server correspondingly stores the storage location path corresponding to the data source in the registration information table, so that after the proxy query server obtains the target data source identifier from the query request, the proxy query server can determine the storage location path corresponding to the target data source from the registration information table based on the target data source identifier, that is, the target data source where the target data is located.
Illustratively, the registration information table includes the following corresponding data sources: data source identification, data source structure, data source interface information, data source storage location path, data source language format, and the like.
And after determining the target data source where the target data is located based on the target data source identifier, the proxy query server acquires the corresponding target data from the target data source based on the query keyword.
In some embodiments, the data is stored in the target data source in the form of key-value pairs (key-value), i.e., the data (value) corresponding to the key can be determined from the target data source based on the key (key). Therefore, in the embodiment of the application, after determining the query keyword from the query request, the proxy query server queries the target data corresponding to the keyword from the target data source through the data query interface corresponding to the target data source in the language format corresponding to the target data source.
In summary, in the data query method provided in this embodiment, before querying data information in different data sources, at least two data sources register corresponding registration information in a proxy query server, and the proxy query server configures corresponding data query interfaces for the at least two data sources; therefore, when the proxy query server receives the query request, the corresponding data source can be selected from the multiple data sources for data query and acquisition based on the target data source identification and the query keyword, the time for acquiring data from different data sources is reduced, and the repeated writing work caused by exporting the converted file generated in the query process is reduced.
Fig. 3 is a flowchart of a data query method provided in another exemplary embodiment of the present application, which is described by taking as an example that the method is applied to a proxy query server, and as shown in fig. 3, the method includes:
The process of receiving the query request is described in step 210 above, and is not described here.
In some embodiments, the proxy query server parses the query request in a common language format to obtain the target data source identifier and the query keyword from the query request, so as to implement the data query. And the target data source identifier is used for positioning a target data source stored by the target data, and the query keyword is used for positioning a storage keyword key corresponding to the target data in the data source.
The server is registered with registration information corresponding to a plurality of data sources, and can locate a storage location path (namely, a storage position of the target data source) where the target data source is located according to the target data source identifier and the registration information; the storage location of the target data can be located from the target data source according to the query keyword.
The data sources are registered in the proxy query server, format unification based on registration information is completed, so that the terminal can query the proxy server in a unified universal language format, and the proxy server acquires data from different data sources based on data storage types corresponding to different data sources.
That is, the number of the identifiers of the target data sources involved in the query request may be one or more.
The target data source path is a storage location path of the target data source, that is, the target data source path is a storage location of the target data.
And after the proxy query server analyzes the query request to acquire the target data source, determining a target data query interface corresponding to the target data source identifier, wherein the data query interface is an interface which is configured to the data source by the proxy query server and is used for realizing data acquisition.
And 350, acquiring target data from the target data source stored on the target data source path through the target data query interface based on the query keyword.
In some embodiments, when data query is performed through the target data query structure, the query keyword is converted into a query statement corresponding to the target data source through the target data query structure, the query statement is sent to the target data source based on the target data source path, and target data fed back by the target data source is received.
And the proxy query server acquires target data from the target data source through the target data query interface according to the query keyword in the query request. Illustratively, the query request is Hive: 20200101-20200103, wherein the request is used for indicating data information in the range from 2020, 01 month and 01 day to 2020, 01 month and 03 day in the Hive of the query data source, the proxy query server determines a target storage location path http of the Hive of the data source based on the data source identification Hive: com, proxy query server via Hive query interface from path http: com acquires data information generated from year 2020, month 01, to year 2020, month 01, and day 03.
The proxy query server receives the target data returned by the target data source, and feeds the target data back to the terminal sending the query request, or feeds the target data back to another terminal, which is not limited in the present application.
In summary, in the data query method provided in this embodiment, before querying data information in different data sources, at least two data sources register corresponding registration information in a proxy query server, and the proxy query server configures corresponding data query interfaces for the at least two data sources; therefore, when the proxy query server receives the query request, the target data are acquired from the data query interface of the corresponding data source according to the target data storage path, the overlong query time caused by querying the storage path in all databases is avoided, and the time for acquiring the target data is reduced.
Fig. 4 is a flowchart of a data query method according to another exemplary embodiment of the present application, which is described by taking the method as an example for being applied to a proxy query server, and as shown in fig. 4, the method includes:
The query keyword is used to query target data in the data source, and the target data can be data content which can be stored by numbers, time, images, videos and the like.
The calculation requirement is used to indicate a requirement for performing corresponding processing on the target data, and may include a requirement for performing processing on the target data by numerical calculation, classification, statistics, image processing, video processing/projection, and the like.
The procedure of this step is the same as the procedure from step 220 to step 230, and is not described herein again.
And 430, calculating the target data based on the target calculation requirement to obtain a query result corresponding to the target data.
Optionally, the proxy query server receives the target data returned by the target data query interface, parses the query request again (this step may also be completed in step 410, which is not limited in this application), and obtains a calculation requirement in the query request, and performs corresponding processing on the target data based on the calculation requirement, to obtain a query result, and the proxy query server feeds back the query interface to the terminal, which may be a terminal initiating the query request or another terminal.
In summary, in the data query method provided in this embodiment, before querying data information in different data sources, at least two data sources register corresponding registration information in a proxy query server, and the proxy query server configures corresponding data query interfaces for the at least two data sources; therefore, when the proxy query server receives the query request, the corresponding data source can be selected from the multiple data sources to perform data query and acquisition based on the target data source identification and the query keyword in the query request, and after the target data is acquired, the target data is processed based on the calculation requirement of a user, so that the time for acquiring data from different data sources is reduced, the repeated writing work caused by exporting conversion files generated in the query process is reduced, and the operation speed for processing the target data is effectively shortened.
Fig. 5 is a block diagram of a payment apparatus for exchanging resources according to an exemplary embodiment of the present application, where the apparatus, as shown in fig. 5, includes: a receiving module 510, a positioning module 520, and an obtaining module 530;
a receiving module 510, configured to receive a query request, where the query request indicates data information of target data in a universal language format, and the data information includes a target data source identifier of a data source where the target data is located and a query keyword of the target data;
a positioning module 520, configured to position a target data source where the target data is located based on the target data source identifier, where registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used to implement conversion between a language format of the data source and the universal language format;
an obtaining module 530, configured to obtain the target data from the target data source based on the query keyword and the registration information.
In an alternative embodiment, as shown in fig. 6, the apparatus further comprises:
the receiving module 510 is further configured to receive stored data information uploaded by the at least two data sources in the universal language format, where the stored data information includes data source identifiers of the at least two data sources, data source data information, and data source path information, the data source identifiers are used to uniquely indicate the data sources, and the data source data information is used to indicate data contents of the data sources;
and a registration module 540, configured to register the stored data information to obtain the registration information, and configure data query interfaces for the at least two data sources.
In an alternative embodiment, as shown in fig. 6, the registration module 540 further includes: a first registration unit 5410 and a second registration unit 5420;
the first registration unit 5410 is configured to register the stored data information in the registration information table, so as to obtain registration information respectively corresponding to the at least two data sources;
the second registration unit 5420 is configured to register the stored data information corresponding to the at least two data sources into corresponding registration information tables, respectively, to obtain registration information tables corresponding to the at least two data sources, where an ith registration information table includes registration information corresponding to an ith data source, and i is a positive integer.
In an alternative embodiment, as shown in fig. 6, the apparatus further comprises:
the parsing module 550 is configured to parse the query request to obtain the target data source identifier in the query request;
the positioning module 520 is further configured to determine, based on the target data source identifier, a target data source path corresponding to the target data source identifier, where the target data source path is a storage positioning path of the target data source.
In an alternative embodiment, as shown in fig. 6, the apparatus further comprises:
the positioning module 520 is further configured to determine, based on the target data source identifier, a target data query interface corresponding to the target data source identifier;
the obtaining module 530 is further configured to obtain the target data from the target data source stored on the target data source path through the target data query interface based on the query keyword.
In an alternative embodiment, as shown in fig. 6, the obtaining module 530 is further configured to convert the query keyword into a query statement corresponding to the target data source through the target data query interface; sending the query statement to the target data source based on the target data source path; and receiving the target data fed back by the target data source.
In an alternative embodiment, as shown in fig. 6, the apparatus further comprises:
a sending module 560, configured to perform computation processing on the target data based on the target computation requirement, so as to obtain a query result corresponding to the target data; and sending the query result to a data processing terminal.
In summary, before querying data information in different data sources, the data query apparatus provided in this embodiment actively registers data generated by at least two data sources into the proxy query server, and the proxy query server configures corresponding data query interfaces for the at least two data sources; and based on the target data source identification and the query keyword in the query request, the proxy query server acquires corresponding target data in the target data source through the target data query interface. The time for inquiring different data source data is reduced to a certain extent, and the repeated writing work caused by exporting converted files generated in the inquiring process is avoided to a certain extent.
It should be noted that: the data query apparatus provided in the foregoing embodiment is only illustrated by dividing the functional modules, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the data query apparatus and the data query method provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments and are not described herein again.
Fig. 7 is a schematic structural diagram of a proxy query server according to an exemplary embodiment of the present application. The proxy query server may be the proxy query server shown in fig. 1. Specifically, the method comprises the following steps:
the proxy query server 120 includes a Central Processing Unit (CPU) 701, a system Memory 704 including a Random Access Memory (RAM) 702 and a Read Only Memory (ROM) 703, and a system bus 705 connecting the system Memory 704 and the Central Processing Unit 701. The proxy query server 120 also includes a basic Input/Output System (I/O) 706 for facilitating information transfer between devices within the computer, and a mass storage device 707 for storing an operating System 713, application programs 714, and other program modules 715.
The basic input/output system 706 includes a display 708 for displaying information and an input device 709, such as a mouse, keyboard, etc., for a user to input information. Wherein the display 708 and the input device 709 are connected to the central processing unit 701 through an input output controller 710 connected to the system bus 705. The basic input/output system 706 may also include an input/output controller 710 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 710 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer-readable media provide non-volatile storage for the proxy query server 120. That is, the mass storage device 707 may include a computer-readable medium (not shown) such as a hard disk or Compact Disc Read Only Memory (CD-ROM) drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory devices, CD-ROM, Digital Versatile Disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 704 and mass storage device 707 described above may be collectively referred to as memory.
According to various embodiments of the present application, proxy query server 120 may also operate as a remote computer connected to a network via a network, such as the Internet. That is, the proxy query server 120 may be connected to the network 712 through the network interface unit 711 connected to the system bus 705, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 711.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
Embodiments of the present application further provide a computer device, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the data query method provided by each of the above method embodiments.
Embodiments of the present application further provide a computer-readable storage medium, where at least one instruction, at least one program, a code set, or a set of instructions is stored on the computer-readable storage medium, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the data query method provided by the foregoing method embodiments.
Optionally, the computer-readable storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a Solid State Drive (SSD), or an optical disc. The Random Access Memory may include a resistive Random Access Memory (ReRAM) and a Dynamic Random Access Memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. A data query method, applied to a proxy query server in a server, the method comprising:
receiving a query request, wherein the query request indicates data information of target data in a universal language format, and the data information comprises a target data source identifier of a data source where the target data is located and query keywords of the target data;
based on the target data source identification, positioning a target data source where the target data is located, wherein registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used for realizing conversion between the language format of the data source and the universal language format;
and acquiring the target data from the target data source based on the query keyword and the registration information.
2. The method of claim 1, wherein locating the target data source where the target data is located based on the target data source identification further comprises:
receiving storage data information uploaded by the at least two data sources in the universal language format, wherein the storage data information comprises data source identifiers of the at least two data sources, data source data information and data source path information, the data source identifiers are used for uniquely indicating the data sources, and the data source data information is used for indicating data contents of the data sources;
and registering the stored data information to obtain the registration information, and configuring data query interfaces for the at least two data sources.
3. The method of claim 1, wherein the proxy query server includes a registry table;
the registering the storage data information to obtain the registration information includes:
registering the stored data information into the registration information table to obtain registration information respectively corresponding to the at least two data sources;
or,
and respectively registering the stored data information corresponding to the at least two data sources into corresponding registration information tables to obtain the registration information tables respectively corresponding to the at least two data sources, wherein the ith registration information table comprises the registration information corresponding to the ith data source, and i is a positive integer.
4. The method according to any one of claims 1 to 3, wherein said locating a target data source where the target data is located based on the target data source identification comprises:
analyzing the query request to obtain the target data source identification in the query request;
and determining a target data source path corresponding to the target data source identifier based on the target data source identifier, wherein the target data source path is a storage positioning path of the target data source.
5. The method of claim 4, wherein the obtaining the target data from the target data source based on the query keyword and the registration information comprises:
determining a target data query interface corresponding to the target data source identification based on the target data source identification;
and acquiring the target data from the target data source stored on the target data source path through the target data query interface based on the query keyword.
6. The method of claim 5, wherein the obtaining the target data from the target data source stored on the target data source path through the target data query interface based on the query keyword comprises:
converting the query keyword into a query statement corresponding to the target data source through the target data query interface;
sending the query statement to the target data source based on the target data source path;
and receiving the target data fed back by the target data source.
7. The method of claim 5, wherein the query request further includes a target computation requirement;
after the target data is acquired from the target data source, the method further includes:
calculating the target data based on the target calculation requirement to obtain a query result corresponding to the target data;
and sending the query result to a data processing terminal.
8. A data query apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive a query request, where the query request indicates data information of target data in a universal language format, and the data information includes a target data source identifier of a data source where the target data is located and a query keyword of the target data;
the positioning module is used for positioning a target data source where the target data is located based on the target data source identification, registration information corresponding to at least two data sources is stored in the proxy query server, and the registration information is used for realizing conversion between the language format of the data sources and the universal language format;
and the acquisition module is used for acquiring the target data from the target data source based on the query keyword and the registration information.
9. A computer device comprising a processor and a memory, wherein at least one program is stored in the memory, and wherein the at least one program is loaded and executed by the processor to implement the data query method of any one of claims 1 to 7.
10. A computer-readable storage medium, wherein at least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the data query method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210553809.1A CN114896279A (en) | 2022-05-20 | 2022-05-20 | Data query method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210553809.1A CN114896279A (en) | 2022-05-20 | 2022-05-20 | Data query method, device, equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114896279A true CN114896279A (en) | 2022-08-12 |
Family
ID=82723627
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210553809.1A Pending CN114896279A (en) | 2022-05-20 | 2022-05-20 | Data query method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114896279A (en) |
-
2022
- 2022-05-20 CN CN202210553809.1A patent/CN114896279A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8504556B1 (en) | System and method for diminishing workload imbalance across multiple database systems | |
US11775501B2 (en) | Trace and span sampling and analysis for instrumented software | |
US11755531B1 (en) | System and method for storage of data utilizing a persistent queue | |
US11494395B2 (en) | Creating dashboards for viewing data in a data storage system based on natural language requests | |
US20140365827A1 (en) | Architecture for end-to-end testing of long-running, multi-stage asynchronous data processing services | |
US10901811B2 (en) | Creating alerts associated with a data storage system based on natural language requests | |
CN108363741B (en) | Big data unified interface method, device, equipment and storage medium | |
US11301475B1 (en) | Transmission handling of analytics query response | |
CN108460068B (en) | Method, device, storage medium and terminal for importing and exporting report | |
US9514184B2 (en) | Systems and methods for a high speed query infrastructure | |
CN113485781A (en) | Report generation method and device, electronic equipment and computer readable medium | |
US10585678B2 (en) | Insertion of custom activities in an orchestrated application suite | |
CN109684093A (en) | Data processing method and system | |
CN112860777A (en) | Data processing method, device and equipment | |
CN116701330A (en) | Logistics information sharing method, device, equipment and storage medium | |
CN113010494A (en) | Database auditing method and device and database proxy server | |
CN113760845A (en) | Log processing method, system, device, client and storage medium | |
US9773034B1 (en) | Large-scale log index | |
CN110555178B (en) | Data proxy method and device | |
CN110309206B (en) | Order information acquisition method and system | |
JP2016024486A (en) | Data utilization system and control method therefor | |
CN112162951A (en) | Information retrieval method, server and storage medium | |
CN111488386A (en) | Data query method and device | |
CN114896279A (en) | Data query method, device, equipment and readable storage medium | |
CN115293685A (en) | Logistics order state tracking method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |