Data retrieval method and device, medium and program product

By parsing user search requests and generating query templates in the template memory, the problem of efficient and accurate retrieval in multi-data source scenarios is solved, fast and accurate data retrieval results are achieved, and the characteristics and permission control of the data source are maintained.

CN120596719APending Publication Date: 2025-09-05AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510709240.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In scenarios with multiple data sources, existing technologies make it difficult to achieve efficient and accurate data retrieval, resulting in high retrieval latency and long search times. Furthermore, when integrating data sources, some features may be lost or strict access control may not be met.

Method used

By parsing the user's search request, determining the query condition information and statements, obtaining the target query template, generating and executing the executable query statement, and performing targeted queries on each target data source, the integration of data sources and complex parsing are avoided, and efficient queries are performed using the query templates pre-generated in the template memory.

Benefits of technology

It enables efficient and accurate query of multiple data sources, shortens retrieval time, meets user needs, and at the same time maintains the characteristics of the data source and access permission control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596719A_ABST
    Figure CN120596719A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data retrieval method and device, a medium and a program product. The method comprises the following steps: analyzing a target retrieval request of a user, and determining query condition information and a query statement; the query statement is used for reflecting specific query content; for each query branch in the query condition information, obtaining a target query template from a template memory according to a target template number in the query branch; generating a target executable query statement according to the target query template and the query statement, and executing the target executable query statement to query each target data source to obtain a retrieval result corresponding to the target retrieval request. According to the scheme, the corresponding target query statements can be generated based on the target query template under the condition that the query requirement for multiple data sources exists, the multiple data sources do not need to be integrated, a user does not need to finely compile query statements for querying different data sources, and the convenience and normalization of multi-data source query are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data retrieval technology, and in particular to a data retrieval method, device, medium and program product. Background Art

[0002] The rise of fintech has accelerated innovation and the digital transformation of financial services, generating a vast amount of data from a wide variety of sources. In the field of full-text search, varying search requirements lead to inconsistent request logic. Furthermore, a single request can involve data from multiple dimensions, with single-dimensional data corresponding to multiple data sources. The overlapping conditions create a complex multi-data source scenario. In this scenario, each request requires a complete nested semantic analysis, resulting in complex searches and high latency. Accurately returning the results users desire requires significant processing time, which contradicts the low-latency, fast-response search experience that users expect.

[0003] At present, when there are no special requirements for retrieval performance, the general choice is to directly search multiple data sources, and each search requires a targeted analysis of the query request. However, depending on the retrieval requirements, the logic of each retrieval request is inconsistent. One retrieval logic includes multiple retrieval branches, corresponding to multiple complete nested semantic analyses. If you want to accurately return the results required by the user, you need to go through a complex parsing process, which consumes a lot of time. In addition, in some current business search scenarios, choose to integrate multiple types of information into one data source to achieve fast and unified retrieval of composite data. Retrieval efficiency can be improved by compressing the data source, but this solution has high requirements for data integration technology and will result in the loss of some data source characteristics. In addition, when the isolation of each business data is low, it is not suitable for scenarios where access rights to the data source are strictly controlled. Summary of the Invention

[0004] The embodiments of the present application provide a data retrieval method, device, medium, and program product to achieve efficient and accurate retrieval of multiple data sources.

[0005] According to one aspect of the present application, a data retrieval method is provided, the method comprising:

[0006] Parse the user's target search request to determine query condition information and query statements; wherein the query condition information includes multiple query branches; different query branches correspond to different target data sources; the query statement is used to reflect the specific content of the query;

[0007] For each query branch in the query condition information, a target query template is obtained from a template memory according to the target template number in the query branch; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources;

[0008] A target executable query statement is generated according to the target query template and the query statement, and the target executable query statement is executed to query each target data source to obtain a search result corresponding to the target search request.

[0009] According to one aspect of the present application, a data retrieval device is provided, comprising:

[0010] A parsing module is used to parse the user's target search request and determine query condition information and a query statement; wherein the query condition information includes multiple query branches; different query branches correspond to querying different target data sources; the query statement is used to reflect the specific content of the query;

[0011] a target query template acquisition module, configured to acquire a target query template from a template memory according to the target template number in each query branch in the query condition information; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources;

