Multi-data source retrieval method and device, medium and equipment

Through multi-data source retrieval methods and dynamic connection pool management, the problems of frequent data source modification and high learning cost in existing systems are solved, efficient data retrieval and resource management are realized, and development difficulty and cost are reduced.

CN119293090AInactive Publication Date: 2025-01-10SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411347137.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing data query system mainly uses a single data source or initialization connection pool method, which causes the modification of data source information to require modification of business code and redeployment, which affects the system operation efficiency, and users need to have a high learning cost to use Elasticsearch's DSL or Kibana platform conducts complex queries.

Method used

Provide multi-data source retrieval methods, fill in configuration information through the front-end client to execute the data source information creation page, connect to test to obtain metadata, provide the search service configuration page for personalized retrieval requirements, and when receiving the data retrieval request, it will be sent from the thread Select threads and connection objects in the pool and connection container for searching, supports multi-data source configuration and custom search statements, and dynamically manage connection pools to reduce performance losses.

Benefits of technology

Reduces the technical difficulty and cost of developers, improves retrieval efficiency, supports multi-data source configuration without modifying business code, realizes the reuse of data source connection objects, reduces the time overhead for establishment and destruction, and improves performance and resource utilization. Rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293090A_ABST
    Figure CN119293090A_ABST
Patent Text Reader

Abstract

The invention provides a multi-data source retrieval method and device, a medium and equipment. The method comprises the following steps: providing a data source information creation page, so that a user fills configuration information of at least one data source; performing a connection test on the data source, and obtaining metadata of the data source after the connection test is passed; providing a retrieval service configuration page to enable a user to configure a corresponding personalized retrieval requirement for each data source; when a data retrieval request is received, a thread is selected from the thread pool, a data source connection object is selected from the corresponding connection pool in the connection container, connection of a front end and a rear end is established by utilizing the selected data source connection object, a retrieval statement is constructed by utilizing the selected thread, the retrieval statement is sent to a rear-end server, and the data retrieval request is sent to the rear-end server. The back-end server carries out retrieval operation, and a retrieval result returned by the back-end server is received. The technical difficulty of developers can be reduced, the development cost is reduced, and the retrieval efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data retrieval technology, and in particular to a multi-data source retrieval method and device, medium, and equipment. Background Art

[0002] Elasticsearch is a distributed, highly scalable, and highly real-time search and data analysis engine that can easily enable the search, analysis, and exploration of large amounts of data. Taking full advantage of the horizontal scalability of Elasticsearch can make data more valuable in the production environment. When retrieving data stored in Elasticsearch, you need to use Elasticsearch DSL, or Domain Specific Language, to build complex query conditions, or search through the Kibana platform. Both methods have a certain learning cost for users. At the same time, in the existing data query system, most of them use a single data source or initialize a connection pool, and can only configure a single data source. If you need to modify the data source information, you need to modify the corresponding business code, and republish and deploy it, which affects the efficiency of the system operation. Summary of the invention

[0003] In view of at least one of the above technical problems, an embodiment of the present invention provides a multi-data source retrieval method, device, medium, and equipment.

[0004] According to a first aspect, a multi-data source retrieval method provided by an embodiment of the present invention is executed by a front-end client, and the method includes:

[0005] Providing a data source information creation page, so that the user can fill in the configuration information of at least one data source on the data source information creation page;

[0006] According to the configuration information of each data source, a connection test is performed to the data source, and after the connection test passes, the metadata of the data source is obtained;

[0007] Providing a search service configuration page so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page;

[0008] When a data retrieval request is received, a thread is selected from the thread pool for the data retrieval request and a data source connection object is selected from the corresponding connection pool in the connection container, and the selected data source connection object is used to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved, and the selected thread is used to construct a search statement corresponding to the data retrieval request, and the search statement is sent to the back-end server connected to the front-end client, so that the back-end server performs a search operation according to the personalized search requirement and receives the search result returned by the back-end server.

[0009] In one embodiment, the configuration information of each data source includes: the access address, port, user name, password, version and authentication information of the data source; the metadata of each data source includes the index information and field information of the data table of the data source.

