Data query method, server and terminal equipment
Through the conditional conversion rule information of the cross-origin search engine, the query conditions are automatically converted into query statements that support cross-origin queries, which solves the problem of inefficiency in query caused by users' need to manually write query statements, and achieves more efficient data queries.
Patent Information
- Application Number
- CN202510221465.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, users need to manually write database query statements, resulting in inefficient query.
Through the conditional conversion rule information of the cross-origin search engine, the query conditions are automatically converted into query statements that support cross-origin queries, and multiple data sources are queryed through the server.
The user does not need to have the ability to write query statements, which improves the efficiency of query statement acquisition and data query efficiency.
Smart Images

Figure CN120216549A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of servers, and particularly to a data query method, a server, and a terminal device. Background Art
[0002] With the development of big data, there are more and more data storage solutions. Correspondingly, there are more and more data sources (database servers) running databases, and users need to master more and more database knowledge.
[0003] In related technologies, during the data query process, users need to manually write query statements corresponding to the databases in the data sources based on the database knowledge they master, and perform query processing on the data sources running the databases based on the query statements manually written by the users to obtain the target data.
[0004] However, the methods in related technologies require users to manually write query statements corresponding to the databases in the data sources based on the mastered database knowledge, resulting in low query efficiency in the methods of related technologies. Summary of the Invention
[0005] Embodiments of this application provide a data query method, a server, and a terminal device, which improve the query efficiency.
[0006] In a first aspect, an embodiment of this application provides a data query method applied to a server. The method includes:
[0007] Obtain a query condition;
[0008] Based on the condition conversion rule information corresponding to the cross-source retrieval engine, perform conversion processing on the query condition to obtain a query statement, where the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine;
[0009] According to the query statement, perform query processing on multiple data sources through the cross-source retrieval engine to obtain the target data.
[0010] In this solution, the server can obtain the query condition, and perform conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, where the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine. The server can perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain the target data. In this way, without the user having the ability to write query statements, the server can directly perform conversion processing on the query condition sent by the terminal device based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement that supports cross-source query of multiple data sources through the cross-source retrieval engine, improving the acquisition efficiency of the query statement and thus improving the data query efficiency.
[0011] In one implementation, based on the conditional conversion rule information corresponding to the cross-source retrieval engine, the query condition is converted to obtain a query statement, including:
[0012] Convert the format of the query condition to an executable statement format to obtain the converted query condition; wherein, the initial operator corresponding to the field identifier in the converted query condition matches the logical relationship information corresponding to the field identifier in the query condition.
[0013] According to the initial operator corresponding to the field identifier in the converted query condition and the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information, determine the target operator corresponding to the field identifier.
[0014] Convert the initial operator corresponding to each field identifier in the converted query condition to the target operator corresponding to each field identifier to obtain a query statement.
[0015] In this solution, the server can convert the format of the query condition to an executable statement format to obtain the converted query condition; wherein, the initial operator corresponding to the field identifier in the converted query condition matches the logical relationship information corresponding to the field identifier in the query condition. The server can determine the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier in the converted query condition and the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information. The server can convert the initial operator corresponding to each field identifier in the converted query condition to the target operator corresponding to each field identifier to obtain a query statement. Through the above method, the query condition can be quickly and accurately converted into a query statement that supports cross-source query of multiple data sources through the cross-source retrieval engine, thereby improving the query efficiency and further improving the user's query experience.
[0016] In one implementation, determining the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier in the converted query condition and the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information includes:
[0017] Obtain the field type corresponding to each field identifier;
[0018] According to the initial operator corresponding to the field identifier, the field type corresponding to the field identifier, and the corresponding relationship between the initial operator, the field type and the target operator indicated by the query condition conversion rule information, determine the target operator corresponding to the field identifier.
[0019] In this solution, the server can query the correspondence between the initial operator corresponding to the field identifier, the field type corresponding to the field identifier, and the target operator indicated by the query condition conversion rule information, and determine the target operator corresponding to the field identifier. By incorporating the field type into the process of determining the target operator corresponding to the field identifier in the above manner, the accuracy of determining the target operator is improved, thereby improving the efficiency of obtaining the query statement.
[0020] In a second aspect, an embodiment of the present application provides a data query method applied to a terminal device. The method includes:
[0021] Display a visual interface; the visual interface includes a setting control.
[0022] In response to a user's operation on the setting control, obtain a query condition.
[0023] Send the query condition to the server, so that the server performs conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data. The query statement supports cross-source query of multiple data sources through the cross-source retrieval engine.
[0024] In this solution, the terminal device can display a visual interface; the visual interface includes a setting control. The terminal device can, in response to a user's operation on the setting control, obtain a query condition and send the query condition to the server, so that the server performs conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data. The query statement supports cross-source query of multiple data sources through the cross-source retrieval engine. By the above method, there is no need for the user to have the ability to write query statements. By providing a visual interface for visual editing through the terminal device, the user only needs to operate on the visual interface, and the terminal device can obtain the query condition. Based on the condition conversion rule information corresponding to the cross-source retrieval engine, the server can automatically perform conversion processing on the obtained query condition to obtain a query statement, improving the efficiency of obtaining the query statement, and thereby improving the data query efficiency.
[0025] In one implementation, displaying the visual interface includes:
[0026] Obtain a query method.
[0027] Display the visualization interface corresponding to the query method; among them, when the query method is the combined query method, the setting control includes a query rule setting control; when the query method is the join query method, the setting control includes a query rule setting control and an association rule setting control; the query rule setting control is used to set query rule information; the association rule setting control is used to set the association relationship between each query rule information.
[0028] In this solution, different query methods correspond to different visualization interfaces. The terminal device can obtain the query method and display the visualization interface corresponding to the query method. When the query method is the combined query method, the setting control includes a query rule setting control; when the query method is the join query method, the setting control includes a query rule setting control and an association rule setting control; the query rule setting control is used to set query rule information; the association rule setting control is used to set the association relationship between each query rule information. Through the above method, the query method of the present application can support the combined query method and the join query method of multiple data sources.
[0029] In one implementation, the query rule setting control includes a data table setting control and a field information setting control; in response to the user's operation on the setting control, obtaining a query condition includes:
[0030] In response to the user's operation on the data table setting control, determine the identifier of at least one target data table from the identifiers of multiple data tables;
[0031] In response to the user's operation on the field information setting control, determine the field information; where the field information includes a field identifier, and the logical relationship information and / or value range corresponding to the field identifier, and the field identifier belongs to at least one target data table;
[0032] Determine that the query rule information in the query condition includes the field information.
[0033] In this solution, the terminal device can determine the identifier of at least one target data table from the identifiers of multiple data tables in response to the user's operation on the data table setting control. The terminal device can determine the field information in response to the user's operation on the field information setting control; where the field information includes a field identifier, and the logical relationship information and / or value range corresponding to the field identifier, and the field identifier belongs to at least one target data table. The terminal device can determine that the query rule information in the query condition includes the field information. Through the above method, without the user having the ability to write query conditions, based on the operation on the data table setting control and the operation on the field information setting control, the terminal device can obtain the query rule information in the query condition, improving the acquisition efficiency of the query condition.
[0034] In one implementation, the query rule setting control further includes a field association relationship control corresponding to the field information setting control; in response to a user's operation on the field information setting control, determining the field information includes:
[0035] In response to a user's operation on any first field information setting control, determining the first field information;
[0036] In response to a user's operation on the field association relationship control corresponding to the first field information setting control, determining the field information association relationship, and adding a second field information setting control to the visual interface; wherein, the field information association relationship indicates the association relationship between the first field information and the second field information;
[0037] In response to a user's operation on the second field information setting control, determining the second field information.
[0038] In this solution, the terminal device can determine the first field information in response to a user's operation on any first field information setting control. The terminal device can determine the field information association relationship in response to a user's operation on the field association relationship control corresponding to the first field information setting control, and add a second field information setting control to the visual interface; wherein, the field information association relationship indicates the association relationship between the first field information and the second field information. The terminal device can determine the second field information in response to a user's operation on the second field information setting control. In the above manner, without the user having the ability to write query conditions, based on the operations on the field information setting control and the field association relationship control, the terminal device can obtain the query rule information in the query conditions, improving the efficiency of obtaining query conditions.
[0039] In one implementation, determining the query rule information in the query conditions includes field information, including:
[0040] Determining the query rule information includes the first field information, the second field information, and the field information association relationship.
[0041] In this solution, the terminal device can determine that the query rule information includes the first field information, the second field information, and the field information association relationship. In the above manner, the efficiency of the terminal device in obtaining the query statement is improved.
[0042] In one implementation, when the setting control includes a query rule setting control and an association rule setting control, in response to a user's operation on the setting control, determining the query conditions further includes:
[0043] In response to a user's operation on the association rule setting control, obtain the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier;
[0044] Determine the association relationship between the first query rule information and the second query rule information, including: the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier.
[0045] In this solution, the terminal device can, in response to a user's operation on the association rule setting control, obtain the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier. The terminal device can determine the association relationship between the first query rule information and the second query rule information, including: the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier. In the above manner, without the user having the ability to write query conditions, based on the operations on the query rule setting control and the association rule setting control, the terminal device can obtain the association relationship between the query rule information in the query conditions, improving the efficiency of obtaining query conditions.
[0046] In a third aspect, an embodiment of the present application provides a data query device, which is applied to a server. The data query device includes:
[0047] A transceiver module, configured to obtain query conditions;
[0048] A processing module, configured to perform conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, where the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine;
[0049] The processing module is further configured to perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data.
[0050] The data query device provided by the embodiment of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar and will not be elaborated here.
[0051] In one implementation, the processing module is specifically configured to:
[0052] Convert the format of the query conditions into an executable statement format to obtain the converted query conditions; wherein, the initial operator corresponding to the field identifier in the converted query conditions matches the logical relationship information corresponding to the field identifier in the query conditions;
[0053] According to the initial operator corresponding to the field identifier in the converted query condition and the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information, determine the target operator corresponding to the field identifier;
[0054] Convert the initial operator corresponding to each field identifier in the converted query condition into the target operator corresponding to each field identifier to obtain a query statement.
[0055] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0056] In one implementation, the processing module is specifically configured to:
[0057] Obtain the field type corresponding to each field identifier;
[0058] According to the initial operator corresponding to the field identifier, the field type corresponding to the field identifier, and the corresponding relationship between the initial operator, the field type and the target operator indicated by the query condition conversion rule information, determine the target operator corresponding to the field identifier.
[0059] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0060] In a fourth aspect, the embodiments of the present application provide a data query device applied to a terminal device. The data query device includes:
[0061] A display module for displaying a visual interface; the visual interface includes a setting control;
[0062] An acquisition module for acquiring a query condition in response to a user's operation on the setting control;
[0063] A transceiver module for sending the query condition to a server, so that the server performs conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and performs query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data. The query statement supports cross-source query of multiple data sources through the cross-source retrieval engine.
[0064] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0065] In one implementation, the display module is specifically configured to:
[0066] Obtain a query method;
[0067] Display the visualization interface corresponding to the query method. Among them, when the query method is the combined query method, the setting control includes a query rule setting control; when the query method is the join query method, the setting control includes a query rule setting control and an association rule setting control; the query rule setting control is used to set query rule information; the association rule setting control is used to set the association relationship between each query rule information.
[0068] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described here again.
[0069] In one implementation, the query rule setting control includes a data table setting control and a field information setting control; the obtaining module is specifically used for:
[0070] In response to the user's operation on the data table setting control, determine the identifier of at least one target data table from the identifiers of multiple data tables;
[0071] In response to the user's operation on the field information setting control, determine the field information; among them, the field information includes a field identifier, and the logical relationship information and / or value range corresponding to the field identifier, and the field identifier belongs to at least one target data table;
[0072] Determine that the query rule information in the query condition includes field information.
[0073] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described here again.
[0074] In one implementation, the query rule setting control further includes a field association relationship control corresponding to the field information setting control; the obtaining module is specifically used for:
[0075] In response to the user's operation on any first field information setting control, determine the first field information;
[0076] In response to the user's operation on the field association relationship control corresponding to the first field information setting control, determine the field information association relationship, and add a second field information setting control to the visualization interface; among them, the field information association relationship indicates the association relationship between the first field information and the second field information;
[0077] In response to the user's operation on the second field information setting control, determine the second field information.
[0078] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described here again.
[0079] In one implementation, the obtaining module is specifically configured to:
[0080] Determine that the query rule information includes first field information, second field information, and a field information association relationship.
[0081] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0082] In one implementation, when the setting control includes a query rule setting control and an association rule setting control, the obtaining module is further configured to:
[0083] In response to a user's operation on the association rule setting control, obtain a first field identifier in the first query rule information, a second field identifier in the second query rule information, and an association relationship between the first field identifier and the second field identifier;
[0084] Determining the association relationship between the first query rule information and the second query rule information includes: a first field identifier in the first query rule information, a second field identifier in the second query rule information, and an association relationship between the first field identifier and the second field identifier.
[0085] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0086] Fifthly, an embodiment of the present application provides a server, including:
[0087] A processor, and a memory communicatively connected to the processor;
[0088] The memory is used to store computer execution instructions;
[0089] The processor is configured to execute the computer execution instructions stored in the memory to implement the method of the first aspect.
[0090] The server provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0091] Sixthly, an embodiment of the present application provides a terminal device, including:
[0092] A processor, and a memory communicatively connected to the processor;
[0093] The memory is used to store computer execution instructions;
[0094] The processor is configured to execute the computer execution instructions stored in the memory to implement the method of the second aspect.
[0095] The terminal device provided in the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0096] In a seventh aspect, the embodiments of the present application provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the methods in the first aspect or the second aspect.
[0097] The computer-readable storage medium provided in the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0098] In an eighth aspect, the embodiments of the present application provide a computer program product, including a computer program, and when the computer program is executed by a processor, it is used to implement the methods in the first aspect or the second aspect.
[0099] The computer program product provided in the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following briefly introduces the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0101] Figure 1 It is a schematic diagram of an application scenario provided by the embodiments of the present application;
[0102] Figure 2 It is a schematic flowchart of the first embodiment of a data query method provided by the embodiments of the present application;
[0103] Figure 3 It is a schematic flowchart of the second embodiment of a data query method provided by the embodiments of the present application;
[0104] Figure 4a It is a schematic flowchart of the third embodiment of a data query method provided by the embodiments of the present application;
[0105] Figure 4b It is a schematic diagram of a visualization interface corresponding to a combined query method provided by the embodiments of the present application;
[0106] Figure 4c It is a schematic diagram of a visualization interface corresponding to a connection query method provided by the embodiments of the present application;
[0107] Figure 5 It is a schematic structural diagram of a data query device provided by an embodiment of the present application;
[0108] Figure 6 It is a schematic structural diagram of another data query device provided by an embodiment of the present application;
[0109] Figure 7 It is a schematic structural diagram of a server provided by an embodiment of the present application;
[0110] Figure 8 It is a schematic structural diagram of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0111] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application under the inspiration of this embodiment belong to the scope of protection of the present application.
[0112] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0113] Glossary:
[0114] Cross-database operation: A cross-database operation refers to the process of accessing and operating on data tables stored in different databases in database management.
[0115] Visual editing: Visual editing is an intuitive and easy-to-use editing method. Through a visual interface (graphical interface) and drag-and-drop operations, users can complete complex editing tasks without programming knowledge.
[0116] Efficient: In the context of data processing, "efficient" refers to the ability to complete a specific task with minimal resource consumption (such as time, CPU, memory). An efficient system or algorithm can maintain good performance while processing a large amount of data, reduce latency, and save computing resources. Achieving efficiency usually requires optimizing data structures, query logic, and hardware configurations.
[0117] Multiple data sources: Multiple data sources refer to supporting multiple data sources (database servers) for stream computing. For example, multiple data sources can include hdfs, kafka, pulsar, nifi, Elasticsearch, JDBC, etc.
[0118] An embodiment of the present application provides a data query method. In this method, the server can obtain a query condition and perform conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement. The query statement supports cross-source query of multiple data sources through the cross-source retrieval engine. The server performs query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data. Through the above method, the data query efficiency is improved.
[0119] The data query method of the embodiment of the present application will be described in detail below.
[0120] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application.
[0121] As Figure 1 shown, this application scenario includes a terminal device 101 and a server 102.
[0122] In addition, this application scenario may further include multiple data sources. Exemplarily, this application scenario may include five data sources, namely a first data source 103, a second data source 104, a third data source 105, a fourth data source 106, and a fifth data source 107.
[0123] The terminal device 101 can be communicatively connected to the server 102.
[0124] The server 102 can be communicatively connected to multiple data sources.
[0125] Next, the technical solution of the present application will be described in detail through specific embodiments. It should be noted that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0126] Figure 2 It is a schematic flowchart of the first embodiment of a data query method provided by an embodiment of the present application. Refer to Figure 2 , this method specifically includes the following steps:
[0127] S201: The terminal device displays a visual interface.
[0128] In this embodiment, the terminal device can display a visual interface. The visual interface includes a setting control.
[0129] In one implementation,
[0130] The terminal device can obtain a query method. In one implementation, the query method can be a union query method (UNION). In one implementation, the query method can be a join query method (JOIN).
[0131] The terminal device can display the visual interface corresponding to the query method.
[0132] In one implementation, when the query method is a union query method, the visual interface can be the visual interface corresponding to the union query method. The visual interface corresponding to the union query method can include a query rule setting control. The query rule setting control is used to set query rule information.
[0133] In one implementation, when the query method is a join query method, the visual interface can be the visual interface corresponding to the join query method. The visual interface corresponding to the join query method can include a query rule setting control and an association rule setting control. The query rule setting control is used to set query rule information, and the association rule setting control is used to set the association relationship between the query rule information.
[0134] S202: The terminal device obtains query conditions in response to a user's operation on the setting control.
[0135] In this embodiment, the terminal device can obtain query conditions in response to a user's operation on the setting control.
[0136] In one implementation, the query conditions can include at least one query rule information.
[0137] In one implementation, the query conditions can include multiple query rule information and the association relationship between the query rule information.
[0138] It should be noted that the query rule information is a rule for querying data in the data source, in other words, a rule for filtering data in the data source. For example, the query rule information can be query rule information 1 (dataset 1) = {alarm level = severe or [alarm level = high risk]}. The association relationship between query rule information 1 and query rule information 2 is {dataset 1_data table 1__alarm level = dataset 2_data table 4_alarm level}.
[0139] S203: The server obtains the query conditions.
[0140] In this embodiment, the terminal device may send query conditions to the server. Correspondingly, the server may obtain the query conditions.
[0141] S204: The server performs conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross - source retrieval engine to obtain a query statement.
[0142] In this embodiment, the server may obtain the condition conversion rule information corresponding to the cross - source retrieval engine. In one implementation, the condition rule conversion information indicates the correspondence between the initial operator and the target operator. In one implementation, the condition rule conversion information indicates the correspondence between the initial operator, the field type, and the target operator.
[0143] The server may perform conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross - source retrieval engine to obtain a query statement. It should be noted that the query statement supports cross - source query of multiple data sources through the cross - source retrieval engine.
[0144] In one implementation,
[0145] The server may convert the format of the query conditions into an executable statement format to obtain the converted query conditions. Among them, the initial operator corresponding to the field identifier in the converted query conditions matches the logical relationship information corresponding to the field identifier in the query conditions. For example, the initial operator (between) corresponding to the field identifier (data_rectime) in the converted query conditions matches the logical relationship information (between the two) corresponding to this field identifier in the query conditions.
[0146] The server may determine the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier in the converted query conditions and the correspondence between the initial operator and the target operator indicated by the query condition conversion rule information. In one implementation, the server may obtain the field type corresponding to each field identifier. The server may determine the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier, the field type corresponding to the field identifier, and the correspondence between the initial operator, the field type, and the target operator indicated by the query condition conversion rule information.
[0147] The server may convert the initial operator corresponding to each field identifier in the converted query conditions into the target operator corresponding to each field identifier to obtain a query statement.
[0148] S205: The server performs query processing on multiple data sources through the cross - source retrieval engine according to the query statement to obtain the target data.
[0149] In this embodiment, the server can query and process multiple data sources through a cross-source retrieval engine according to a query statement to obtain target data.
[0150] In one implementation, after obtaining the target data, the server can send the target data to the terminal device.
[0151] In one implementation, the terminal device can perform display processing on the target data.
[0152] Advantageous effects of this embodiment: In this embodiment, the terminal device can display a visual interface, and the visual interface includes a setting control. The terminal device responds to an operation of the user on the setting control, obtains a query condition, and sends the query condition to the server. The server can perform conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement (the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine). The server can query and process multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data. Through the above method, it is not necessary for the user to have the ability to write query statements. By providing a visual interface for visual editing through the terminal device, the user only needs to operate on the visual interface, and the terminal device can obtain the query condition. Based on the condition conversion rule information corresponding to the cross-source retrieval engine, the server can automatically perform conversion processing on the obtained query condition to obtain a query statement, improving the acquisition efficiency of the query statement and thus improving the data query efficiency.
[0153] Figure 3 It is a schematic flowchart of the second embodiment of a data query method provided by an embodiment of the present application. Refer to Figure 3 This method specifically includes the following steps:
[0154] S301: The terminal device displays a visual interface.
[0155] In this embodiment, the terminal device can display a visual interface.
[0156] Among them, the visual interface includes a setting control.
[0157] Its specific implementation process is the same as that of S201 and will not be elaborated here.
[0158] S302: The terminal device responds to an operation of the user on the setting control and obtains a query condition.
[0159] In this embodiment, the terminal device can respond to an operation of the user on the setting control and obtain a query condition.
[0160] Its specific implementation process is the same as that of S203 and will not be elaborated here.
[0161] S303: The server obtains the query conditions.
[0162] In this embodiment, the terminal device may send the query conditions to the server. Correspondingly, the server may obtain the query conditions.
[0163] In one implementation, the query conditions may include at least one query rule information.
[0164] In one implementation, the query conditions may include multiple query rule information and the association relationship between each query rule information.
[0165] S304: The server converts the format of the query conditions into an executable statement format to obtain the converted query conditions.
[0166] In this embodiment, the server may convert the format of the query conditions into an executable statement format to obtain the converted query conditions.
[0167] Among them, the initial operator corresponding to the field identifier in the converted query conditions matches the logical relationship information corresponding to the field identifier in the query conditions.
[0168] Exemplarily, the query rule information in the converted query conditions is as follows:
[0169] "condition":
[0170] {
[0171] "operation": "between",
[0172] "name": "data_rectime"
[0173] "id": 1730966032475,
[0174] "type": ""
[0175] "1evel": 0,
[0176] "value": "2024-11-04 00:00:00, 2024-11-08 23:59:59"
[0177] "logic": "AND"
[0178] }
[0179] "AND"
[0180] {
[0181] ”operation”:”like”,
[0182] ”name”:”data_level”
[0183] ”id”:1730966075352,
[0184] ”type”:””
[0185] ”level”:0,
[0186] ”value”:"一般"
[0187] ”logic”:”AND”
[0188] },
[0189] ”AND”,
[0190] [{
[0191] ”operation”:”is”,
[0192] ”name”:”data_id”
[0193] ”id”:1730966047988,
[0194] ”1evel”:1,
[0195] ”value”:”1231231”
[0196] ”logic”:”OR”
[0197] }
[0198] ”OR”,
[0199] {
[0200] ”operation”:”is”,
[0201] ”name”:”data_type”
[0202] ”id”:1730966055490,
[0203] ”1evel”:1,
[0204] ”value”:”中级”
[0205] ”logic”:”OR”
[0206] }]]
[0207] Exemplarily, the association relationships among the query rule information in the converted query conditions are as follows: "dataRelationRules":
[0209] {
[0210] oid:{}
[0211] "id":1,
[0212] "fieldName":"IP"
[0213] "operation":"is"
[0214] "relationObj"{}
[0215] "relationId":2,
[0216] "relationFieldName":"SIP"
[0217] "1ogic":"AND",
[0218] "1eve":1
[0219] },
[0220] "AND",
[0221] {
[0222] "id":2
[0223] "fieldName":"customer_id"
[0224] "operation":"is"
[0225] "relationId":3,
[0226] "relationFieldName":"customer_id"
[0227] "1ogic":"AND"
[0228] "1evel":1
[0229] }
[0230] ,
[0231] "OR"
[0233] {
[0234] "id":3
[0235] "fieldName": "DIP"
[0236] "operation": "is"
[0237] "relationId": 4,
[0238] "relationFieldName": "IP"
[0239] "logic": "AND",
[0240] "level": 1
[0241] }
[0242] "AND",
[0244] {
[0245] "id": 4
[0246] "fieldName": "URL"
[0247] "operation": "is"
[0248] "relationId": 5,
[0249] "relationFieldName": "HTTP URL"
[0250] "logic": "OR"
[0251] "level": 2
[0252] },
[0253] "OR",
[0254] {
[0255] "id": 5
[0256] "fieldName": "protocol"
[0257] "operation": "is"
[0258] "relationId": 6,
[0259] "relationFieldName": "protocol"
[0260] "logic": "OR"
[0261] "level": 2
[0262] }]
[0263] S305: The server determines the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier in the converted query condition and the correspondence between the initial operator and the target operator indicated by the query condition conversion rule information.
[0264] In this embodiment, the server may obtain the condition conversion rule information corresponding to the cross-source retrieval engine.
[0265] In one implementation, the condition conversion rule information may indicate the correspondence between the initial operator and the target operator.
[0266] In one implementation, the condition conversion rule information may indicate the correspondence between the initial operator, the field type, and the target operator.
[0267] Exemplarily, Table 1 is the condition conversion rule information corresponding to the cross-source retrieval engine.
[0268] Table 1 Condition Conversion Rule Information Corresponding to the Cross-Source Retrieval Engine
[0269]
[0270] The server determines the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier in the converted query condition and the correspondence between the initial operator and the target operator indicated by the query condition conversion rule information.
[0271] In one implementation,
[0272] The server may obtain the field type corresponding to each field identifier.
[0273] The server determines the target operator corresponding to the field identifier according to the initial operator corresponding to the field identifier, the field type corresponding to the field identifier, and the correspondence between the initial operator, the field type, and the target operator indicated by the query condition conversion rule information.
[0274] For example, for the field identifier "data_id", the server may obtain that the field type corresponding to this field identifier is "character". The server can determine the target operator "=" corresponding to the field identifier according to the initial operator (is) corresponding to the field identifier and the field type (character) corresponding to the field identifier, and the correspondence between the initial operator, the field type, and the target operator indicated by the query condition conversion rule information.
[0275] S306: The server converts the initial operators corresponding to each field identifier in the converted query condition into the target operators corresponding to each field identifier, and obtains a query statement.
[0276] In this embodiment, the server can convert the initial operators corresponding to each field identifier in the converted query condition into the target operators corresponding to each field identifier, and obtain a query statement.
[0277] S307: The server performs query processing on multiple data sources through a cross-source retrieval engine according to the query statement, and obtains target data.
[0278] In this embodiment, after obtaining the query statement corresponding to the cross-source retrieval engine, the server can perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement, and obtain target data.
[0279] In one implementation,
[0280] The server can determine multiple data sources from multiple candidate data sources through a cross-source retrieval engine.
[0281] For any data source, the server can generate a sub-query statement corresponding to the data source through the cross-source retrieval engine according to the query statement, and perform query processing on the data source according to the sub-query statement to obtain sub-target data.
[0282] The server can perform integration processing on multiple sub-target data through the cross-source retrieval engine according to the query statement, and obtain target data.
[0283] Advantageous effects of this embodiment: In this embodiment, the terminal device can display a visual interface, and the visual interface includes a setting control. The terminal device responds to the user's operation on the setting control, obtains a query condition, and sends the query condition to the server. The server can convert the format of the query condition into an executable statement format to obtain a converted query condition; wherein, the initial operator corresponding to the field identifier in the converted query condition matches the logical relationship information corresponding to the field identifier in the query condition. The server can determine the target operator corresponding to the field identifier according to the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information for the initial operator corresponding to the field identifier in the converted query condition. The server can convert the initial operators corresponding to each field identifier in the converted query condition into the target operators corresponding to each field identifier, and obtain a query statement. The server can perform query processing on multiple data sources through a cross-source retrieval engine according to the query statement, and obtain target data. Through the above method, it is possible to use a cross-source retrieval engine to implement query processing (cross-database operation) on multiple data sources, improve the query efficiency, achieve efficient query, and further improve the user's query experience.
[0284] Figure 4a This is a schematic flowchart of the third embodiment of a data query method provided by an embodiment of the present application. Refer to Figure 4a , the method specifically includes the following steps:
[0285] S401: The terminal device obtains a query method.
[0286] In this embodiment, the terminal device can obtain the query method input by the user.
[0287] In one implementation, the query method can be a merge query method.
[0288] In one implementation, the query method can be a join query method.
[0289] S402: The terminal device displays a visualization interface corresponding to the query method.
[0290] In this embodiment, the terminal device can display a visualization interface corresponding to the query method. Among them, the visualization interface includes setting controls.
[0291] In one implementation,
[0292] When the query method is a merge query method (UNION), the visualization interface can be a visualization interface corresponding to the merge query method. The setting controls in the visualization interface can include query rule setting controls. Exemplarily, Figure 4b This is a schematic diagram of a visualization interface corresponding to a merge query method provided by an embodiment of the present application.
[0293] In one implementation,
[0294] When the query method is a join query method (JOIN), the visualization interface can be a visualization interface corresponding to the join query method. The setting controls in the visualization interface can include query rule setting controls and association rule setting controls. Exemplarily, Figure 4c This is a schematic diagram of a visualization interface corresponding to a join query method provided by an embodiment of the present application.
[0295] It should be noted that the query rule setting control is used to set query rule information, and the association rule setting control is used to set the association relationship between each query rule information.
[0296] S403: The terminal device obtains query conditions in response to the user's operation on the setting control.
[0297] In this embodiment, the terminal device can obtain query conditions in response to the user's operation on the setting control.
[0298] First, the process by which the terminal device obtains the query rule information in the query condition in response to the user's operation on the setting control is described.
[0299] In one implementation,
[0300] Exemplarily, as Figure 4b and Figure 4c shown, the query rule setting control may include a data table setting control and a field information setting control.
[0301] The terminal device may, in response to the user's operation on the data table setting control, determine the identifier of at least one target data table (such as the name of the target data table) from the identifiers of multiple data tables. In one implementation, the terminal device may, in response to the user's view operation on the data table setting control, display the identifiers of multiple data tables. The terminal device may, in response to the selection operation on the identifier of any data table, determine the identifier of at least one target data table. It should be noted that the multiple data tables may belong to the same data source or different data sources, and the embodiments of the present application do not limit this.
[0302] The terminal device may, in response to the user's operation on the field information setting control, determine the field information. Among them, the field information may include a field identifier (such as a field name), and the logical relationship information and / or value range corresponding to the field identifier. It should be noted that the field identifier belongs to at least one target data table.
[0303] The terminal device may determine that the query rule information in the query condition includes the field information.
[0304] Next, the process by which the terminal device determines the field information in response to the user's operation on the field information setting control, and the process by which the terminal device determines that the query rule information in the query condition includes the field information are described.
[0305] In one implementation,
[0306] Exemplarily, as Figure 4b and Figure 4c shown, the query rule setting control includes a field association relationship control corresponding to the field information setting control (field association relationship control 1 "&" and field association relationship control 2 "||").
[0307] The terminal device may, in response to the user's operation on any first field information setting control, determine the first field information.
[0308] The terminal device can, in response to a user's operation of setting a field association relationship control corresponding to the first field information control, determine the field information association relationship, and add a second field information setting control to the visual interface. The field information association relationship indicates the association relationship between the first field information and the second field information. The association relationship is "and", or "or".
[0309] The terminal device can, in response to a user's operation on the second field information setting control, determine the second field information.
[0310] Accordingly, the terminal device can determine that the query rule information in the query condition includes the first field information, the second field information, and the field information association relationship. The field information association relationship indicates the association relationship between the first field information and the second field information. Exemplarily, the query rule information 1 = {alarm level = severe or [alarm level = high risk]}.
[0311] Next, the process by which the terminal device determines the field information in response to a user's operation on the field information setting control will be described.
[0312] In one implementation, exemplarily, as Figure 4b and Figure 4c shown, the field information setting control can include a field identifier setting control, a logical relationship setting control, and a value range setting control.
[0313] In one implementation, the terminal device can, in response to a user's viewing operation on the field identifier setting control, display multiple candidate field identifiers. The terminal device can, in response to a user's selection operation on any candidate field identifier, determine the field identifier.
[0314] It should be noted that the multiple candidate field identifiers can belong to at least one target data table. In other words, the terminal device can, in response to the identifier of at least one target data table determined by the user, determine the multiple candidate field identifiers included in the at least one target data table, and determine the multiple field identifiers as the content that the user can view and select through the field identifier setting control.
[0315] In one implementation, the terminal device can, in response to a user's viewing operation on the logical relationship setting control, display multiple candidate logical relationship information. The terminal device can, in response to a user's selection operation on any candidate logical relationship, determine the logical relationship information. Exemplarily, the logical relationship information can include any one of the following: equal to, not equal to, contains, does not contain, belongs to, does not belong to, is empty, is not empty, between the two.
[0316] In one implementation, the terminal device can obtain the value range corresponding to the field identifier in response to a user's input operation on the value range setting control. Exemplarily, the value range can be "2024-11-04 00:00:00,2024-11-08 23:59:59".
[0317] Next, the process by which the terminal device determines the field information association relationship in response to a user's operation on the field association relationship control corresponding to the first field information setting control will be described.
[0318] In one implementation
[0319] The field association relationship control corresponding to the first field information setting control includes a field association relationship control 1 (&) and a field association relationship control 2 (||). In one implementation, the visual interface further includes a deletion control corresponding to the first field information setting control.
[0320] In one implementation, the terminal device can determine that the field information association relationship is "AND (and)" in response to a user's operation on the field association relationship control 1.
[0321] In one implementation, the terminal device can determine that the field information association relationship is "OR (or)" in response to a user's operation on the field association relationship control 2.
[0322] In addition, in one implementation, the query rule setting control may further include a setting control for the query rule information identifier (dataset identifier). It should be noted that the terminal device can obtain the query rule information identifier (dataset identifier) in response to a user's input operation on the setting control for the query rule information identifier (dataset identifier).
[0323] In addition, in one implementation, the visual interface further includes an addition control (+) corresponding to the query rule setting control for adding new query rule information.
[0324] In addition, in one implementation, the visual interface may further include a display area for displaying the query rule information obtained by the terminal device.
[0325] Next, the process by which the terminal device obtains the association relationship between the query rule information in the query condition in response to a user's operation on the setting control will be described.
[0326] The visual interface includes a setting control. The setting control includes a query rule setting control and an association rule setting control.
[0327] The terminal device can, in response to a user's operation on the association rule setting control, obtain the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier.
[0328] The terminal device can determine the association relationship between the first query rule information and the second query rule information, including: the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier.
[0329] Next, the process by which the terminal device, in response to a user's operation on the association rule setting control, obtains the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier will be described.
[0330] In one implementation,
[0331] Exemplarily, as Figure 4c shown, the association rule setting control includes a selection control 1 for the query rule information identifier, a field identifier selection control 1, a logical relationship selection control, a selection control 2 for the query rule information identifier, and a field identifier selection control 2. In one implementation, the association rule setting control may further include a data table identifier selection control 1 and a data table identifier selection control 2.
[0332] The terminal device can, in response to a user's view operation on the selection control 1 for the query rule information identifier, display multiple query rule information identifiers. The terminal device can, in response to a user's selection operation on any query rule information identifier, determine the first query rule information.
[0333] The terminal device can, in response to a user's view operation on the field identifier selection control 1, display at least one field identifier. The terminal device can, in response to a user's selection operation on any field identifier, determine the first field identifier. It should be noted that at least one field identifier belongs to the first query rule information.
[0334] The terminal device can, in response to a user's view operation on the logical relationship selection control, display multiple candidate logical relationship information. The terminal device can, in response to a user's selection operation on any candidate logical relationship information, determine a logical relationship information, and use this logical relationship information to determine the association relationship between the first field identifier and the second field identifier. For example, the terminal device can, based on the logical relationship "equals", determine that the association relationship between the first field identifier and the second field identifier is "equals".
[0335] The terminal device can display multiple query rule information identifiers in response to a user's viewing operation on the selection control 2 for the query rule information identifier. The terminal device can determine the second query rule information in response to a user's selection operation on any query rule information identifier.
[0336] The terminal device can display at least one field identifier in response to a user's viewing operation on the selection control 2 for the field identifier. The terminal device can determine the second field identifier in response to a user's selection operation on any field identifier. It should be noted that at least one field identifier belongs to the second query rule information.
[0337] In addition, in one implementation, the terminal device can display the identifiers of at least one target data table in response to a user's viewing operation on the selection control 1 for the data table identifier. The terminal device can determine the identifier of the first data table in response to a user's selection operation on the identifier of any data table. It should be noted that the identifiers of at least one data table are the identifiers of at least one target data table used in the process of obtaining the first query rule information.
[0338] In one implementation, the terminal device can display the identifiers of at least one target data table in response to a user's viewing operation on the selection control 2 for the data table identifier. The terminal device can determine the identifier of the second data table in response to a user's selection operation on the identifier of any data table. It should be noted that the identifiers of at least one data table are the identifiers of at least one target data table used in the process of obtaining the second query rule information.
[0339] In addition, in one implementation
[0340] The setting control may further include association relation controls (& and ||) corresponding to the association rule setting control.
[0341] After the terminal device determines the association relation between the first query rule information and the second query rule information in response to a user's operation on the first association rule setting control, it can determine the association relation between the association relation between the first query rule information and the second query rule information and the association relation between the third query rule information and the fourth query rule information in response to a user's operation on the association relation control corresponding to the first association rule setting control.
[0342] The terminal device can add a second association rule setting control in the visual interface.
[0343] The terminal device can determine the association relation between the third query rule information and the fourth query rule information in response to a user's operation on the second association rule setting control.
[0344] The terminal device can determine that the query conditions may include: the association relationship between the first query rule information and the second query rule information, the association relationship between the third query rule information and the fourth query rule information, and the association relationship between the two.
[0345] S404: The server obtains the query conditions.
[0346] In this embodiment, the server can obtain the query conditions sent by the terminal device.
[0347] The specific implementation process is the same as that of S203 and will not be elaborated here.
[0348] S405: The server performs conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement.
[0349] In this embodiment, the server can perform conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement.
[0350] Among them, the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine.
[0351] The specific implementation process is the same as that of S204 and will not be elaborated here.
[0352] S406: The server performs query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain the target data.
[0353] In this embodiment, the server can perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain the target data.
[0354] The specific implementation process is the same as that of S205 and will not be elaborated here.
[0355] Advantages of this embodiment: In this embodiment, the terminal device can obtain the query method. The terminal device can display the visualization interface corresponding to the query method. The visualization interface includes a setting control. If the query method is a combined query method, the setting control includes a query rule setting control. If the query method is a join query method, the setting control includes a query rule setting control and an association rule setting control. The query rule setting control is used to set the query rule information, and the association rule setting control is used to set the association relationship between the query rule information. The terminal device can obtain the query conditions in response to the user's operation on the setting control and send the query conditions to the server. The server can perform conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement (the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine). The server can perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain the target data. Through the above method, the user only needs to operate on the visualization interface, and the terminal device can obtain the query conditions, so that the server can automatically convert the query conditions sent by the terminal device to obtain the query statement, improving the acquisition efficiency of the query statement and further improving the data query efficiency.
[0356] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.
[0357] Figure 5 It is a schematic structural diagram of a data query device provided by an embodiment of the present application. The data query device 50 is applied to the server. The data query device 50 includes:
[0358] A transceiver module 51, configured to obtain query conditions;
[0359] A processing module 52, configured to perform conversion processing on the query conditions based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine;
[0360] The processing module 52 is further configured to perform query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain the target data.
[0361] The data query device provided by the embodiment of the present application can execute the technical solutions in the above method embodiment, and its beneficial effects are similar and will not be elaborated here.
[0362] In one implementation, the processing module 52 is specifically configured to:
[0363] Convert the format of the query condition into an executable statement format to obtain the converted query condition; wherein, the initial operator corresponding to the field identifier in the converted query condition matches the logical relationship information corresponding to the field identifier in the query condition.
[0364] Determine the target operator corresponding to the field identifier according to the corresponding relationship between the initial operator and the target operator indicated by the query condition conversion rule information for the field identifier corresponding to the initial operator in the converted query condition.
[0365] Convert the initial operator corresponding to each field identifier in the converted query condition into the target operator corresponding to each field identifier to obtain the query statement.
[0366] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0367] In one implementation manner, the processing module 52 is specifically configured to:
[0368] Obtain the field type corresponding to each field identifier;
[0369] Determine the target operator corresponding to the field identifier according to the corresponding relationship between the initial operator, the field type, and the target operator indicated by the query condition conversion rule information for the field identifier corresponding to the initial operator and the field type corresponding to the field identifier.
[0370] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0371] Figure 6 It is a schematic structural diagram of another data query device provided by the embodiments of the present application. The data query device 60 is applied to a terminal device. The data query device 60 includes:
[0372] A display module 61 for displaying a visual interface; the visual interface includes a setting control;
[0373] An acquisition module 62 for acquiring a query condition in response to a user's operation on the setting control;
[0374] A transceiver module 63 for sending the query condition to the server, so that the server performs conversion processing on the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and performs query processing on multiple data sources through the cross-source retrieval engine according to the query statement to obtain target data, and the query statement supports cross-source query of multiple data sources through the cross-source retrieval engine.
[0375] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0376] In one implementation, the display module 61 is specifically configured to:
[0377] Obtain a query method;
[0378] Display a visualization interface corresponding to the query method; wherein, when the query method is a combined query method, the setting control includes a query rule setting control; when the query method is a join query method, the setting control includes a query rule setting control and an association rule setting control; the query rule setting control is used to set query rule information; the association rule setting control is used to set the association relationship between the query rule information.
[0379] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0380] In one implementation, the query rule setting control includes a data table setting control and a field information setting control; the obtaining module 62 is specifically configured to:
[0381] In response to a user's operation on the data table setting control, determine the identifier of at least one target data table from the identifiers of multiple data tables;
[0382] In response to a user's operation on the field information setting control, determine field information; wherein the field information includes a field identifier, and logical relationship information and / or value range corresponding to the field identifier, and the field identifier belongs to at least one target data table;
[0383] Determine that the query rule information in the query condition includes field information.
[0384] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0385] In one implementation, the query rule setting control further includes a field association relationship control corresponding to the field information setting control; the obtaining module 62 is specifically configured to:
[0386] In response to a user's operation on any first field information setting control, determine the first field information;
[0387] In response to a user's operation of setting a field association relationship control corresponding to a control for the first field information, determine the field information association relationship, and add a control for setting the second field information to the visual interface; wherein, the field information association relationship indicates the association relationship between the first field information and the second field information.
[0388] In response to a user's operation on the control for setting the second field information, determine the second field information.
[0389] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0390] In one implementation, the obtaining module 62 is specifically configured to:
[0391] Determine that the query rule information includes the first field information, the second field information, and the field information association relationship.
[0392] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0393] In one implementation, when the setting control includes a query rule setting control and an association rule setting control, the obtaining module 62 is further configured to:
[0394] In response to a user's operation on the association rule setting control, obtain the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier;
[0395] Determining the association relationship between the first query rule information and the second query rule information includes: the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier.
[0396] The data query device provided by the embodiments of the present application can execute the technical solutions in the above method embodiments, and the beneficial effects are similar, so details are not described herein again.
[0397] Figure 7 It is a schematic structural diagram of a server provided by an embodiment of the present application. As Figure 7 shown, the server 70 includes: a processor 71 and a memory 72; wherein, the processor 71 is communicatively connected to the memory 72, and the memory 72 is used to store computer execution instructions; the processor 71 is configured to execute the technical solutions in the foregoing method embodiments by executing the computer execution instructions stored in the memory 72.
[0398] Optionally, the memory 72 can be either independent or integrated with the processor 71. Optionally, when the memory 72 is a device independent of the processor 71, the server 70 may further include: a bus 73 for connecting the above-mentioned devices.
[0399] The processor is configured to execute the technical solutions in the foregoing method embodiments where the execution subject is a server. The implementation principles and technical effects are similar and will not be elaborated here.
[0400] Figure 8 FIG. is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As Figure 8 shown, the terminal device 80 includes: a processor 81 and a memory 82; wherein, the processor 81 is communicatively connected to the memory 82, and the memory 82 is used to store computer-executable instructions; the processor 81 is configured to execute the technical solutions in the foregoing method embodiments by executing the computer-executable instructions stored in the memory 82.
[0401] Optionally, the memory 82 can be either independent or integrated with the processor 81. Optionally, when the memory 82 is a device independent of the processor 81, the terminal device 80 may further include: a bus 83 for connecting the above-mentioned devices.
[0402] The processor is configured to execute the technical solutions in the foregoing method embodiments where the execution subject is a terminal device. The implementation principles and technical effects are similar and will not be elaborated here.
[0403] An embodiment of the present application further provides a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the computer-executable instructions are executed by a processor, they are used to implement the technical solutions provided by the foregoing method embodiments.
[0404] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, it is used to implement the technical solutions provided by the foregoing method embodiments.
[0405] Those of ordinary skill in the art can understand that all or part of the steps of implementing the foregoing method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the foregoing method embodiments; and the foregoing storage medium includes: various media such as ROM, RAM, magnetic disk, or optical disc that can store program codes.
[0406] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data query method, characterized in that: Applied to a server, the method comprises: Get the query conditions; Based on the condition conversion rule information corresponding to the cross-source search engine, the query condition is converted to obtain a query statement, where the query statement supports cross-source query of multiple data sources through the cross-source search engine; According to the query statement, the cross-source search engine performs query processing on the multiple data sources to obtain target data.
2. The method according to claim 1, characterized in that The query condition is converted based on the condition conversion rule information corresponding to the cross-source search engine to obtain a query statement, including: Converting the format of the query condition into an executable statement format to obtain a converted query condition; wherein the initial operator corresponding to the field identifier in the converted query condition matches the logical relationship information corresponding to the field identifier in the query condition; According to the initial operator corresponding to the field identifier in the converted query condition, query the corresponding relationship between the initial operator and the target operator indicated by the condition conversion rule information to determine the target operator corresponding to the field identifier; The initial operators corresponding to the field identifiers in the converted query conditions are converted into target operators corresponding to the field identifiers to obtain the query statement.
3. The method according to claim 2, characterized in that The querying, according to the initial operator corresponding to the field identifier in the converted query condition, the corresponding relationship between the initial operator and the target operator indicated by the condition conversion rule information, and determining the target operator corresponding to the field identifier includes: Get the field type corresponding to each field identifier; According to the initial operator corresponding to the field identifier and the field type corresponding to the field identifier, the correspondence between the initial operator, the field type and the target operator indicated by the conditional conversion rule information is queried to determine the target operator corresponding to the field identifier.
4. A data query method, characterized in that: Applied to a terminal device, the method comprises: Display a visualization interface; the visualization interface includes setting controls; In response to a user operation on the setting control, obtaining the query condition; The query condition is sent to the server so that the server converts the query condition based on the condition conversion rule information corresponding to the cross-source retrieval engine to obtain a query statement, and based on the query statement, query the multiple data sources through the cross-source retrieval engine to obtain the target data. The query statement supports cross-source query of multiple data sources through the cross-source retrieval engine.
5. The method according to claim 4, characterized in that The display visualization interface includes: Get the query method; A visualization interface corresponding to the query method is displayed; wherein, when the query method is a merge query method, the setting control includes a query rule setting control; when the query method is a connection query method, the setting control includes a query rule setting control and an association rule setting control; the query rule setting control is used to set query rule information; and the association rule setting control is used to set the association relationship between each query rule information.
6. The method according to claim 5, characterized in that The query rule setting control includes a data table setting control and a field information setting control; the obtaining of the query condition in response to the user's operation on the setting control includes: In response to a user's operation of setting a control for the data table, determining an identifier of at least one target data table from identifiers of a plurality of data tables; In response to the user's operation of setting a control for the field information, determining the field information; wherein the field information includes a field identifier, and logical relationship information and / or a value range corresponding to the field identifier, and the field identifier belongs to at least one of the target data tables; It is determined that the query rule information in the query condition includes the field information.
7. The method according to claim 6, characterized in that The query rule setting control also includes a field association relationship control corresponding to the field information setting control; and the determining of the field information in response to the user's operation on the field information setting control includes: In response to a user's operation of setting a control for any first field information, determining the first field information; In response to a user operation on a field association control corresponding to the first field information setting control, determining a field information association, and adding a second field information setting control in the visualization interface; wherein the field information association indicates an association between the first field information and the second field information; In response to a user's operation of setting a control for the second field information, the second field information is determined.
8. The method according to claim 7, characterized in that Determining that the query rule information in the query condition includes the field information includes: Determine that the query rule information includes the first field information, the second field information, and an association relationship between the field information.
9. The method according to any one of claims 5 to 8, characterized in that: In the case where the setting control includes the query rule setting control and the association rule setting control, the determining the query condition in response to the user's operation on the setting control further includes: In response to a user's operation on the association rule setting control, obtaining a first field identifier in the first query rule information, a second field identifier in the second query rule information, and an association relationship between the first field identifier and the second field identifier; Determining the association relationship between the first query rule information and the second query rule information includes: the first field identifier in the first query rule information, the second field identifier in the second query rule information, and the association relationship between the first field identifier and the second field identifier.
10. A server, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executable instructions; The processor is used to execute the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 3.
11. A terminal device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executable instructions; The processor is used to execute the computer-executable instructions stored in the memory to implement the method according to any one of claims 4 to 9.
Citation Information
Cited By
Query processing method, electronic device, storage medium and program product
CN122507774A