Data query method, query system, device, storage medium and program product
By building the query surface and extracting data from multiple data sources, the problems of complexity and high development cost of multi-data source management on the application server side are solved, and the data source coupling degree is reduced and query efficiency is improved.
Patent Information
- Application Number
- CN202110707374.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-24
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-06-24
AI Technical Summary
When managing multiple data sources on the application server side, the program architecture is complex, the development cost is high, and the server side has a high degree of coupling to the data source, which cannot meet the usage needs.
By obtaining data query requests, a query appearance is constructed based on the target data source identification, and using keyword information to extract and process each target data source to generate a target query appearance, realizing unified data query for multiple data sources.
It reduces development costs and reduces the coupling between the server side and the data source, making multi-data source management more simplified and efficient.
Smart Images

Figure CN113434572B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of finance and big data technology, and more specifically, to a data query method, device, equipment, medium and program product. Background Art
[0002] When multiple application servers are connected to multiple heterogeneous data sources, multiple data source management is usually performed on the application server side, which requires the implementation of connection pools, routing logic for different data sources, and switching logic on the application server side.
[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: the program architecture on the application server side is complex and the development cost is high; the server side is highly coupled with the data source and cannot meet the usage requirements. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a data query method, apparatus, device, medium and program product.
[0005] According to a first aspect of the present disclosure, a data query method is provided, comprising:
[0006] Obtaining a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source;
[0007] According to the target data source identifier, construct a query outer table corresponding to each target data source respectively, wherein the query outer table includes a plurality of query condition field boxes;
[0008] Extracting data from each of the target data sources according to the keyword information to obtain target data corresponding to each of the target data sources;
[0009] Filling the target data into each query table corresponding to the target data source, respectively, to obtain multiple target query tables;
[0010] Each of the target query external tables is processed and query results are output.
[0011] According to an embodiment of the present disclosure, the data query method further includes:
[0012] Obtaining a data query operation, wherein the data query operation includes a data source identifier selection operation and a keyword entry operation;
[0013] In response to the data query operation, the data query request is generated.
[0014] According to an embodiment of the present disclosure, in response to the data query operation, generating the data query request includes:
[0015] Acquire status information of a target data source associated with the data source identifier selection operation;
[0016] When the state information indicates that the target data source is in an idle state, the data query request is generated.
[0017] According to an embodiment of the present disclosure, constructing a query outer table corresponding to each target data source according to the target data source identifier includes:
[0018] Obtaining the query condition field box selection operation for each of the target data sources;
[0019] In response to the query condition field box selection operation, respectively determining a plurality of the query condition field boxes associated with each of the target data sources;
[0020] According to each of the query condition field boxes, the query outer table corresponding to each of the target data sources is constructed.
[0021] According to an embodiment of the present disclosure, extracting data from each target data source according to the keyword information to obtain target data corresponding to each target data source includes:
[0022] Acquire the data original table location information corresponding to each of the target data sources;
[0023] According to the keyword information and the location information, data is extracted from each of the original data tables by a data extractor to obtain target data corresponding to each of the target data sources, wherein each of the target data sources corresponds to a data extractor.
[0024] According to an embodiment of the present disclosure, the data query method further includes:
[0025] Obtaining an extractor construction operation for each of the target data sources;
[0026] In response to the building operation, a plurality of the data extractors are generated.
[0027] According to an embodiment of the present disclosure, the step of filling the target data into each query outer table corresponding to the target data source to obtain multiple target query outer tables includes:
[0028] Processing the target data to obtain field data corresponding to each query condition field box;
[0029] Fill the field data into the query condition field box to generate the target query outer table.
[0030] According to an embodiment of the present disclosure, the data query method further includes:
[0031] In response to the data query request, generating an estimated waiting time; and
[0032] The estimated waiting time is output to indicate the time consumed for outputting the query result.
[0033] According to an embodiment of the present disclosure, the data query method further includes:
[0034] When the estimated waiting time is greater than a first preset threshold, the data query request is rejected.
[0035] A second aspect of the present disclosure provides a data query device, comprising:
[0036] A first acquisition module is used to acquire a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source;
[0037] A construction module, used to construct a query outer table corresponding to each target data source according to the target data source identifier, wherein the query outer table includes a plurality of query condition field boxes;
[0038] An extraction module, used to extract data from each of the target data sources according to the keyword information to obtain target data corresponding to each of the target data sources;
[0039] A filling module, used to fill the target data into each query table corresponding to the target data source, to obtain multiple target query tables;
[0040] The output module is used to process each of the target query tables and output query results.
[0041] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned data query method.
[0042] The fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned data query method.
[0043] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned data query method when executed by a processor.
[0044] According to the embodiments of the present disclosure, a query table corresponding to each target data source is constructed through the target data source identification, data is extracted for each target data source according to the keyword information, the extracted data is filled into the query table corresponding to each target data source, a target query table is generated, and each target query table is processed to obtain the final query data. Since the query data is obtained based on the query table, data queries can be performed on multiple data sources at the same time through the data table, and the development cost is low. The problems of multiple data source management on the application server side, high development cost, and high coupling between the server side and the data source in the related technology are solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0046] Figure 1 The application scenario diagram of the data query method according to the embodiment of the present disclosure is schematically shown.
[0047] Figure 2 The flowchart of the data query method according to the embodiment of the present disclosure is schematically shown.
[0048] Figure 3 A schematic diagram of a data query method according to an embodiment of the present disclosure is schematically shown.
[0049] Figure 4 The structural block diagram of the data query device according to the embodiment of the present disclosure is schematically shown.
[0050] Figure 5 A block diagram of an electronic device suitable for implementing a data query method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0051] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0052] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0053] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0054] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0055] When multiple application servers are connected to multiple heterogeneous data sources, multiple data source management is usually performed on the application server side, which requires the implementation of connection pools, routing logic for different data sources, and switching logic on the application server side.
[0056] For example, when querying information related to a certain file, you need to query different databases and data tables. At this time, you need to implement a connection pool, logic for different data sources, switching logic, etc. on the server side.
[0057] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related technology: the program architecture on the application server side is complex and the development cost is high; the server side is highly coupled with the data source and cannot meet the usage requirements.
[0058] An embodiment of the present disclosure provides a data query method, including obtaining a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source; constructing a query table corresponding to each target data source according to the target data source identifier, wherein the query table includes a plurality of query condition field boxes; extracting data from each target data source according to the keyword information to obtain target data corresponding to each target data source; filling the target data into each query table corresponding to the target data source to obtain a plurality of target query tables; processing each target query table and outputting a query result.
[0059] It should be noted that the data query method, apparatus, equipment, medium and program product of the embodiments of the present disclosure can be used in the financial field and the big data technology field, and can also be used in other technical fields besides the financial field and the big data technology field. The present disclosure does not limit the application field of the data query method, apparatus, equipment, medium and program product.
[0060] Figure 1 The application scenario diagram of the data query method according to the embodiment of the present disclosure is schematically shown.
[0061] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a network, a terminal device and a server. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0062] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0063] The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0064] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0065] It should be noted that the data query method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data query device provided in the embodiment of the present disclosure can generally be set in the server 105. The data query method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the data query device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0066] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0067] The following will be based on Figure 1 The scene described by Figure 2 to Figure 4 The data query method of the disclosed embodiment is described in detail.
[0068] Figure 2 The flowchart of the data query method according to the embodiment of the present disclosure is schematically shown.
[0069] like Figure 2 As shown, the data query method of this embodiment includes operations S201 to S205, and the data query method can be executed by a terminal device or a server.
[0070] In operation S201, a data query request is obtained, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source.
[0071] According to an embodiment of the present disclosure, the data source identifier may include, for example, a string identifier, a picture identifier, or a color identifier, etc. The keyword information may include, for example, a keyword or key words input by a user, etc.
[0072] According to an embodiment of the present disclosure, the data source includes a data lake, an Oracle data source, a CSV (character separated value) data source, and an unstructured data source. Unstructured data sources may refer to, for example, audio data, video data, and the like. The data source identifier of the data lake may be, for example, a "data lake" text identifier, a picture identifier with the word "data lake", or a red identifier. The data source identifier of an Oracle data source may be, for example, a "Oracle" text identifier, a picture identifier with the word "Oracle", or a yellow identifier. The data source identifier of a CSV data source may be, for example, a "CSV" text identifier, a picture identifier with the word "CSV", or a green identifier. It should be noted that the above embodiments are only illustrative embodiments, and the present disclosure does not limit the form of the data source identifier.
[0073] In operation S202, according to the target data source identifier, a query outer table corresponding to each target data source is constructed respectively, wherein the query outer table includes a plurality of query condition field boxes.
[0074] According to an embodiment of the present disclosure, the query external table may be constructed by, for example, a data warehouse tool, etc. The data warehouse tool may include, for example, a hive data warehouse tool, etc.
[0075] According to an embodiment of the present disclosure, the query condition field box may include, for example, order primary key, order date, customer number, order status, summary price, etc.
[0076] In operation S203, data is extracted from each target data source according to the keyword information to obtain target data corresponding to each target data source.
[0077] According to an embodiment of the present disclosure, a method of extracting data from a target data source may include, for example, extracting data through an extractor. The extractor may, for example, refer to a data extraction tool written for a certain data source.
[0078] In operation S204, the target data is filled into each query outer table corresponding to the target data source, to obtain a plurality of target query outer tables.
[0079] In operation S205, each target query external table is processed and a query result is output.
[0080] According to an embodiment of the present disclosure, the query result can be queried asynchronously, for example, and after the query task is completed, for example, a query completion mark can be displayed on the query page. The query result can be downloaded locally by clicking a download button or the like.
[0081] According to an embodiment of the present disclosure, the target query table may be processed by, for example, merging. Since the format of the query table obtained by each data source is unified, the contents of each query table may be merged and the merged contents may be output as the query result.
[0082] According to the embodiment of the present disclosure, since the data is queried by querying the external table statistics, a Record instance with a unified format, i.e., a record, can be output. Data sources in various forms can be processed into Record instance records that can be uniformly read by the system.
[0083] According to the embodiments of the present disclosure, a query table corresponding to each target data source is constructed through the target data source identification, data is extracted for each target data source according to the keyword information, the extracted data is filled into the query table corresponding to each target data source, a target query table is generated, and each target query table is processed to obtain the final query data. Since the query data is obtained based on the query table, data queries can be performed on multiple data sources at the same time through the data table, and the development cost is low. The problems of multiple data source management on the application server side, high development cost, and high coupling between the server side and the data source in the related technology are solved.
[0084] According to an embodiment of the present disclosure, the data query method further includes:
[0085] A data query operation is obtained, wherein the data query operation includes a data source identification selection operation and a keyword entry operation; and a data query request is generated in response to the data query operation.
[0086] According to an embodiment of the present disclosure, a data query operation may be performed on a carrier, for example, and the query operation may include clicking or sliding. The carrier may include an electronic device, the electronic device may include a terminal device, and the terminal device may include a smart phone, a tablet computer, a portable computer, or a desktop computer.
[0087] According to an embodiment of the present disclosure, the data source identifier may include multiple data source identifiers, and one or more data source identifiers may be selected from the multiple data source identifiers through a data source identifier selection operation. According to the content to be queried, keywords of the above content may be entered through a keyword entry operation, and the number of keywords may include one or more, and the keyword data may include any number according to specific implementation requirements.
[0088] According to an embodiment of the present disclosure, for example, a timeout threshold may be preset, and when querying a query application during service submission, if no operation is performed within the threshold time, it is determined that the query application has timed out.
[0089] For example, taking the timeout threshold as two minutes, if no mouse click and keyboard events are detected during the application submission phase, it is determined that the query application has timed out and the query task is stopped.
[0090] According to the embodiments of the present disclosure, it is possible to prevent invalid applications from occupying system resources.
[0091] According to an embodiment of the present disclosure, in response to a data query operation, generating a data query request includes:
[0092] The state information of the target data source associated with the data source identification selection operation is obtained; when the state information indicates that the target data source is in an idle state, a data query request is generated.
[0093] According to an embodiment of the present disclosure, the state information may include, for example, idle, busy, and disabled. The idle state may, for example, mean that the current target data source is available for query. The busy state may, for example, mean that the current target data source is in the query state and cannot be used for another query task. The disabled state may, for example, mean that the current target data source is unavailable.
[0094] According to an embodiment of the present disclosure, when the current target data source is found to be in a busy state, for example, the remaining time of the current query task can be displayed to remind the user that a new query task can be started after the current query task is completed. When the current target data source is found to be in a disabled state, for example, the end time of the disablement can be displayed to remind the user that the query task can be started after the disablement ends.
[0095] According to the embodiments of the present disclosure, the atomicity of the query task can be guaranteed through stateful concurrency. When a target data source is in a busy state, the table is locked to control the access of the big data query to the target data source within a unit time.
[0096] According to an embodiment of the present disclosure, constructing a query outer table corresponding to each target data source according to the target data source identifier includes:
[0097] Obtain a query condition field box selection operation for each target data source; in response to the query condition field box selection operation, determine a plurality of query condition field boxes associated with each target data source; and construct a query outer table corresponding to each target data source according to each query condition field box.
[0098] According to an embodiment of the present disclosure, before constructing a query table for each target data source, the query condition field of the query table needs to be determined. For example, the query condition field box of the query table can be determined by obtaining a user's query condition field box selection operation for the target data source.
[0099] According to an embodiment of the present disclosure, the target data source is a data lake and a CSV data source as an example. The query condition field box of the query table corresponding to the data lake may include, for example, the order primary key, order date, customer number, order status, summary price, etc. The query condition field box of the query table corresponding to the CSV data source may include, for example, the item number, location longitude, location latitude, record time and orientation keywords, etc. It should be noted that the above embodiments are only illustrative embodiments, and the embodiments of the present disclosure do not limit the query condition field box of the query table.
[0100] According to an embodiment of the present disclosure, data is extracted from each target data source according to keyword information, and target data corresponding to each target data source is obtained, including:
[0101] The data original table location information corresponding to each target data source is obtained; according to the keyword information and the location information, data is extracted from each data original table by a data extractor to obtain the target data corresponding to each target data source, wherein each target data source corresponds to a data extractor.
[0102] According to an embodiment of the present disclosure, the data source location information may refer to, for example, URL (Uniform Resource Locator) information. The storage location of the target data source may be determined through the data source location information.
[0103] According to an embodiment of the present disclosure, each target data source may correspond to, for example, one data extractor or multiple data extractors.
[0104] According to an embodiment of the present disclosure, the data query method further includes:
[0105] Obtain an extractor build operation for each target data source; and generate multiple data extractors in response to the build operation.
[0106] According to an embodiment of the present disclosure, the target data source may include, for example, a data lake, a CSV data source, and an unstructured data source. The extractor of the data lake may be, for example, a BDPStorageHandler written in Java. The extractor of the CSV data source may be, for example, a CsvHandler written for the CSV data source. The extractor of the unstructured data source may be, for example, an OdpsStorageHandler, a SpeechHandler, etc. written in Java.
[0107] According to an embodiment of the present disclosure, the target data is respectively filled into each query table corresponding to the target data source, and multiple target query tables are obtained, including:
[0108] The target data is processed to obtain field data corresponding to each query condition field box; the field data is filled into the query condition field box to generate a target query outer table.
[0109] According to an embodiment of the present disclosure, the data query method further includes:
[0110] In response to a data query request, an estimated waiting time is generated; the estimated waiting time is output to indicate the time consumed for outputting the query result.
[0111] According to the embodiments of the present disclosure, due to the large amount of data, the query task may take a long time to complete. Therefore, by feeding back the estimated waiting time, the user can be reminded of the estimated completion time of the current query task.
[0112] According to an embodiment of the present disclosure, after starting a query task, the data volume of each data source is estimated, and the query time of the current query task is estimated based on the total data volume, and an estimated waiting time is generated to remind the user.
[0113] According to an embodiment of the present disclosure, the data query method further includes:
[0114] When the estimated waiting time is greater than the first preset threshold, the data query request is rejected.
[0115] According to an embodiment of the present disclosure, the first preset threshold may include, for example, a time threshold. To avoid excessive use of system resources, the first preset threshold may be set to, for example, 12 hours, 18 hours, or 24 hours.
[0116] According to an embodiment of the present disclosure, if a query task is rejected, the query can be repeated by adding screening conditions to reduce the query time, for example, by adding keywords.
[0117] Figure 3 A schematic diagram of a data query method according to an embodiment of the present disclosure is schematically shown.
[0118] like Figure 3 As shown, the method includes a user end 301 , an SDK (Software Development Kit) 302 , and data sources 303 , 304 , 305 .
[0119] The user can initiate a query request through the client 301 and establish a query outer table in the SDK 302. The target data corresponding to the query request is extracted from each data source 303, 304, 305 through the extractor corresponding to each data source 303, 304, 305. The target data is filled into the query outer table, and after processing the query outer table, the target data in the same data format is obtained.
[0120] Figure 4 The structural block diagram of the data query device according to the embodiment of the present disclosure is schematically shown.
[0121] like Figure 4 As shown, the data query device 400 of this embodiment includes a first acquisition module 401 , a construction module 402 , an extraction module 403 , a filling module 404 and an output module 405 .
[0122] The first acquisition module 401 is used to acquire a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source. In one embodiment, the first acquisition module 401 can be used to perform the operation S201 described above, which will not be repeated here.
[0123] The construction module 402 is used to construct a query outer table corresponding to each target data source according to the target data source identifier, wherein the query outer table includes multiple query condition field boxes. In one embodiment, the construction module 402 can be used to perform the operation S202 described above, which will not be repeated here.
[0124] The extraction module 403 is used to extract data from each target data source according to the keyword information to obtain target data corresponding to each target data source. In one embodiment, the extraction module 403 can be used to perform the operation S203 described above, which will not be described in detail here.
[0125] The filling module 404 is used to fill the target data into each query table corresponding to the target data source to obtain multiple target query tables. In one embodiment, the filling module 404 can be used to perform the operation S204 described above, which will not be repeated here.
[0126] The output module 405 is used to process each target query external table and output the query result. In one embodiment, the output module 405 can be used to perform the operation S205 described above, which will not be described in detail here.
[0127] According to the embodiments of the present disclosure, a query table corresponding to each target data source is constructed through the target data source identification, data is extracted for each target data source according to the keyword information, the extracted data is filled into the query table corresponding to each target data source, a target query table is generated, and each target query table is processed to obtain the final query data. Since the query data is obtained based on the query table, data queries can be performed on multiple data sources at the same time through the data table, and the development cost is low. The problems of multiple data source management on the application server side, high development cost, and high coupling between the server side and the data source in the related technology are solved.
[0128] According to an embodiment of the present disclosure, the data query device 400 further includes a second acquisition module and a first generation module.
[0129] The second acquisition module is used to acquire a data query operation, wherein the data query operation includes a data source identifier selection operation and a keyword input operation.
[0130] The first generating module is used to generate the data query request in response to the data query operation.
[0131] According to an embodiment of the present disclosure, the first generating module includes a first acquiring unit and a generating unit.
[0132] The first acquisition unit is used to acquire the state information of the target data source associated with the data source identifier selection operation.
[0133] A generating unit is used to generate the data query request when the status information indicates that the target data source is in an idle state.
[0134] According to an embodiment of the present disclosure, the construction module 402 includes a second acquisition unit, a determination unit, and a construction unit.
[0135] The second acquisition unit is used to acquire the query condition field box selection operation for each of the target data sources.
[0136] A determining unit is used to respectively determine a plurality of query condition field boxes associated with each of the target data sources in response to the query condition field box selection operation.
[0137] A construction unit is used to construct the query outer table corresponding to each of the target data sources according to each of the query condition field boxes.
[0138] According to an embodiment of the present disclosure, the extraction module 403 includes a third acquisition unit and an extraction unit.
[0139] The third acquisition unit is used to acquire the data original table location information corresponding to each of the target data sources.
[0140] The extraction unit is used to extract data from each of the original data tables through a data extractor according to the keyword information and the location information to obtain target data corresponding to each of the target data sources, wherein each of the target data sources corresponds to a data extractor.
[0141] According to an embodiment of the present disclosure, the data query device 400 further includes a third acquisition module and a second generation module.
[0142] The third acquisition module is used to acquire the extractor construction operation for each of the target data sources.
[0143] The second generating module is used to generate a plurality of the data extractors in response to the building operation.
[0144] According to an embodiment of the present disclosure, the filling module 404 includes a processing unit and a filling unit.
[0145] The processing unit is used to process the target data to obtain field data corresponding to each query condition field box.
[0146] A filling unit is used to fill the field data into the query condition field box to generate the target query external table.
[0147] According to an embodiment of the present disclosure, the data query device 400 further includes a third generating module and a prompting module.
[0148] The third generating module is used to generate an estimated waiting time in response to the data query request.
[0149] The prompt module is used to output the estimated waiting time so as to prompt the time consumed for outputting the query result.
[0150] According to an embodiment of the present disclosure, the data query device 400 further includes a rejection module.
[0151] The rejection module is used to reject the data query request when the estimated waiting time is greater than a first preset threshold.
[0152] According to an embodiment of the present disclosure, any multiple modules in the first acquisition module 401, the construction module 402, the extraction module 403, the filling module 404 and the output module 405 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 401, the construction module 402, the extraction module 403, the filling module 404 and the output module 405 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the first acquisition module 401, the construction module 402, the extraction module 403, the filling module 404 and the output module 405 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be performed.
[0153] Figure 5 A block diagram of an electronic device suitable for implementing a data query method according to an embodiment of the present disclosure is schematically shown.
[0154] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0155] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0156] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0157] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0158] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0159] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.
[0160] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0161] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0162] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0163] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0164] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0166] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data query method, comprising: Obtaining a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source; According to the target data source identifier, respectively constructing a query outer table corresponding to each target data source, wherein the query outer table includes a plurality of query condition field boxes, including: obtaining the query condition field box selection operation for each target data source; in response to the query condition field box selection operation, respectively determining a plurality of query condition field boxes associated with each target data source; and constructing the query outer table corresponding to each target data source according to each query condition field box; Obtaining an extractor construction operation for each of the target data sources; In response to the building operation, generating a plurality of data extractors; Extracting data from each of the target data sources according to the keyword information to obtain target data corresponding to each of the target data sources, including: acquiring location information of the original data table corresponding to each of the target data sources; extracting data from each of the original data tables according to the keyword information and the location information by the data extractor to obtain target data corresponding to each of the target data sources, wherein each of the target data sources corresponds to one data extractor; Filling the target data into each query table corresponding to the target data source to obtain multiple target query tables, including: processing the target data to obtain field data corresponding to each query condition field box; filling the field data into the query condition field box to generate the target query table; Each of the target query external tables is processed to output query results, wherein the output query results include a unified record instance.
2. The method according to claim 1, further comprising: Obtaining a data query operation, wherein the data query operation includes a data source identifier selection operation and a keyword entry operation; In response to the data query operation, the data query request is generated.
3. The method according to claim 2, wherein: In response to the data query operation, generating the data query request includes: Acquire status information of a target data source associated with the data source identifier selection operation; When the state information indicates that the target data source is in an idle state, the data query request is generated.
4. The method according to claim 1, further comprising: In response to the data query request, generating an estimated waiting time; as well as The estimated waiting time is output to indicate the time consumed for outputting the query result.
5. The method according to claim 4, further comprising: When the estimated waiting time is greater than a first preset threshold, the data query request is rejected.
6. A data query device, comprising: A first acquisition module is used to acquire a data query request, wherein the data query request includes at least one target data source identifier and keyword information, and each target data source identifier corresponds to a target data source; A construction module is used to construct a query outer table corresponding to each target data source according to the target data source identifier, wherein the query outer table includes a plurality of query condition field boxes, and the construction module includes: a second acquisition unit, used to acquire the query condition field box selection operation for each target data source; a determination unit, used to determine the plurality of query condition field boxes associated with each target data source in response to the query condition field box selection operation; a construction unit, used to construct the query outer table corresponding to each target data source according to each query condition field box; A third acquisition module, used to acquire an extractor construction operation for each of the target data sources; A second generating module, configured to generate a plurality of data extractors in response to the building operation; An extraction module is used to extract data from each of the target data sources according to the keyword information to obtain target data corresponding to each of the target data sources. The extraction module includes: a third acquisition unit, used to obtain the data original table location information corresponding to each of the target data sources; an extraction unit, used to extract data from each of the data original tables through the data extractor according to the keyword information and the location information to obtain the target data corresponding to each of the target data sources, wherein each of the target data sources corresponds to one data extractor; A filling module, used to fill the target data into each query table corresponding to the target data source, to obtain multiple target query tables, including: a processing unit, used to process the target data, to obtain field data corresponding to each query condition field box; a filling unit, used to fill the field data into the query condition field box, to generate the target query table; The output module is used to process each of the target query external tables and output query results, wherein the output query results include unified record instances.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data query method and device, electronic equipment and computer readable medium
CN112966004A