[0010] In one embodiment, the personalized retrieval requirements of each data source include index aliases corresponding to each index, field aliases corresponding to each field, target indexes corresponding to target index aliases selected by users from index aliases corresponding to index information in metadata of the data source, target fields corresponding to target field aliases selected by users from field aliases corresponding to field information in metadata of the data source, retrieval methods, and display order of fields; wherein the target fields are fields that need to be displayed on the front-end client;

[0011] Correspondingly, the back-end server performs a retrieval operation according to the personalized retrieval requirements, including: the back-end server searches the database according to the retrieval method, the target index and the target field, obtains the field data of the target field in the target data table corresponding to the target index, sorts each target field according to the display order, and returns the field data of each target field to the front-end client in the form of field data of the corresponding field alias.

[0012] In one embodiment, the personalized search requirement further includes: a data dictionary matching rule; correspondingly, the method further includes:

[0013] According to the data dictionary matching rule, the search result returned by the back-end server is converted to obtain a conversion result; it is determined whether there is sensitive information in the conversion result, and if so, the sensitive information is desensitized.

[0014] In one embodiment, the retrieval service configuration page also has a retrieval statement customization function, so that users can customize the required retrieval statements; the retrieval service configuration page also supports text highlighting of key information in user-defined retrieval statements, background highlighting of error information in user-defined retrieval statements, and format standardization of user-defined retrieval statements.

[0015] In one embodiment, before selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container, the method further includes:

[0016] Determine whether the connection container contains a connection pool corresponding to the data source corresponding to the data retrieval request;

[0017] If so, executing the steps of selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container;

[0018] If it does not exist, create a corresponding connection pool and at least one data source connection object, place the at least one data source connection object in the created connection pool, and set the validity period of the at least one data source connection object.

[0019] In one embodiment, the method further comprises:

[0020] Monitor the activity status and validity period of each data source connection object in each connection pool in the connection container. If it is detected that a data source connection object is in an inactive state and has exceeded the corresponding validity period, destroy the data source connection object and the thread occupied by the data source connection object itself.

[0021] According to the second aspect, the multi-data source retrieval device provided by the embodiment of the present invention is deployed on a front-end client, and the device includes:

[0022] A first providing module is used to provide a data source information creation page, so that the user can fill in the configuration information of at least one data source on the data source information creation page;

[0023] A connection test module is used to perform a connection test on each data source according to the configuration information of the data source, and obtain the metadata of the data source after the connection test passes;

[0024] A second providing module is used to provide a search service configuration page, so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page;

[0025] The data retrieval module is used to select a thread from the thread pool for the data retrieval request and a data source connection object from the corresponding connection pool in the connection container when receiving a data retrieval request, use the selected data source connection object to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved, use the selected thread to construct a search statement corresponding to the data retrieval request, send the search statement to the back-end server connected to the front-end client, so that the back-end server performs a search operation according to the personalized search requirement, and receives the search result returned by the back-end server.

[0026] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0027] According to a fourth aspect, an embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0028] In the multi-data source retrieval method, device, medium, and equipment provided by the embodiment of the present invention, the user fills in the configuration information of at least one data source on the data source information creation page, and then the front-end client performs a connection test on the data source according to the configuration information of each data source, and obtains the metadata of the data source after the connection test passes. Then the user configures the corresponding personalized retrieval requirements for each data source in the metadata displayed on the retrieval service configuration page. When the front-end client receives a data retrieval request, a thread is selected from the thread pool for the data retrieval request and a data source connection object is selected from the corresponding connection pool in the connection container, and the connection between the front-end client and the back-end server connected to the data source to be retrieved is established by using the selected data source connection object, and the retrieval statement corresponding to the data retrieval request is constructed by using the selected thread, and the retrieval statement is sent to the back-end server, so that the back-end server performs the retrieval operation according to the personalized retrieval requirement, and receives the retrieval result returned by the back-end server. The configuration information and personalized retrieval requirements can be configured by visual configuration, which can reduce the technical difficulty of developers, reduce development costs, and improve retrieval efficiency. Moreover, the embodiment of the present invention supports the creation of configuration information of multiple data sources, and does not require modification of related business codes, which is simple and convenient. When retrieval is needed, the data source connection object is obtained from the connection pool, thereby realizing the reuse of the data source connection object and reducing the time overhead and performance loss of establishing the data source connection object. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1It is a flowchart of a multi-data source retrieval method according to an embodiment of the present invention;