[0012] The query module is used to generate a target executable query statement according to the target query template and the query statement, and execute the target executable query statement to query each target data source to obtain a search result corresponding to the target search request.

[0013] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the data retrieval method of any embodiment of the present application.

[0017] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data retrieval method of any embodiment of the present application when executed.

[0018] According to another aspect of the present application, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the data retrieval method of any embodiment of the present application is implemented.

[0019] The technical solution of the embodiment of the present application parses the user's target search request, determines the query condition information and the query statement, and thus parses out multiple query branches corresponding to the target data sources that need to be queried, so as to query each target data source in a targeted manner. For each query branch in the query condition information, a target query template is obtained from a template memory according to the target template number in the query branch; a target executable query statement is generated according to the target query template and the query statement, and the target executable query statement is executed to query each target data source to obtain the search result corresponding to the target search request. By obtaining the corresponding target query template and filling in the generated target executable query statement, efficient and orderly query of each target data source can be achieved, and targeted and fast query of different data sources can be achieved without integrating each data source and without the need for targeted parsing of each query request.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0022] Figure 1 A flowchart of a data retrieval method provided in an embodiment of the present application;

[0023] Figure 2 A flowchart of a data retrieval method provided in another embodiment of the present application;

[0024] Figure 3 A flowchart of a data retrieval method provided in another embodiment of the present application;

[0025] Figure 4 This is a diagram of the overall functional architecture of a specific implementation method of the embodiment of the present application;

[0026] Figure 5 This is a specific processing flow chart of the access processing unit in an embodiment of the present application;

[0027] Figure 6 This is a specific processing flow chart of the search and parsing unit in an embodiment of the present application;

[0028] Figure 7 This is a specific processing flow chart of the retrieval execution unit in an embodiment of the present application;

[0029] Figure 8 This is a specific processing flow chart of the retrieval template of an embodiment of the present application;

[0030] Figure 9 A schematic diagram of the structure of a data retrieval device provided in an embodiment of the present application;

[0031] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0033] It should be noted that the terms "first", "second", "third", "fourth", "actual", "preset", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] Figure 1 This is a flow chart of a data retrieval method provided in an embodiment of the present application. This embodiment of the present application is applicable to processing requests to query multiple data sources. The method can be executed by a data retrieval device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0035] S110. Parse the user's target search request to determine query condition information and a query statement; wherein the query condition information includes multiple query branches; different query branches correspond to queries of different target data sources; and the query statement is used to reflect the specific content of the query.

[0036] The target search request may be a search request sent by a user through a request interface. The target search request includes query condition information and a query statement. The query condition information reflects the conditions that restrict the query, such as the query data source, corresponding time period, template number, user source, etc. The query statement reflects the specific content of the query, such as the query keyword. The query condition information includes multiple query branches, each query branch corresponds to a query of a target data source, and multiple branches correspond to queries of multiple target data sources.

[0037] In an embodiment of the present application, after receiving the user's target retrieval request, the target retrieval request is parsed to determine the query condition information and query statement, so as to clarify which data sources the user needs to query, which content the user needs to query, etc., and the user's permissions need to be verified before the query.

[0038] Specifically, user permission verification can include pre-reading the user's preset configuration information. The configuration information includes information such as the data sources accessible to the user, the data source operations that the user can perform, and the data source categories, reflecting the user's access rights. The data source operations that the user can perform may include, for example, adding, deleting, and querying. Each permission is independent of each other, and the next operation can only be performed if the query conditions are met. After obtaining the user's target search request and determining the query condition information, the preset configuration information can be queried based on the user source and target data source in the query condition information to determine whether the user of the user source has access rights to the target data source, and what specific operation permissions they have.

[0039] S120. For each query branch in the query condition information, obtain a target query template from a template memory according to the target template number in the query branch; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources.

[0040] The template memory stores pre-generated query templates corresponding to queries on different data sources. A query template is executable code for querying a data source. Generally, each user's query pattern is shared, but the specific query content varies. Therefore, a query template can be pre-generated for each data source and stored in the template memory. Different users can design different query templates for a single data source.

[0041] For example, for each query branch in each query condition information, each query branch corresponds to a different target data source. Each query branch carries a target template number. Based on the target template number, a target query template can be retrieved from a template memory to query the target data source corresponding to the query branch. The template number of each query template is not limited to a specific format and can be an identifier generated during the process of creating the query template and storing it in the template memory to reflect the uniqueness of the query template.

