A data retrieval method, device, equipment and storage medium
By obtaining the user's standard retrieval instructions, determining the data table name and retrieval conditions, and selecting the target index storage cluster for retrieval among multiple distributed storage clusters, the problem of retrieval complexity in multi-cluster mode is solved and efficient data processing is achieved. Retrieval and user experience improvements.
Patent Information
- Application Number
- CN202111391384.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-11-23
AI Technical Summary
In multi-cluster mode, existing technology cannot fully solve this problem of how to simply and efficiently retrieve key data from massive data from multiple distributed storage clusters.
By obtaining the user's standard retrieval instructions, determine the name of the data table to be retrieved and the retrieval conditions, select the target index storage cluster from the candidate index storage clusters based on the set table storage metadata, and send sub-index retrieval instructions to obtain the index processing results. The search results are finally returned, shielding the complexity of multi-cluster systems.
It achieves simple and efficient retrieval of key data from multiple distributed system clusters, improves data retrieval efficiency and enhances user experience.
Smart Images

Figure CN114064729B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a data retrieval method, device, equipment and storage medium. Background Art
[0002] In the era of big data, the scale of enterprise data is growing rapidly. Standalone relational databases can no longer meet the requirements of massive data storage and retrieval. Therefore, various distributed storage clusters have been introduced, such as ElasticSearch, SolrCloud, Hbase, TableStore and other common distributed storage clusters. By adopting a multi-cluster mode, we can cope with the ever-expanding data scale.
[0003] However, due to the different application characteristics of each cluster, in a multi-cluster mode, how to perform simple and efficient retrieval from multiple distributed storage clusters and retrieve key data from massive data is very important to users, but this has not been fully considered in the existing technology.
[0004] Therefore, there is an urgent need to improve the problems existing in the prior art. Summary of the invention
[0005] The present application provides a data retrieval method, apparatus, device and storage medium to shield the complexity of a multi-cluster system and improve data retrieval efficiency.
[0006] In a first aspect, an embodiment of the present application provides a data retrieval method, the method comprising:
[0007] Obtaining a standard search instruction sent by a user, and determining a name of a data table to be searched and a search condition according to the standard search instruction;
[0008] According to the data table name and the search condition, based on the setting table storage metadata, at least one target index storage cluster is selected from each candidate index storage cluster, and according to the standard search instruction, the sub-index search instruction corresponding to each target index storage cluster is determined;
[0009] Sending corresponding sub-index retrieval instructions to each of the target index storage clusters respectively, so that each of the target index storage clusters feeds back index processing results according to the corresponding sub-index retrieval instructions;
[0010] The search results returned to the user are determined according to the index processing results.
[0011] In a second aspect, an embodiment of the present application further provides a data retrieval device, the device comprising:
[0012] A search instruction acquisition module is used to acquire a standard search instruction sent by a user and determine the name of the data table to be searched and the search conditions according to the standard search instruction;
[0013] An index cluster determination module, configured to select at least one target index storage cluster from each candidate index storage cluster according to the data table name and the search condition and based on the setting table storage metadata, and determine the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction;
[0014] An index instruction sending module, used to send corresponding sub-index retrieval instructions to each of the target index storage clusters, so that each of the target index storage clusters feeds back index processing results according to the corresponding sub-index retrieval instructions;
[0015] The retrieval result returning module is used to determine the retrieval result to be returned to the user according to each of the index processing results.
[0016] In a third aspect, an embodiment of the present application further provides an electronic device, the device comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the data retrieval methods provided in the first aspect embodiment.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the data retrieval methods provided in the embodiment of the first aspect.
[0021] The embodiment of the present application obtains the standard search instruction sent by the user, and determines the name of the data table to be searched and the search conditions according to the standard search instruction; selects at least one target index storage cluster from each candidate index storage cluster based on the data table name and the search conditions and the metadata stored in the setting table, and determines the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction; sends the corresponding sub-index search instruction to each target index storage cluster respectively, so that each target index storage cluster can feedback the index processing result according to the corresponding sub-index search instruction; determines the search result returned to the user according to each index processing result. The above technical scheme shields the search complexity of multiple clusters and different distributed systems by providing a unified standard search instruction, which helps users to retrieve key data from multiple distributed system clusters of various categories simply and efficiently. At the same time, the search is performed in the corresponding target index storage cluster for the standard search instruction instead of in the original data set. Under the condition of meeting the basic search requirements, the data retrieval efficiency can be improved, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a data retrieval method provided in Example 1 of the present application;
[0023] Figure 2 is a flow chart of a data retrieval method provided in Example 2 of the present application;
[0024] Figure 3 is a schematic diagram of a data retrieval device provided in Embodiment 3 of the present application;
[0025] Figure 4 This is a schematic diagram of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0026] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0027] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a data retrieval method provided in Embodiment 1 of the present application. Embodiments of the present application may be applicable to the case where retrieval results are returned to a user according to a user retrieval instruction. The method may be executed by a data retrieval device, which may be implemented in software and / or hardware and specifically configured in an electronic device, which may be a mobile terminal or a fixed terminal.
[0030] See also Figure 1 , the data retrieval method provided in the embodiment of the present application includes:
[0031] S110: Obtain a standard search instruction sent by a user, and determine the name of the data table to be searched and the search conditions according to the standard search instruction.
[0032] Among them, the standard search instruction can be a SQL statement type search instruction. Of course, according to the requirements of program development and design, the standard search instruction can also be other types of search instructions to meet different search business requirements.
[0033] For example, taking the standard search instruction of SQL statement type as an example, the standard search instruction sent by the user can be: SELECT+column name to be queried+FROM+data table name+WHERE+search condition, where the column name to be queried can be the default column name in all data tables, or can be filled in by the user according to actual search needs, and SELECT, FROM and WHERE are the basic components of SQL statements.
[0034] In this embodiment, the name of the data table to be searched and the search conditions can be obtained by positioning or semantically identifying special letters or symbols in the standard search instructions.
[0035] Optionally, the user may also initiate a standard search instruction based on a local search client, and the search client sends the standard search instruction to a background search server to request the background search server to determine a corresponding search result according to the standard search instruction.
[0036] Optionally, a search may be performed in the user's local data cache according to a standard search instruction; if the local data cache is hit, the search result returned to the user is determined from the local data cache.
[0037] Specifically, the local data cache can be a Redis (Remote Dictionary Server) data cache, where Redis is an open source log-type key-value database written in standard C language, supporting the network, memory-based or persistent, and providing application programming interfaces in multiple languages.
[0038] In this embodiment, after obtaining the standard search instruction sent by the user, it is possible to first query whether there is a data record corresponding to the standard search instruction in the Redis data cache based on the standard search instruction; if so, the value of the data record is returned to the user as a search result; if not, access the database storing the Redis data cache backup to query whether there is a data record in the database; if so, copy the data record in the database to the Redis data cache, and return the value of the data record to the user as a search result.
[0039] It is understandable that by setting up a local data cache, retrieval efficiency can be improved, user waiting time can be reduced, and user experience can be improved.
[0040] S120. According to the data table name and the search condition, based on the setting table storage metadata, at least one target index storage cluster is selected from each candidate index storage cluster, and according to the standard search instruction, the sub-index search instruction corresponding to each target index storage cluster is determined.
[0041] In this embodiment, according to the requirement of fast retrieval, an index storage cluster developed based on Lucene index may be selected, wherein Lucene is a currently popular open source full-text retrieval toolkit written in JAVA language.
[0042] Specifically, each candidate index storage cluster may include an ElasticSearch cluster and / or a SolrCloud cluster, etc., that is, each candidate index storage cluster may be a heterogeneous hybrid cluster consisting of multiple ElasticSearch clusters or multiple SolrCloud clusters or multiple ElasticSearch clusters and SolrCloud clusters.
[0043] It is understandable that the composition of each candidate index storage cluster can be in various forms, and can be reasonably configured according to actual usage requirements and situations, such as considering retrieval cost and retrieval efficiency.
[0044] In this embodiment, the target index storage cluster can be selected and determined from various candidate index storage clusters based on the setting table storage metadata, according to the data table name and the search condition.
[0045] Among them, the setting table storage metadata can be predetermined according to the data storage requirements and design requirements, and the setting table storage metadata can be customized and generated according to the user's preset storage strategy. For example, there is a data set with a data table name of Table1, and its data volume is very large. When planning the storage of this data set, consider splitting the storage. You can choose 2 original data storage clusters D1 and D2 for storage, and build a data set index. Considering different data categories, you can choose 3 index storage clusters T1, T2 and T3 for storage. In the above data set storage process, by extracting the organizational storage relationship of the original data storage cluster and the index storage cluster for the data set, the setting table storage metadata can be formed.
[0046] It is understandable that by setting the table to store metadata, the storage method of the data can be quickly located, making it easier to search.
[0047] Specifically, considering the situation where data sets are split and stored, the target index storage cluster cannot be accurately located based on the data table name alone. Therefore, the search can be performed based on the data table name and the search condition at the same time to accurately find the target index storage cluster.
[0048] In this embodiment, the standard search instructions can be encapsulated into corresponding sub-index search instructions under each index storage cluster according to different index storage clusters, so as to facilitate accurate retrieval, that is, different index storage clusters can correspond to different sub-index search instructions.
[0049] S130 . Send corresponding sub-index retrieval instructions to each target index storage cluster respectively, so that each target index storage cluster feeds back index processing results according to the corresponding sub-index retrieval instructions.
[0050] The index processing result includes the original data record identifier and the key field set. The original data record identifier is used to locate the storage location of the original data, and the original data record identifier is unique; the key field set is used to provide fast retrieval that meets the set field retrieval requirements.
[0051] In this embodiment, the key field set includes at least one key field. Specifically, the key field set can be predetermined according to actual usage requirements and situations. For example, the key field set can include some important fields such as data statistics fields; or the key field set can include fields that are user-defined.
[0052] Preferably, the key field set may include fields that appear frequently in user searches. Specifically, the key field set may be determined based on user historical search logs.
[0053] It can be understood that by identifying the fields that appear frequently in user searches and saving them in the key field set, the search efficiency can be improved when performing data search.
[0054] S140: Determine the search results to be returned to the user based on the processing results of each index.
[0055] In this embodiment, each index processing result can be merged and the merged index processing result can be directly returned to the user. Alternatively, it can also be determined whether to search in the original data storage cluster based on each index processing result based on the user's operation instruction.
[0056] The embodiment of the present application obtains the standard search instruction sent by the user, and determines the name of the data table to be searched and the search conditions according to the standard search instruction; selects at least one target index storage cluster from each candidate index storage cluster based on the data table name and the search conditions and the metadata stored in the setting table, and determines the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction; sends the corresponding sub-index search instruction to each target index storage cluster respectively, so that each target index storage cluster can feedback the index processing result according to the corresponding sub-index search instruction; determines the search result returned to the user according to each index processing result. The above technical scheme shields the search complexity of multiple clusters and different distributed systems by providing a unified standard search instruction, which helps users to retrieve key data from multiple distributed system clusters of various categories simply and efficiently. At the same time, the search is performed in the corresponding target index storage cluster for the standard search instruction instead of in the original data set. Under the condition of meeting the basic search requirements, the data retrieval efficiency can be improved, thereby improving the user experience.
[0057] Embodiment 2
[0058] Figure 3 A flowchart of a data retrieval method provided in Embodiment 2 of the present application. This embodiment is an optimization of the above-mentioned scheme based on the above-mentioned embodiment.
[0059] Furthermore, the operation "determine the search field to be searched according to the standard search instruction" is added; accordingly, the operation "determine the search result to be returned to the user according to each of the index processing results" can be refined into "determine whether the search field exists in each of the index processing results; if so, obtain the search field value corresponding to the search field, and return the search field value to the user as the search result"; and the operation "if not, select at least one target original data storage cluster from each candidate original data storage cluster according to the record identifier in each of the index processing results, and determine the sub-data search instruction corresponding to each of the target original data storage clusters according to the record identifier; send the corresponding sub-data search instruction to each of the target original data storage clusters respectively, so that each of the target original data storage clusters feeds back the original data processing result according to the corresponding sub-index search instruction; determine the search result to be returned to the user according to each of the original data processing results" is added to clarify the specific content of the search result returned to the user.
[0060] The explanations of the terms that are the same as or corresponding to the above embodiments will not be repeated here.
[0061] See also Figure 3 , the data retrieval method provided in this embodiment includes:
[0062] S210: Obtain a standard search instruction sent by a user, and determine the name of the data table to be searched, search conditions, and search fields according to the standard search instruction.
[0063] The search fields can be pre-set by the user in the standard search command. For example, if the user wants to find the name, age and address of an employee with a mobile phone number "XX", the corresponding standard search command can be: SELECTname,age,address FROM employee WHERE phone='XX', where name,age,address are the corresponding name, age and address search fields, employee is the name of the employee data table, and phone='XX' is the search condition.
[0064] S220. According to the data table name and the search conditions, based on the setting table storage metadata, at least one target index storage cluster is selected from each candidate index storage cluster, and according to the standard search instruction, the sub-index search instruction corresponding to each target index storage cluster is determined.
[0065] In this embodiment, the setting table storage metadata can be generated according to the following methods: loading the cluster configuration file; obtaining index metadata from each candidate index storage cluster according to the index cluster connection parameters in the cluster configuration file; and obtaining original data metadata from each candidate original data storage cluster according to the original data cluster connection parameters in the cluster configuration file; organizing and merging the index metadata and the original data metadata according to the same data table and field principles to generate the setting table storage metadata.
[0066] The cluster connection parameters include the cluster host name, port and other connection parameters.
[0067] In this embodiment, the cluster configuration file may be generated when the data set storage planning is performed according to the storage strategy formulated by the user.
[0068] It can be understood that setting the table storage metadata as the basis for index storage cluster search provides data support.
[0069] S230 . Send corresponding sub-index retrieval instructions to each target index storage cluster respectively, so that each target index storage cluster feeds back index processing results according to the corresponding sub-index retrieval instructions.
[0070] S240: Determine whether there is a search field in each index processing result.
[0071] In this embodiment, a field matching method may be used to determine whether a search field exists in each index processing result. When the field matching degree satisfies a set matching degree threshold, it is considered that the search field exists in the index processing result.
[0072] S250: If yes, obtain the search field value corresponding to the search field, and return the search field value to the user as the search result.
[0073] In this embodiment, simple and fast queries can be performed based on the index storage cluster, which helps to improve retrieval performance.
[0074] S260: If not, then select at least one target original data storage cluster from each candidate original data storage cluster according to the record identifier in each index processing result, and determine the sub-data retrieval instruction corresponding to each target original data storage cluster according to the record identifier.
[0075] The record identifier uniquely records the location of the original data in the original data storage cluster. According to the different original data storage clusters, the sub-data retrieval instructions corresponding to each target original data storage cluster can be determined according to the record identifier to adapt to the retrieval requirements of each cluster.
[0076] In this embodiment, when the search field does not exist in each index processing result, in order to improve the accuracy of the search result, a further search may be performed in the target original data storage cluster based on the record identifier in each index processing result.
[0077] Optionally, according to the original data storage requirements, a cluster based on a NoSQL database can be selected, wherein a NoSQL database, also known as a non-relational database, is a collection of structured data storage methods, which can be in the form of key-value pairs, documents, images, and so on.
[0078] In this embodiment, each candidate original data storage cluster may include an Hbase cluster and / or an Alibaba Cloud TableStore cluster, etc., that is, each target original data storage cluster may be a heterogeneous hybrid cluster consisting of multiple Hbase clusters or multiple Alibaba Cloud TableStore clusters or multiple Hbase clusters and Alibaba Cloud TableStore clusters.
[0079] It is understandable that there are various forms of composition of each candidate raw data storage cluster, which can be reasonably configured according to actual usage requirements and situations, such as considering storage costs and specific business forms.
[0080] In this embodiment, the original data of the data table is stored in multiple NoSQL-based original data storage clusters, and the index of the data table is stored in multiple Lucene-based index storage clusters. It is not limited by the scale of a single cluster node. Each cluster can increase or decrease the number of clusters according to the data volume and performance requirements to adapt to various massive data processing scenarios.
[0081] It is understandable that the original data storage cluster and index storage cluster of the data table can support different distributed systems, even heterogeneous hybrid system clusters, which can make full use of the company's existing database resources and save costs. It is also convenient to introduce new distributed systems at any time to improve efficiency and reduce costs.
[0082] Optionally, the original data can also be partitioned to achieve uniform storage of large-scale data and avoid data skew, thereby effectively improving the speed of data query.
[0083] Specifically, when storing data, a hash calculation may be performed on the record identifier to evenly store the original data in the original data cluster.
[0084] S270 , sending corresponding sub-data retrieval instructions to each target raw data storage cluster respectively, so that each target raw data storage cluster feeds back raw data processing results according to the corresponding sub-index retrieval instructions.
[0085] In this embodiment, by sending corresponding sub-data retrieval instructions to each target original data storage cluster, the retrieval complexity under multiple clusters and different distributed systems is shielded, which helps users to retrieve key data from multiple distributed system clusters of various categories simply and efficiently.
[0086] Optionally, for each target original data storage cluster, the corresponding sub-data retrieval instruction is sent to the task message queue of the target original data storage cluster, so that the target original data storage cluster executes the retrieval task within the cluster according to the task message queue.
[0087] In this embodiment, considering that when each cluster executes a retrieval task, multiple users need to access the original data storage cluster at the same time, a high concurrency problem is inevitable. Therefore, in order to alleviate the retrieval pressure of each cluster, a queue can be used to store the sub-data retrieval instructions.
[0088] It can be understood that storing the sub-data retrieval instruction in the task message queue optimizes the processing mode of the retrieval task within the cluster.
[0089] S280: Determine the search results to be returned to the user based on the processing results of each original data.
[0090] Optionally, in the presence of at least two original data processing results, determining the retrieval result to be returned to the user based on each of the original data processing results includes: de-duplicating and merging the at least two original data processing results to obtain an intermediate data processing result; obtaining a retrieval field value corresponding to the retrieval field in the intermediate data processing result, and returning the retrieval field value as a retrieval result to the user.
[0091] In this embodiment, considering that the original data may be lost during the splitting and storage process, the original data may be redundantly stored. Accordingly, after obtaining the processing results of each original data, it is necessary to perform de-duplication and merging processing on each original data processing result.
[0092] It can be understood that, through the de-duplication and merging process, the integrity of the original data processing results is ensured, and the amount of data transmission on the network is reduced, thereby saving network bandwidth.
[0093] Based on the above embodiments, the embodiment of the present application clarifies the specific content of the search results returned to the user, by determining the search field to be searched according to the standard search instruction; correspondingly, according to each index processing result, determining the search results returned to the user, including: judging whether there is a search field in each index processing result; if so, obtaining the search field value corresponding to the search field, and returning the search field value to the user as the search result; if not, selecting at least one target original data storage cluster from each candidate original data storage cluster according to the record identifier in each index processing result, and determining the sub-data search instruction corresponding to each target original data storage cluster according to the record identifier; sending the corresponding sub-data search instruction to each target original data storage cluster respectively, so that each target original data storage cluster feeds back the original data processing result according to the corresponding sub-index search instruction; determining the search results returned to the user according to each original data processing result. The above technical scheme ensures the accuracy of the search results returned to the user by judging the index processing results. At the same time, when the index processing results do not meet the user's query requirements, the original data storage cluster can also be searched based on the record identifier, thereby improving the accuracy of the search results.
[0094] Embodiment 3
[0095] Figure 3 Schematic diagram of a data retrieval device provided in Example 3 of the present application. Figure 3 An embodiment of the present application provides a data retrieval device, which includes: a retrieval instruction acquisition module 310, an index cluster determination module 320, an index instruction sending module 330 and a retrieval result returning module 340.
[0096] The search instruction acquisition module 310 is used to acquire the standard search instruction sent by the user, and determine the name of the data table to be searched and the search condition according to the standard search instruction;
[0097] The index cluster determination module 320 is used to select at least one target index storage cluster from each candidate index storage cluster according to the data table name and the search condition and based on the setting table storage metadata, and determine the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction;
[0098] An index instruction sending module 330 is used to send corresponding sub-index retrieval instructions to each of the target index storage clusters, so that each of the target index storage clusters feeds back index processing results according to the corresponding sub-index retrieval instructions;
[0099] The search result returning module 340 is used to determine the search result to be returned to the user according to each of the index processing results.
[0100] The embodiment of the present application obtains the standard search instruction sent by the user, and determines the name of the data table to be searched and the search conditions according to the standard search instruction; selects at least one target index storage cluster from each candidate index storage cluster based on the data table name and the search conditions and the metadata stored in the setting table, and determines the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction; sends the corresponding sub-index search instruction to each target index storage cluster respectively, so that each target index storage cluster can feedback the index processing result according to the corresponding sub-index search instruction; determines the search result returned to the user according to each index processing result. The above technical scheme shields the search complexity of multiple clusters and different distributed systems by providing a unified standard search instruction, which helps users to retrieve key data from multiple distributed system clusters of various categories simply and efficiently. At the same time, the search is performed in the corresponding target index storage cluster for the standard search instruction instead of in the original data set. Under the condition of meeting the basic search requirements, the data retrieval efficiency can be improved, thereby improving the user experience.
[0101] Furthermore, the device also includes:
[0102] The search field parsing module is used to determine the search field to be searched according to the standard search instruction; accordingly, the search result returning module 340 includes:
[0103] A judgment submodule, used for judging whether the search field exists in each of the index processing results;
[0104] The field value returning submodule is used to obtain the search field value corresponding to the search field if yes, and return the search field value to the user as the search result.
[0105] Furthermore, the device also includes:
[0106] a data cluster determination submodule, for, if not, selecting at least one target original data storage cluster from each candidate original data storage cluster according to the record identifier in each index processing result, and determining the sub-data retrieval instruction corresponding to each target original data storage cluster according to the record identifier;
[0107] A retrieval instruction sending submodule is used to send corresponding sub-data retrieval instructions to each of the target raw data storage clusters, so that each of the target raw data storage clusters feeds back raw data processing results according to the corresponding sub-index retrieval instructions;
[0108] The search result returning submodule is used to determine the search result to be returned to the user according to each of the original data processing results.
[0109] Furthermore, in the case where there are at least two original data processing results, the search result returning submodule includes:
[0110] a de-duplication and merging unit, configured to de-duplication and merge the at least two original data processing results to obtain an intermediate data processing result;
[0111] The field value returning unit is used to obtain the search field value corresponding to the search field in the intermediate data processing result, and return the search field value as the search result to the user.
[0112] Furthermore, the device further comprises a metadata generation module, the metadata generation module comprising a configuration file loading submodule, a metadata acquisition submodule and the organization merging submodule;
[0113] The configuration file loading submodule is used to load the cluster configuration file;
[0114] The metadata acquisition submodule is used to acquire index metadata from each of the candidate index storage clusters according to the index cluster connection parameters in the cluster configuration file; and to acquire raw data metadata from each of the candidate raw data storage clusters according to the raw data cluster connection parameters in the cluster configuration file;
[0115] The organization and merging submodule is used to organize and merge the index metadata and the original data metadata according to the same data table and field principles to generate setting table storage metadata.
[0116] Furthermore, the device also includes:
[0117] The message queue execution module is used to send the corresponding sub-data retrieval instruction to the task message queue of each target original data storage cluster, so that the target original data storage cluster executes the retrieval task within the cluster according to the task message queue.
[0118] Furthermore, the device also includes:
[0119] A local cache query module, used to search in the user's local data cache according to the standard search instruction;
[0120] The return result determination module is used to determine the search result to be returned to the user from the local data cache if the local data cache is hit.
[0121] The data retrieval device provided in the embodiments of the present application 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.
[0122] Embodiment 4
[0123] Figure 4 This is a structural diagram of an electronic device provided in Example 4 of the present application. Figure 4 A block diagram of an exemplary electronic device 412 suitable for implementing embodiments of the present application is shown. Figure 4 The electronic device 412 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0124] like Figure 4 As shown, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors or processing units 416, a system memory 428, and a bus 418 connecting different system components (including the system memory 428 and the processing unit 416).
[0125] Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0126] The electronic device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 412, including volatile and non-volatile media, removable and non-removable media.
[0127] The system memory 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. The electronic device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 434 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 via one or more data medium interfaces. System memory 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0128] A program / utility 440 having a set (at least one) of program modules 442 may be stored, for example, in system memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 442 generally perform the functions and / or methods of the embodiments described herein.
[0129] The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboards, pointing devices, displays 424, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 412, and / or may communicate with any device that enables the electronic device 412 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 422. Furthermore, the electronic device 412 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 420. As shown, the network adapter 420 communicates with other modules of the electronic device 412 via a bus 418. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 412, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0130] The processing unit 416 executes various functional applications and data processing by running at least one of the other programs among the multiple programs stored in the system memory 428, such as implementing any data retrieval method provided in the embodiments of the present application.
[0131] Embodiment 5
[0132] Embodiment five of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data retrieval method provided by any embodiment of the present application, the method comprising: obtaining a standard retrieval instruction sent by a user, and determining the name of a data table to be retrieved and a retrieval condition according to the standard retrieval instruction; selecting at least one target index storage cluster from each candidate index storage cluster based on the metadata stored in a setting table according to the data table name and the retrieval condition, and determining the sub-index retrieval instruction corresponding to each target index storage cluster according to the standard retrieval instruction; sending corresponding sub-index retrieval instructions to each target index storage cluster respectively, so that each target index storage cluster feeds back an index processing result according to the corresponding sub-index retrieval instruction; and determining the retrieval result returned to the user according to each index processing result.
[0133] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0134] It is worth noting that in the embodiment of the above-mentioned data retrieval device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0135] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A data retrieval method, It is characterized in that include: Obtaining a standard search instruction sent by a user, and determining a name of a data table to be searched and a search condition according to the standard search instruction; According to the data table name and the search condition, based on the setting table storage metadata, at least one target index storage cluster is selected from each candidate index storage cluster, and according to the standard search instruction, the sub-index search instruction corresponding to each target index storage cluster is determined; Sending corresponding sub-index retrieval instructions to each of the target index storage clusters respectively, so that each of the target index storage clusters feeds back index processing results according to the corresponding sub-index retrieval instructions; wherein the index processing results include original data record identifiers and key field sets, the original data record identifiers are used to locate the storage location of the original data, and the key field set is used to provide fast retrieval that meets the set field retrieval requirements; Determining the search results to be returned to the user according to the index processing results; The method further comprises: Determining the search field to be searched according to the standard search instruction; Correspondingly, determining the search results to be returned to the user according to the index processing results includes: Determining whether the search field exists in each of the index processing results; If yes, obtaining a search field value corresponding to the search field, and returning the search field value to the user as a search result; If not, selecting at least one target raw data storage cluster from each candidate raw data storage cluster according to the record identifier in each index processing result, and determining the sub-data retrieval instruction corresponding to each target raw data storage cluster according to the record identifier; Sending corresponding sub-data retrieval instructions to each of the target raw data storage clusters respectively, so that each of the target raw data storage clusters feeds back raw data processing results according to the corresponding sub-index retrieval instructions; The search results returned to the user are determined according to the processing results of each of the original data.
2. The method according to claim 1, It is characterized in that In the case where there are at least two original data processing results, determining the search result to be returned to the user according to each of the original data processing results includes: De-duplication and merging the at least two original data processing results to obtain an intermediate data processing result; A search field value corresponding to the search field is obtained from the intermediate data processing result, and the search field value is returned to the user as a search result.
3. The method according to claim 1, It is characterized in that The setting table storage metadata is generated in the following manner: Load the cluster configuration file; Acquire index metadata from each of the candidate index storage clusters according to the index cluster connection parameters in the cluster configuration file; and acquire raw data metadata from each of the candidate raw data storage clusters according to the raw data cluster connection parameters in the cluster configuration file; According to the same data table and field principle, the index metadata and the original data metadata are organized and merged to generate setting table storage metadata.
4. The method according to claim 1, It is characterized in that The method further comprises: For each target original data storage cluster, the corresponding sub-data retrieval instruction is sent to the task message queue of the target original data storage cluster, so that the target original data storage cluster executes the retrieval task within the cluster according to the task message queue.
5. The method according to claim 1, It is characterized in that The method further comprises: Searching in the user's local data cache according to the standard search instruction; If the local data cache is hit, the search result returned to the user is determined from the local data cache.
6. A data retrieval device, It is characterized in that include: A search instruction acquisition module is used to acquire a standard search instruction sent by a user and determine the name of the data table to be searched and the search conditions according to the standard search instruction; An index cluster determination module, configured to select at least one target index storage cluster from each candidate index storage cluster according to the data table name and the search condition and based on the setting table storage metadata, and determine the sub-index search instruction corresponding to each target index storage cluster according to the standard search instruction; An index instruction sending module, used to send corresponding sub-index retrieval instructions to each of the target index storage clusters, so that each of the target index storage clusters feeds back index processing results according to the corresponding sub-index retrieval instructions; wherein the index processing results include an original data record identifier and a key field set, the original data record identifier is used to locate the storage location of the original data, and the key field set is used to provide a fast retrieval that meets the set field retrieval requirements; A search result returning module, used to determine the search results to be returned to the user according to the index processing results; The device also includes: The search field parsing module is used to determine the search field to be searched according to the standard search instruction; correspondingly, the search result returning module includes: A judgment submodule, used for judging whether the search field exists in each of the index processing results; A field value returning submodule, for obtaining a search field value corresponding to the search field if yes, and returning the search field value as a search result to the user; a data cluster determination submodule, for, if not, selecting at least one target original data storage cluster from each candidate original data storage cluster according to the record identifier in each index processing result, and determining the sub-data retrieval instruction corresponding to each target original data storage cluster according to the record identifier; A retrieval instruction sending submodule is used to send corresponding sub-data retrieval instructions to each of the target raw data storage clusters, so that each of the target raw data storage clusters feeds back raw data processing results according to the corresponding sub-index retrieval instructions; The search result returning submodule is used to determine the search result to be returned to the user according to each of the original data processing results.
7. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement a data retrieval method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, a data retrieval method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Multi-source data retrieval method and device, equipment and storage medium
CN113297251A