[0030] Figure 2 It is a structural block diagram of a multi-data source retrieval device in one embodiment of the present invention. DETAILED DESCRIPTION

[0031] In a first aspect, an embodiment of the present invention provides a multi-data source retrieval method, the method being executed by a front-end client, see Figure 1 The method comprises the following steps S110 to S140:

[0032] S110, providing a data source information creation page, so that the user can fill in configuration information of at least one data source on the data source information creation page;

[0033] The configuration information of each data source includes: the access address, port, user name, password, version and authentication information of the data source.

[0034] Here, the user refers to the developer. For example, the developer configures the configuration information of three data sources on the data source information creation page.

[0035] Of course, in addition to creating configuration information for a data source, you can also update, delete, and other operations on the configuration information that has already been created.

[0036] S120, performing a connection test on each data source according to the configuration information of the data source, and obtaining metadata of the data source after the connection test passes;

[0037] For example, the front-end client can use RestClient to send a Rest request to Elasticsearch to test the connection. If the connection is successful, you can save the operation; if the connection fails, the connection exception information is prompted. You can also generate a unique identifier for the data source based on the snowflake algorithm, and persist the unique identifier of the data source and the configuration information together in the database. When the configuration information of the data source is saved successfully, a metadata collection task is automatically created, and the metadata of the data source is obtained based on the metadata collection task. Specifically, you can use RestClient to send a Rest Api request to the Elasticsearch cluster to obtain metadata.

[0038] The metadata of each data source may include index information and field information of a data table of the data source.

[0039] S130, providing a search service configuration page, so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page;

[0040] Among them, the personalized retrieval requirements of each data source may include the index alias corresponding to each index, the field alias corresponding to each field, the target index corresponding to the target index alias selected by the user from the index alias corresponding to the index information in the metadata of the data source, the target field corresponding to the target field alias selected by the user from the field alias corresponding to the field information in the metadata of the data source, the retrieval method and the display order of the fields; wherein the target field is the field that needs to be displayed on the front-end client.

[0041] Among them, the search methods can include text exact matching, fuzzy search, value range matching and other search methods.

[0042] Among them, the index alias and field alias are the aliases of the index and field that are open to the outside world. In this way, when the index name and field name of the original data are modified, the field name provided to the outside world can be kept consistent and stable.

[0043] Specifically, users can select a saved data source on the search service configuration page, and then configure the corresponding index alias, field alias, target index, target field (i.e., open field), search method, and field sorting order for the selected data source. Of course, it can also include the data dictionary matching rules mentioned later. The target index refers to the index used when searching for data from the data source, and the target field refers to the field displayed to the front end after the search. Because there are multiple fields in a data table, not all fields are necessarily displayed. Some of the fields can be displayed, so this part of the fields is the target field. The sorting order of the fields refers to the sorting order of the target fields displayed on the front end.

[0044] It can be seen that the configuration of personalized retrieval requirements is achieved through visual configuration.

[0045] S140. When a data retrieval request is received, a thread is selected from the thread pool for the data retrieval request and a data source connection object is selected from the corresponding connection pool in the connection container. The selected data source connection object is used to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved. The selected thread is used to construct a search statement corresponding to the data retrieval request, and the search statement is sent to the back-end server connected to the front-end client, so that the back-end server performs a search operation according to the personalized search requirement, and receives the search result returned by the back-end server.

[0046] That is to say, when the front-end client receives a data retrieval request, it selects a thread from the thread pool and a data source connection object from the connection container for each data retrieval request. The function of the data source connection object is to establish a connection between the front-end client and the back-end server of the data source to be retrieved. The function of the thread is to execute the retrieval task. The process of executing the retrieval task generally includes: constructing a corresponding retrieval statement according to the data retrieval request and the personalized retrieval requirements of the data source to be retrieved, and then sending the retrieval statement to the back-end server, so that the back-end server will perform a retrieval operation according to the personalized retrieval requirements, obtain the retrieval results, and return the retrieval results to the front-end client.