[0042] S130: Generate a target executable query statement according to the target query template and the query statement, and execute the target executable query statement to query each target data source to obtain a search result corresponding to the target search request.

[0043] Exemplarily, the target query template represents a specific executable statement for querying the target data source. The query statement contains the specific content to be queried. A target executable query statement can be generated based on the target query template and the query statement, and the target executable query statement can be executed to query each target data source to obtain the retrieval results corresponding to the target retrieval request.

[0044] The technical solution of the embodiment of the present application parses the user's target search request, determines the query condition information and the query statement, and thus parses out multiple query branches corresponding to the target data sources that need to be queried, so as to query each target data source in a targeted manner. For each query branch in the query condition information, a target query template is obtained from a template memory according to the target template number in the query branch; a target executable query statement is generated according to the target query template and the query statement, and the target executable query statement is executed to query each target data source to obtain the search result corresponding to the target search request. By obtaining the corresponding target query template and filling in the generated target executable query statement, efficient and orderly query of each target data source can be achieved, and targeted and fast query of different data sources can be achieved without integrating each data source and without the need for targeted parsing of each query request.

[0045] As a non-limiting implementation, the process of determining the query template in the template memory includes:

[0046] Obtain the user-defined query logic for querying the data source; the user-defined content includes at least three of the following: target data source, template number, query mode, configurable filter conditions, sorting rules, paging rules, and highlight statistics, and at least includes the target data source, template number, and query mode.

[0047] Converting the query logic into an executable query statement, and replacing parameters in the query statement that reflect the query content with placeholders, to obtain a query template corresponding to querying the data source;

[0048] Each query template is assigned a unique template number and stored in the template memory.

[0049] Exemplarily, the query logic for querying the data source that is customized and edited by the user can be obtained in advance. The user-defined query logic is embodied in an intuitive form such as graphics, and there is no need to write specific code. The content available for user-defined editing may include at least three characteristic contents of the target data source, template number, query mode, configurable filtering conditions, sorting rules, paging rules, and highlight statistics, and at least the target data source, template number, and query mode. That is, the target data source, template number, and query mode must be included, while other characteristic contents may or may not be included. The query logic that the user edits for querying the data source is converted into an executable query statement, that is, an executable query code, and the parameters reflecting the query content in the query statement are replaced with placeholders to form a query template, which is used to perform personalized filling settings according to the specific content that the user needs to query in subsequent practical applications. Each query template is assigned a unique template number and stored in a template memory, and the user subsequently calls the query.

[0050] As a non-limiting implementation method, obtaining the query logic for querying the data source customized by the user includes:

[0051] Display user-defined editable content in a visual interface;

[0052] In response to a user's operation on the content that can be customized and edited by the user on the visual interface, a query logic corresponding to the target content operated by the user is determined.

[0053] For example, a visual interface can be provided for users to define query logic. The content available for user customization can include at least three characteristic contents of the target data source, template number, query mode, configurable filtering conditions, sorting rules, paging rules, and highlight statistics, and at least includes the target data source, template number, and query mode. The query mode includes types such as Boolean query and field query. When naming the query template, the user needs to follow certain naming rules, such as prefixing the template name with the user ID. After the content available for user customization is displayed on the front-end interface, the user can operate on the content available for user customization, determine the query logic corresponding to the target content operated by the user, automatically convert the query logic into an executable query statement, and replace the parameters reflecting the query content in the query statement with placeholders, etc., to obtain the query template corresponding to the query of the data source. The above solution can pre-generate corresponding query templates for the user's queries on different data sources, so that in subsequent actual applications, the query template can be directly called and the query content can be filled in to obtain an executable statement for querying each data source, thereby improving query efficiency.

[0054] Figure 2 This is a flow chart of a data retrieval method provided in another embodiment of the present application. The present embodiment is optimized based on the above embodiment. For solutions not fully described in the present embodiment, please refer to the above embodiment. Figure 2 As shown, the method of the embodiment of the present application specifically includes the following steps:

[0055] S210. Parse the user's target search request to determine query condition information and a query statement; wherein the query condition information includes multiple query branches; different query branches correspond to queries of different target data sources; and the query statement is used to reflect the specific content of the query.