[0047] Among them, the back-end server performs a retrieval operation according to the personalized retrieval requirements, which may include: the back-end server searches the database according to the retrieval method, the target index and the target field, obtains the field data of the target field in the target data table corresponding to the target index, sorts each target field according to the display order, and returns the field data of each target field to the front-end client in the form of field data of the corresponding field alias.

[0048] That is to say, the backend server will retrieve the field data corresponding to the target field in the data table corresponding to the target index according to the retrieval method, sort the field data of each target field in the display order, and then display the field data in the form of a field alias of the target field on the front-end client.

[0049] For example, by sending a search statement to the Elasticsearch cluster through the HighLevelClient method and obtaining the search results, users can check whether the search results meet expectations.

[0050] The search results returned by the backend server may be in JSON format.

[0051] In one embodiment, the retrieval service configuration page may also have a retrieval statement customization function to allow users to customize the required retrieval statements; the retrieval service configuration page also supports text highlighting of key information in user-defined retrieval statements, background highlighting of error information in user-defined retrieval statements, and format standardization of user-defined retrieval statements.

[0052] It can be seen that in actual scenarios, corresponding search statements can be constructed according to the data retrieval request and the personalized search requirements of the data source to be retrieved. Of course, users can also customize search statements as needed. Moreover, the search service configuration page can highlight the key information in the user-defined search statement, highlight the background color of the error message, and standardize the format of the user-defined search statement. It can be seen that based on the custom-built search statement, personalized search requests such as multi-index joint query and alias search can be realized.

[0053] In one embodiment, the personalized retrieval requirements may also include: data dictionary matching rules; correspondingly, the method further includes: converting the retrieval results returned by the back-end server according to the data dictionary matching rules to obtain conversion results; determining whether there is sensitive information in the conversion results, and if so, desensitizing the sensitive information.

[0054] For example, a data dictionary matching rule is 0 for male and 1 for female. According to the data dictionary matching rule, the original search results returned by the backend server are converted to obtain business data that is convenient for users to use, that is, the user sees data such as male and female. The conversion process can adopt an exact match or a regular expression match.

[0055] Among them, the desensitization processing methods can be replacement desensitization, simulation desensitization, random desensitization, encryption desensitization and other desensitization methods. By setting different fields in the data to be desensitized using different desensitization methods, the security of sensitive data can be protected and no leakage can be prevented.

[0056] In one embodiment, before selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container in S140, the method may further include:

[0057] Determine whether the connection container contains a connection pool corresponding to the data source corresponding to the data retrieval request;

[0058] If so, executing the steps of selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container;

[0059] If it does not exist, create a corresponding connection pool and at least one data source connection object, place the at least one data source connection object in the created connection pool, and set the validity period of the at least one data source connection object.

[0060] The connection container includes multiple connection pools, one connection pool corresponds to one data source, one connection pool has multiple data source connection objects, and one data source connection object corresponds to one data retrieval request for the data source corresponding to the connection pool.

[0061] Specifically, according to the unique identifier of the data source, determine whether there is a connection pool corresponding to the data source to be retrieved in the connection container. If so, select a data source connection object from the corresponding connection pool to retrieve the data retrieval request. If not, create a new connection pool and at least one data source connection object, and place the at least one data source connection object in the newly created connection pool. In order to ensure the high availability of the data source connection object, reduce the overhead of connection creation, and take into account the occupancy rate of memory resources, an expiration date can be set for each created data source connection object.

[0062] In one embodiment, the method may further include:

[0063] Monitor the activity status and validity period of each data source connection object in each connection pool in the connection container. If it is detected that a data source connection object is in an inactive state and has exceeded the corresponding validity period, destroy the data source connection object and the thread occupied by the data source connection object itself.

[0064] It can be seen that the activity status and validity period of each data source connection object in the connection pool are monitored. When a data source connection object is detected to be inactive and has exceeded its validity period, the data source connection object is destroyed. Since the use of the data source connection object also requires a thread, the thread occupied by the data source connection object itself is also destroyed.

[0065] The activity status refers to whether the data source connection object is in use.

[0066] The database of the backend server is an Elasticsearch cluster.

[0067] It can be seen that the embodiments of the present invention involve the creation of configuration information of data sources, the collection of metadata, the configuration of personalized search requirements, data retrieval, and the return of search results. Among them, the configuration information and personalized search requirements can be configured by visual configuration, which can reduce the technical difficulty of developers, reduce development costs, improve retrieval efficiency, and realize dynamic loading and dynamic destruction of data source configuration information. In addition, the embodiments of the present invention support user-defined search statements, which can realize more complex data retrieval and meet personalized needs. In addition, the embodiments of the present invention support customized rule conversion of search results, and convert the queried original data into business data that is more convenient for business use. In addition, when it is necessary to access the Elasticsearch cluster, the data source connection object can be obtained from the connection pool to realize the reuse of the data source connection object, and reduce the time overhead and performance loss of the establishment and destruction of the data source connection object. At the same time, the data source connection object is set with an effective time, and the effective period is refreshed after each acquisition. After the effective period is reached, the data source connection object is destroyed to reduce the invalid occupation of memory resources and network resources to achieve a balance between performance and resources.

[0068] In a second aspect, an embodiment of the present invention provides a multi-data source retrieval device, which is deployed on a front-end client. Figure 2 , the device 100 comprises:

[0069] A first providing module 110 is used to provide a data source information creation page, so that a user can fill in configuration information of at least one data source on the data source information creation page;

[0070] A connection test module 120 is used to perform a connection test on each data source according to the configuration information of the data source, and obtain metadata of the data source after the connection test passes;

[0071] The second providing module 130 is used to provide a search service configuration page, so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page;

[0072] The data retrieval module 140 is used to, when receiving a data retrieval request, select a thread from the thread pool for the data retrieval request and select a data source connection object from the corresponding connection pool in the connection container, use the selected data source connection object to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved, use the selected thread to construct a retrieval statement corresponding to the data retrieval request, send the retrieval statement to the back-end server connected to the front-end client, so that the back-end server performs a retrieval operation according to the personalized retrieval requirement, and receive the retrieval result returned by the back-end server.

[0073] In one embodiment, the configuration information of each data source includes: the access address, port, user name, password, version and authentication information of the data source; the metadata of each data source includes the index information and field information of the data table of the data source.

[0074] In one embodiment, the personalized retrieval requirements of each data source include index aliases corresponding to each index, field aliases corresponding to each field, target indexes corresponding to target index aliases selected by users from index aliases corresponding to index information in metadata of the data source, target fields corresponding to target field aliases selected by users from field aliases corresponding to field information in metadata of the data source, retrieval methods, and display order of fields; wherein the target field is a field that needs to be displayed on the front-end client; correspondingly, the back-end server performs a retrieval operation according to the personalized retrieval requirements, including: the back-end server searches the database according to the retrieval method, the target index, and the target field to obtain field data of the target field in the target data table corresponding to the target index, sorts each target field according to the display order, and returns the field data of each target field to the front-end client in the form of field data of the corresponding field alias.

[0075] In one embodiment, the personalized search requirement further includes: a data dictionary matching rule; correspondingly, the device further includes:

[0076] The data conversion module is used to convert the search results returned by the back-end server according to the data dictionary matching rules to obtain the conversion results; determine whether there is sensitive information in the conversion results, and if so, desensitize the sensitive information.

[0077] In one embodiment, the retrieval service configuration page also has a retrieval statement customization function, so that users can customize the required retrieval statements; the retrieval service configuration page also supports text highlighting of key information in user-defined retrieval statements, background highlighting of error information in user-defined retrieval statements, and format standardization of user-defined retrieval statements.

[0078] In one embodiment, before selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container, the data retrieval module is further used to: determine whether there is a connection pool corresponding to the data source corresponding to the data retrieval request in the connection container; if so, execute the steps of selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container; if not, create a corresponding connection pool and at least one data source connection object, place the at least one data source connection object in the created connection pool, and set the validity period of the at least one data source connection object.

[0079] In one embodiment, the device may further include:

[0080] The object destruction module is used to monitor the activity status and validity period of each data source connection object in each connection pool in the connection container. If it is detected that a data source connection object is in an inactive state and has exceeded the corresponding validity period, the data source connection object is destroyed and the thread occupied by the data source connection object itself is destroyed.

[0081] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0082] In a third aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0083] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0084] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0085] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0086] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0087] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0088] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0089] In a fourth aspect, an embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any embodiment of the specification.