[0056] S220. For each query branch in the query condition information, obtain a target query template from a template memory according to the target template number in the query branch; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources.

[0057] S230: Use the query statement as a parameter to replace the placeholder position in the target query template to generate a target query statement.

[0058] A placeholder is a symbol or tool that occupies a fixed position and waits for content to be filled. Its core function is to reserve structured space for subsequent content. In the target query template, common statements are pre-set, and placeholders are set in customizable locations.

[0059] For example, a query statement contains the specific content that the user needs to search for, while the target query template is a general executable query statement that cannot implement personalized queries. The user's query statement can be used as a parameter to replace the placeholder position in the target query template to generate the target query statement, thereby filling the target query template and implementing personalized queries.

[0060] S240: Execute the target query statements corresponding to the query branches to query the target data sources and obtain the search results corresponding to the target search request.

[0061] For example, different query branches are used to query different target data sources. Each query branch queries a target data source, and therefore each query branch calls a target query template and populates it with a query statement to generate a target query statement. The target query statement corresponding to each query branch is executed to query each target data source, thereby obtaining search results corresponding to the target search request.

[0062] The present application provides a data retrieval method that uses placeholders to set customizable positions in a query template, thereby constructing a universal template for a data source, facilitating subsequent direct call of the template for quick queries. In practical applications, a target query statement is generated by replacing the placeholder position in the target query template with a query statement as a parameter, thereby achieving personalized setting of the target query statement. To query according to the user's specific needs, the target query statement corresponding to each query branch is executed to query each target data source required by the user, and obtain a search result corresponding to the target search request.

[0063] In the embodiment of the present application, after determining the query condition information, the method further includes:

[0064] Parsing the query condition information to determine target data sources accessed by the query operation, and determining target access paths for accessing each target data source;

[0065] Accordingly, executing the target query statements corresponding to each query branch to query each target data source to obtain the search results corresponding to the target search request includes:

[0066] For each query branch, the target query statement corresponding to the query branch is executed to access the target data source based on the target access path, and the query obtains the search result corresponding to the target search request.

[0067] Exemplarily, query condition information is parsed to determine the target data source accessed by the query operation. After the target data source is determined, the address information of the target data source can be clarified, thereby determining the target access path for accessing each target data source. Accordingly, when executing the target query statement corresponding to each query branch to query each target data, the target query statement corresponding to the query branch is executed, and the target data source is accessed based on the target access path to obtain the search result corresponding to the target search request.

[0068] Figure 3 This is a flow chart of a data retrieval method provided in another embodiment of the present application. The present embodiment is optimized based on the above embodiment. For solutions not fully described in the present embodiment, please refer to the above embodiment. Figure 3 As shown, the method of the embodiment of the present application specifically includes the following steps:

[0069] S310. Parse the user's target search request to determine query condition information and a query statement; wherein the query condition information includes multiple query branches; different query branches correspond to queries of different target data sources; and the query statement is used to reflect the specific content of the query.

[0070] S320: Parse the keywords in the query statement and perform word segmentation on the keywords to obtain keyword segmentation.

[0071] For example, a query statement includes specific content that the user wants to search for, generally including keywords. For example, if the user wants to search for content related to "sports shoes," the keyword is "sports shoes." The keywords can be segmented to obtain keyword segmentation. For example, the keyword segmentation obtained by segmenting the keywords is "sports" and "shoes."

[0072] S330: Perform category analysis on the keyword segmentations to determine the segmentation categories and category weights corresponding to the respective keyword segmentations.

[0073] For example, a category analysis is performed on each keyword segmentation to determine the segmentation category and category weight corresponding to each keyword segmentation. Specifically, an algorithm based on information concentration, a relative comparison algorithm, a data fluctuation algorithm, an e-commerce scenario-specific algorithm, or an improved text analysis algorithm can be used to determine the segmentation category and category weight for each keyword segmentation.

[0074] For example, the keyword segmentation words "sports" and "shoes" are subjected to category analysis and the output segmentation categories and category weights are {"commodity": 0.7, "sports": 0.3}.

[0075] S340. For each query branch in the query condition information, obtain a target query template from a template memory according to the target template number in the query branch; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources.

[0076] S350: Generate a target executable query statement according to the target query template and the query statement.

[0077] S360: Execute the target query statements corresponding to the query branches to query the target data sources, and obtain the recall results returned from the target data sources.

[0078] Exemplarily, during the query process, the target query statements corresponding to the query branches are executed, and the target data sources are queried to obtain the recall results from the target data sources.

[0079] S370 : Rearrange the recall results returned from each target data source according to the category weight of the word segmentation category corresponding to each target data source and use them as the search results corresponding to the target search request.

[0080] Exemplarily, the recall results returned from each target data source need to be returned to the user. Before returning them to the user, the recall results returned by each target data source need to be rearranged to form a certain arrangement order and returned to the user. Specifically, it can be determined based on the analysis category corresponding to each target data source, for example, some target data sources correspond to the "commodity" category, and some target data sources correspond to the "sports" category. Each word segmentation category corresponds to a category weight. For the recall results returned from the target data source, each recall result can be rearranged according to the category weight of the word segmentation category corresponding to the target data source, and each rearranged recall result can be used as the retrieval result corresponding to the target retrieval request.

[0081] An embodiment of the present application provides a data retrieval method, which performs word segmentation based on keywords in a query statement to determine keyword segmentations, performs category analysis on each keyword segmentation to determine the segmentation category and category weight, determines the segmentation category corresponding to each target data source, and then determines the corresponding category weight, and for the recall results returned from each target data source, re-arranges each recall result based on the category weight of the segmentation category corresponding to each target data source, and returns the re-arranged results to the user, thereby providing the user with recall results with more reference value in priority according to the weight of the target data source, thereby meeting the user's query needs.

[0082] The embodiment of the present application provides an overall functional architecture diagram of a specific implementation method, such as Figure 4 As shown, the overall architecture and functions include:

[0083] 1. Access Processing Unit

[0084] The access processing unit takes in a search request, outputs query conditions and a query statement, and performs verification and preliminary parsing of the search request. In this unit, the configuration reader first loads the user configuration, then the permission verifier verifies the user's operation permissions based on the read configuration. Finally, the request parser parses the query conditions and the actual query statement.

[0085] The access processing unit includes:

[0086] The configuration reader is used to read user-preset configuration information. This configuration information includes user-accessible data sources, user-performable data source operations, data source categories, and other information that assists in request parsing.

[0087] The permission verifier uses the permission information obtained by the configuration reader to perform permission verification on the search request. Access permissions are divided into add, delete, query, etc. Each permission is independent of each other. Only when the query conditions are met can the next operation be performed.

[0088] The request parser parses search requests, dividing them into two parts: query condition information and query statements. Multiple query branches corresponding to a single request may have different query condition information but the same query statement. Query condition information includes information such as the user source, target data source, and template number.

[0089] The specific processing flow chart of the access processing unit is as follows: Figure 5 As shown:

[0090] 1. The retrieval request enters the access processing unit, which obtains information such as the user's accessible data sources, the user's executable data source access operations, and the data source category through the configuration reader;

[0091] 2. After obtaining the user configuration information, the user permissions are verified in the permission verifier to check whether the user has the query operation permission. If the user does not have the query operation permission, the request is directly blocked;

[0092] 3. After confirming that the user has query operation permissions, the request parser analyzes the user's search request and decomposes the request into query condition information and query statements;

[0093] 4. After the search request is decomposed, the query condition information, query statement, and accessible data sources obtained from the configuration are sent to the next unit for processing.

[0094] 2. Retrieval and Parsing Unit

[0095] The retrieval parsing unit inputs query conditions and query statements and outputs the target access path, preparing for the next step of retrieval execution. First, the semantic analyzer obtains the query statement and performs category analysis based on the data source category. The weight loader assigns weights to each data source based on the category analysis results. Then, the routing configurator analyzes the user's access data source address and template number based on the query conditions to obtain the target path, which is then executed by the retrieval execution unit.

[0096] The retrieval and parsing units include:

[0097] The semantic analyzer performs category analysis on query statements based on the data source category. Before category analysis, word segmentation is performed. This process uses a vocabulary and a segmentation algorithm to obtain query keywords. For example, if you enter "sports shoes," the output will be "sports" and "shoes." Category analysis is then performed. This assumes that the user has access to two data sources, "products" and "sports." A search for "sports shoes" yields the category analysis output "{"products": 0.7, "sports": 0.3}."