[0090] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0091] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0092] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0093] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A multi-data source retrieval method, characterized in that: The method is executed by a front-end client, and the method includes: Providing a data source information creation page, so that the user can fill in the configuration information of at least one data source on the data source information creation page; According to the configuration information of each data source, a connection test is performed to the data source, and after the connection test passes, the metadata of the data source is obtained; Providing a search service configuration page so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page; When a data retrieval request is received, a thread is selected from the thread pool for the data retrieval request and a data source connection object is selected from the corresponding connection pool in the connection container, and the selected data source connection object is used to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved, and the selected thread is used to construct a search statement corresponding to the data retrieval request, and the search statement is sent to the back-end server connected to the front-end client, so that the back-end server performs a search operation according to the personalized search requirement and receives the search result returned by the back-end server.

2. The method according to claim 1, characterized in that The configuration information of each data source includes: the access address, port, user name, password, version and authentication information of the data source; the metadata of each data source includes the index information and field information of the data table of the data source.

3. The method according to claim 2, characterized in that The personalized retrieval requirements of each data source include the index aliases corresponding to each index, the field aliases corresponding to each field, the target index corresponding to the target index alias selected by the user from the index alias corresponding to the index information in the metadata of the data source, the target field corresponding to the target field alias selected by the user from the field alias corresponding to the field information in the metadata of the data source, the retrieval method and the display order of the fields; wherein the target field is the field that needs to be displayed on the front-end client; Correspondingly, the back-end server performs a retrieval operation according to the personalized retrieval requirements, including: the back-end server searches the database according to the retrieval method, the target index and the target field, obtains the field data of the target field in the target data table corresponding to the target index, sorts each target field according to the display order, and returns the field data of each target field to the front-end client in the form of field data of the corresponding field alias.

4. The method according to claim 3, characterized in that The personalized search requirement also includes: a data dictionary matching rule; correspondingly, the method also includes: According to the data dictionary matching rule, the search result returned by the back-end server is converted to obtain a conversion result; it is determined whether there is sensitive information in the conversion result, and if so, the sensitive information is desensitized.

5. The method according to claim 1, characterized in that The search service configuration page also has a search statement customization function, so that users can customize the required search statements; the search service configuration page also supports text highlighting of key information in user-defined search statements, background highlighting of error information in user-defined search statements, and format standardization of user-defined search statements.

6. The method according to claim 1, characterized in that Before selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container, the method further includes: Determine whether the connection container contains a connection pool corresponding to the data source corresponding to the data retrieval request; If so, executing the steps of selecting a thread from the thread pool for the data retrieval request and selecting a data source connection object from the corresponding connection pool in the connection container; If it does not exist, create a corresponding connection pool and at least one data source connection object, place the at least one data source connection object in the created connection pool, and set the validity period of the at least one data source connection object.

7. The method according to claim 6, characterized in that The method further comprises: Monitor the activity status and validity period of each data source connection object in each connection pool in the connection container. If it is detected that a data source connection object is in an inactive state and has exceeded the corresponding validity period, destroy the data source connection object and the thread occupied by the data source connection object itself.

8. A multi-data source retrieval device, characterized in that: The device is deployed on a front-end client, and includes: A first providing module is used to provide a data source information creation page, so that the user can fill in the configuration information of at least one data source on the data source information creation page; A connection test module is used to perform a connection test on each data source according to the configuration information of the data source, and obtain the metadata of the data source after the connection test passes; A second providing module is used to provide a search service configuration page, so that the user can configure corresponding personalized search requirements for each data source in the metadata displayed on the search service configuration page; The data retrieval module is used to select a thread from the thread pool for the data retrieval request and a data source connection object from the corresponding connection pool in the connection container when receiving a data retrieval request, use the selected data source connection object to establish a connection between the front-end client and the back-end server connected to the data source to be retrieved, use the selected thread to construct a search statement corresponding to the data retrieval request, send the search statement to the back-end server connected to the front-end client, so that the back-end server performs a search operation according to the personalized search requirement, and receives the search result returned by the back-end server.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that: The method comprises a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Search application data processing method and device, computer equipment and storage medium

    CN110276002A

  • Data retrieval method and device, computer readable storage medium and server

    CN114860998A

  • Visual data analysis method and device

    CN115017182A