[0098] The weight loader generates query result weights based on the category results obtained after category identification. For example, the category analysis result "{"Product": 0.7, "Sports": 0.3}" determines that when the results returned after searching the data sources to which "Product" and "Sports" belong are reordered, the result ratio is 0.7:0.3.

[0099] The routing configurator configures the access execution paths for multiple target data sources required to complete the query logic. It parses the query condition information in the search request, which contains multiple query branch JSONs. Each branch has different target data sources, template numbers, and other fields. It then assembles each set of target data sources, template numbers, and query operations into an execution request recognizable by the search execution unit, preparing for the next search step.

[0100] The specific processing flow chart of the retrieval and parsing unit is as follows: Figure 6 As shown:

[0101] 1. The semantic analyzer obtains the query statement, performs word segmentation on the query statement, and obtains the query keywords;

[0102] 2. The weight loader performs category analysis based on the query keywords and data source category set to obtain the proportion of each data source category;

[0103] 3. Based on the category analysis results, configure the weights of each data source and construct a mapping between each data source and the weight;

[0104] 4. The routing configurator obtains the user access data source address and query logic template number based on the query condition information, and splices the target access path of the retrieval execution unit;

[0105] 5. After obtaining the target path, send a query request to the retrieval execution unit.

[0106] 3. Retrieval Execution Unit

[0107] The retrieval execution unit is responsible for accessing data sources to complete query operations and integrate query results. In this unit, the template loader first loads the query template. The template renderer renders the target template, replacing the target template placeholder with the query statement as a parameter to obtain the actual query execution statement. The retrieval executor then executes the retrieval operation based on the rendered query statement. If the execution is successful, the result intervener analyzes and reorders the execution return results and submits the processed results to the user. Otherwise, the query is deemed to have failed.

[0108] The retrieval execution unit includes:

[0109] The template loader can load the target query template in the template memory according to the template number.

[0110] The template renderer renders the target template, replaces the target template placeholder with the query statement as a parameter, and generates an execution statement.

[0111] Retrieve the executor, obtain the rendered query execution statement, perform data query operations on multiple target data sources, and return the query results of each data source.

[0112] The result intervener reorders the results output from the retrieval executor according to the weight information and the query condition information input by the user, and returns the results to the user.

[0113] The specific processing flow chart of the retrieval execution unit is as follows: Figure 7 As shown:

[0114] 1. The retrieval execution unit assigns a processing node to this request;

[0115] 2. The node reads the query template from the template memory according to the query condition information;

[0116] 3. Render the target template, use the passed parameters to fill in the predefined search template, and generate a complete execution statement that can be executed by the search executor.

[0117] 4. The retrieval executor obtains the executable statement and executes the query operation. If the query is successful, the result is returned to the result intervener. If the query fails, the retrieval is judged to have failed and an error message is returned to the user.

[0118] 5. After obtaining the query results, the result intervener intervenes and sorts the query results according to the weight information and query condition information obtained from the weight loader, and returns the results to the user.

[0119] 4. Retrieval Template Generation Unit

[0120] In the scenario of this patent, there will be a large number of templates and complex template logic. Designing a retrieval template generation unit can simplify the user template generation and registration process.

[0121] The retrieval template generation unit takes the user's query target and query pattern as input, transforms the user's query into a template that can be rendered by the retrieval execution unit, and stores it uniformly in the template memory. In this unit, the user first uses an editor to visually edit the query logic. The template converter then converts the editor's edits into a template recognizable by the retrieval executor. The template registrar registers the generated query template with the retrieval execution unit and stores it in the template memory for unified management.

[0122] The retrieval template generation unit includes:

[0123] The editor provides a user-friendly, visual interface for defining query logic. Editable content includes the target data source, template ID, query mode, filter conditions, sorting rules, paging rules, and highlight statistics. Query modes include Boolean and field queries. Users must follow certain naming conventions when naming templates, such as prefixing the template name with the user ID.

[0124] After the user completes the editor operation, the template converter automatically converts the query logic into a query statement that can be recognized and executed by the search execution unit. When generating the query template, placeholders are used to replace the user's query statement to pass specific parameters when executing the query, implementing the user's parameterized query.

[0125] The template registrar registers the generated query template to the retrieval execution unit by sending a request. After registration, the query template can be accessed according to the data source name and template number.

[0126] Template memory is a unified template management device that uses the template number as a unique identifier. The retrieval execution unit reads the template memory content when loading the query template.

[0127] The template is a JSON that includes fields such as query mode, filter conditions, sorting rules, paging rules, highlight statistics, etc., and supports multi-condition queries.

[0128] The specific processing flow chart of the retrieval template is as follows Figure 8 As shown:

[0129] 1. Set the target data source and enter the template number that complies with the naming rules;

[0130] 2. Design the visual query logic in the editor based on the target query logic, and edit the query mode, filter conditions, sorting rules, paging rules, highlight statistics, and other information by operating the drop-down box and text input box;

[0131] 3. After the logic editing is completed and confirmed, the template converter automatically converts the query logic into a query template format that can be recognized by the search executor in the search execution unit;

[0132] 4. After the query template is generated, the template registrar sends a template registration request to the retrieval execution unit;

[0133] 5. The retrieval execution unit receives the registration request, completes template registration, and stores the template in a template memory that can be centrally managed, waiting for loading and use;

[0134] 6. Return the template generation result to the user.

[0135] Figure 9 This is a structural diagram of a data retrieval device provided in an embodiment of the present application. The device can execute the data retrieval method provided in any embodiment of the present application and has the corresponding functional modules and beneficial effects of the execution method. Figure 9 As shown, the device includes:

[0136] Parsing module 410 is used to parse the user's target search request and determine query condition information and query statements; wherein the query condition information includes multiple query branches; different query branches correspond to different target data sources; the query statement is used to reflect the specific content of the query;

[0137] The target query template acquisition module 420 is configured to acquire a target query template from a template memory according to the target template number in each query branch in the query condition information; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources;

[0138] The query module 430 is configured to generate a target executable query statement according to the target query template and the query statement, and execute the target executable query statement to query each target data source to obtain a search result corresponding to the target search request.

[0139] In an embodiment of the present application, the device further includes:

[0140] A query logic acquisition module is used to obtain the query logic for querying the data source edited by the user; wherein the user-defined edit content includes at least three characteristics of the target data source, template number, query mode, configurable filtering conditions, sorting rules, paging rules, and highlight statistics, and at least includes the target data source, template number, and query mode;

[0141] A query template determination module, configured to convert the query logic into an executable query statement, and replace parameters in the query statement that reflect the query content with placeholders, to obtain a query template corresponding to the query on the data source;

[0142] The storage module is used to assign a unique template number to each query template and store the template number in the template memory.

[0143] In the embodiment of the present application, the query logic acquisition module acquires the query logic for querying the data source edited by the user, including:

[0144] Display user-defined editable content in a visual interface;

[0145] In response to a user's operation on the content that can be customized and edited by the user on the visual interface, a query logic corresponding to the target content operated by the user is determined.

[0146] In the embodiment of the present application, the query module 430 generates a target executable query statement based on the target query template and the query statement, and executes the target executable query statement to query each target data source to obtain a search result corresponding to the target search request, including:

[0147] Using the query statement as a parameter to replace the placeholder position in the target query template to generate a target query statement;

[0148] The target query statements corresponding to the respective query branches are executed to query the target data sources to obtain the retrieval results corresponding to the target retrieval request.

[0149] In the embodiment of the present application, after determining the query condition information, the apparatus further includes:

[0150] a target access path determination module, configured to parse the query condition information to determine a target data source to be accessed by the query operation, and determine a target access path for accessing each target data source;

[0151] Accordingly, the query module 430 executes the target query statements corresponding to the query branches to query the target data sources and obtain the search results corresponding to the target search request, including:

[0152] For each query branch, the target query statement corresponding to the query branch is executed to access the target data source based on the target access path, and the query obtains the search result corresponding to the target search request.

[0153] In the embodiment of the present application, after determining the query statement, the apparatus further includes:

[0154] A parsing module, configured to parse keywords in the query statement and perform word segmentation on the keywords to obtain keyword segmentations;

[0155] The category analysis module is used to perform category analysis on the keyword segmentation and determine the segmentation category and category weight corresponding to each keyword segmentation.

[0156] In the embodiment of the present application, the query module 430 executes the target query statements corresponding to the query branches to query the target data sources to obtain the search results corresponding to the target search request, including:

[0157] Execute the target query statements corresponding to each query branch to query each target data source and obtain the recall results returned from each target data source;

[0158] According to the category weights of the word segmentation categories corresponding to each target data source, the recall results returned from each target data source are rearranged as the retrieval results corresponding to the target retrieval request.

[0159] A data retrieval device provided in an embodiment of the present application can execute a data retrieval method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method.

[0160] Figure 10 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0161] like Figure 10As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0162] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless data retrieval transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0163] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the data retrieval method.

[0164] In some embodiments, the data retrieval method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data retrieval method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data retrieval method in any other suitable manner (e.g., via firmware).

[0165] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0166] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data retrieval device, such that when executed by the processor, the computer programs implement the functions / operations specified in the flowcharts and / or block diagrams. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0167] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0168] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0169] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0170] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0171] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data retrieval method provided in any embodiment of the present application.

[0172] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to write computer program code for performing the operations of the present invention, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, through the Internet using an Internet service provider).

[0173] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired information of the technical solution of this application can be achieved. This document is not limited here.

[0174] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.

Claims

1. A data retrieval method, characterized in that: The method comprises: Parse the user's target search request to determine query condition information and query statements; wherein the query condition information includes multiple query branches; different query branches correspond to different target data sources; the query statement is used to reflect the specific content of the query; For each query branch in the query condition information, a target query template is obtained from a template memory according to the target template number in the query branch; wherein the template memory stores pre-generated query templates corresponding to queries on different data sources; A target executable query statement is generated according to the target query template and the query statement, and the target executable query statement is executed to query each target data source to obtain a search result corresponding to the target search request.

2. The method according to claim 1, characterized in that The process of determining the query template in the template memory includes: Obtain the user-defined query logic for querying the data source; the user-defined content includes at least three of the following: target data source, template number, query mode, configurable filter conditions, sorting rules, paging rules, and highlight statistics, and at least includes the target data source, template number, and query mode. Converting the query logic into an executable query statement, and replacing parameters in the query statement that reflect the query content with placeholders, to obtain a query template corresponding to querying the data source; Each query template is assigned a unique template number and stored in the template memory.

3. The method according to claim 2, characterized in that Get the user-defined query logic for querying the data source, including: Display user-defined editable content in a visual interface; In response to a user's operation on the content that can be customized and edited by the user on the visual interface, a query logic corresponding to the target content operated by the user is determined.

4. The method according to any one of claims 1 to 3, characterized in that Generating a target executable query statement according to the target query template and the query statement, and executing the target executable query statement to query each target data source to obtain a search result corresponding to the target search request, including: Using the query statement as a parameter to replace the placeholder position in the target query template to generate a target query statement; The target query statements corresponding to the respective query branches are executed to query the target data sources to obtain the retrieval results corresponding to the target retrieval request.

5. The method according to claim 1, wherein After determining the query condition information, the method further includes: Parsing the query condition information to determine target data sources accessed by the query operation, and determining target access paths for accessing each target data source; Accordingly, executing the target query statements corresponding to each query branch to query each target data source to obtain the search results corresponding to the target search request includes: For each query branch, the target query statement corresponding to the query branch is executed to access the target data source based on the target access path, and the query obtains the search result corresponding to the target search request.

6. The method according to claim 1, characterized in that After determining the query statement, the method further includes: Parsing the keywords in the query statement and performing word segmentation on the keywords to obtain keyword segmentation; Perform category analysis on the keyword segmentations to determine the segmentation categories and category weights corresponding to each keyword segmentation.

7. The method according to claim 6, characterized in that Executing the target query statements corresponding to each query branch to query each target data source to obtain the search results corresponding to the target search request, including: Execute the target query statements corresponding to each query branch to query each target data source and obtain the recall results returned from each target data source; According to the category weights of the word segmentation categories corresponding to each target data source, the recall results returned from each target data source are rearranged as the retrieval results corresponding to the target retrieval request.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the data retrieval method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data retrieval method according to any one of claims 1 to 7 when executed.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the data retrieval method according to any one of claims 1 to 7 when executed by a processor.