Query and storage method, device and equipment based on database cluster

By using an index server to filter target storage areas and nodes in a large-scale timing database cluster, the problem of difficult to narrow the query scope is solved, query efficiency and accuracy are improved, and computing resource utilization is optimized.

CN113886434BActive Publication Date: 2025-08-15BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111286480.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2025-08-15
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

In the case of data torrent, large-scale timing database clusters are difficult to quickly lock data nodes, resulting in difficulty in query fan-out control, high network communication costs, and low query efficiency and accuracy.

Method used

Through the root index server and the area index server, the target storage area and storage nodes are filtered out using the index information directory, narrowing the query scope, improving query efficiency and accuracy, and optimizing computing resource utilization.

Benefits of technology

It realizes efficient query in large-scale database clusters, reduces network communication costs, improves query accuracy and computing resource utilization, and reduces dependence on network topology and IDC.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886434B_ABST
    Figure CN113886434B_ABST
Patent Text Reader

Abstract

The present disclosure provides a query and storage method, apparatus, and device based on a database cluster, relating to the field of computer technology, and in particular, to the field of big data and database management. A specific implementation scheme is as follows: determining target index information based on the query conditions of a query request; utilizing a root index server to determine a target storage area corresponding to the target index information from multiple storage areas; determining a target storage node corresponding to the target index information from multiple storage nodes included in the target storage area; and sending the query request to the target storage node to obtain the target data. The technology disclosed herein improves query efficiency and query accuracy, and improves the utilization rate of computing resources of the database cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to the field of big data and database management technology. Background Art

[0002] The current booming Internet of Things (IoT) technology generates massive amounts of time-series data. One of the main challenges facing large-scale time-series database clusters is the data deluge. Due to the high speed of data writes and constant updates, index maintenance is unsuitable. In this context, quickly locking data within the node range of the cluster and controlling query fan-out in large-scale clusters are crucial to handle large numbers of queries. Summary of the Invention

[0003] The present disclosure provides a query and storage method, apparatus, and device based on a database cluster.

[0004] According to one aspect of the present disclosure, a query method based on a database cluster is provided, comprising:

[0005] Determine target index information according to the query conditions of the query request;

[0006] Using the root index server, determining a target storage area corresponding to the target index information from a plurality of storage areas;

[0007] Determining a target storage node corresponding to the target index information from a plurality of storage nodes included in the target storage area;

[0008] Send the query request to the target storage node to obtain the target data.

[0009] According to another aspect of the present disclosure, a storage method based on a database cluster is provided, comprising:

[0010] Get index information of stored data;

[0011] Associating the index information of the stored data with the node number of the storage node storing the stored data, and storing the information in the sub-index information directory of the regional index server; and

[0012] The index information of the stored data and the area number of the storage area storing the stored data are associated with each other and stored in the index information directory of the root index server.

[0013] According to another aspect of the present disclosure, a query device based on a database cluster is provided, comprising:

[0014] A target index information determination module, configured to determine target index information according to a query condition of a query request;

[0015] a target storage area determination module, configured to determine a target storage area corresponding to the target index information from a plurality of storage areas using a root index server;

[0016] A target storage node determination module, configured to determine a target storage node corresponding to the target index information from a plurality of storage nodes included in the target storage area;

[0017] The target data acquisition module is used to send the query request to the target storage node to obtain the target data.

[0018] According to another aspect of the present disclosure, a storage device based on a database cluster is provided, comprising:

[0019] An index information acquisition module is used to obtain index information of stored data;

[0020] a sub-index information directory storage module, configured to associate index information of stored data with node numbers of storage nodes storing the stored data, and store the associated information in the sub-index information directory of the regional index server; and

[0021] The index information directory module is used to associate the index information of the stored data with the area number of the storage area storing the stored data, and store the associated information in the index information directory of the root index server.

[0022] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0023] at least one processor; and

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

[0025] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method in any embodiment of the present disclosure.

[0026] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method in any embodiment of the present disclosure.

[0027] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method in any embodiment of the present disclosure when executed by a processor.

[0028] According to the technology disclosed in the present invention, multiple storage areas and multiple storage nodes in a storage area can be screened in sequence, thereby narrowing the query scope of the database cluster. This solves the technical problem in related technologies that sequential access throughput cannot be improved or overcome due to network communication costs (such as network delays and network failures), improves query efficiency and query accuracy, and makes the sequential access throughput of the database cluster unaffected by cross-IDC (Internet Data Center) and network topology, greatly improving the utilization of computing resources by the database cluster.

[0029] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0031] Figure 1 A flowchart illustrating a query method based on a database cluster according to an embodiment of the present disclosure is shown;

[0032] Figure 2 A specific flow chart showing the determination of target index information of the query method based on database cluster according to an embodiment of the present disclosure is shown;

[0033] Figure 3 A specific flow chart showing a method for determining a target storage area based on a query method of a database cluster according to an embodiment of the present disclosure is shown;

[0034] Figure 4 A specific flow chart showing a method for determining a target storage node based on a database cluster query according to an embodiment of the present disclosure is shown;

[0035] Figure 5 A specific flow chart showing a method for determining a target storage node based on a database cluster query according to an embodiment of the present disclosure is shown;

[0036] Figure 6 A specific flow chart of obtaining target data according to a query method based on a database cluster according to an embodiment of the present disclosure is shown;

[0037] Figure 7 A flowchart illustrating a storage method based on a database cluster according to an embodiment of the present disclosure is shown;

[0038] Figure 8 A specific flow chart showing the acquisition of index information based on the database cluster storage method according to an embodiment of the present disclosure is shown;

[0039] Figure 9 A specific flow chart of storing data to be stored according to a storage method based on a database cluster according to an embodiment of the present disclosure is shown;

[0040] Figure 10 A block diagram of a query device based on a database cluster according to an embodiment of the present disclosure is shown;

[0041] Figure 11 A block diagram of a storage device based on a database cluster according to an embodiment of the present disclosure is shown;

[0042] Figure 12 It is a block diagram of an electronic device for implementing the query and / or storage method based on database cluster according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0044] Refer to the following Figures 1 to 5 A query method based on a database cluster according to an embodiment of the present disclosure is described.

[0045] like Figure 1 As shown, the query method of the database cluster according to the embodiment of the present disclosure specifically includes the following steps:

[0046] S101: Determine target index information according to the query conditions of the query request;

[0047] S102: using the root index server, determining a target storage area corresponding to the target index information from multiple storage areas;

[0048] S103: Determine a target storage node corresponding to the target index information from a plurality of storage nodes included in the target storage area;

[0049] S104: Send the query request to the target storage node to obtain the target data.

[0050] The query method for a database cluster according to the embodiment of the present disclosure can be applied to a time series database cluster.

[0051] For example, the database cluster may include multiple storage areas, each storage area includes multiple storage nodes, and each storage node stores a certain amount of time series data. The storage node may be a computer host device.

[0052] Among them, the database cluster can be a large-scale time series database cluster, for example, it can include more than 100,000 storage nodes. The database cluster can store PB (Petabytes) level data, that is, 2^50 bytes of data, and can consume TB (Terabyte) level data, that is, 2^40 bytes of data per second, providing millions of query services per second.

[0053] For example, in step S101, a query request may be received by a query server of a database cluster, wherein the query condition of the query request may specifically be a query string. Target index information is information related to the target data requested by the query request, for example, summary information of the target data. The target index information may be obtained by performing appropriate text processing on the query string.

[0054] Illustratively, in step S102, the database cluster may include an index server cluster, which may include a root index server. The root index server pre-stores an index information directory, which includes the region ID of each storage region and index information of the data stored in each storage region. The root index server is configured to filter all storage regions based on the target index information and the index information directory, thereby obtaining the storage region storing the target index information in the index information directory, and thereby obtaining the target storage region.

[0055] The region number of each storage region and the index information of its stored data may be sent and stored to the root storage node via the region index server corresponding to the storage region after the stored data of the storage region is stored in the storage node.

[0056] It should be noted that, in step S102 , the number of the determined target storage areas may be one or more.

[0057] Exemplarily, in step S103, the index server cluster further includes regional index servers corresponding to the plurality of storage areas. The regional index servers pre-store a sub-index information directory, which includes the node number of each storage node in the storage area corresponding to the regional index server and index information of the data stored in each storage node. The regional index server is configured to filter all storage nodes in the target storage area based on the target index information and the sub-index information directory, thereby obtaining the storage nodes storing the target index information in the sub-index information directory, and thereby obtaining the target storage node.

[0058] Among them, the index information of the storage data stored in each storage node and the delimited number of the storage node can be sent and stored to the regional index server corresponding to the storage area where the storage node is located through the corresponding storage node after the storage data is stored in the storage node.

[0059] It should be noted that if multiple target storage areas are determined in step S102, step S102 is performed for each target storage area. In addition, in step S103, the number of target storage nodes determined for each target storage area may be one or more.

[0060] Exemplarily, in step S104, after determining at least one target storage node, the query request can be distributed to the target storage area using the root query server, and then the query request is distributed to the target storage node through the regional query server of the target storage area. The target storage node performs query processing in response to the query request, obtains the corresponding query result and feeds back the query result to the regional query server, and then the regional query server feeds back the query result to the root query server, and finally the target data is obtained through the root query server.

[0061] In one specific example, all stored data in a database cluster is split and stored in at least one storage area, and the storage area includes multiple storage nodes. The stored data is further split and stored in at least one storage node in the storage area. The query server receives a query request, obtains target index information based on the query conditions of the query request, and then uses the index information of the storage data of each storage area pre-stored in the root index server and the area number of each storage area to filter and select the multiple storage areas to determine the target storage area corresponding to the target index information. The query server then uses the index information of the storage data of each storage node of the regional index server corresponding to the target storage area and the node number of each storage node to determine the target storage node corresponding to the target index information from the multiple storage nodes. Finally, the query server distributes the query request to the target storage node, receives the query result of the target storage node, and obtains the target data to be accessed by the query request.

[0062] According to the query method based on the database cluster of the embodiment of the present disclosure, the target index information is determined according to the query conditions of the query request, and the root index server is used to filter and screen multiple storage areas based on the target index information, so as to determine the target storage area corresponding to the target index information, and then the target storage node is further determined from the multiple storage nodes of the target storage area according to the target index information. Thus, the multiple storage areas and the multiple storage nodes of the storage areas can be screened in turn, thereby narrowing the query scope of the database cluster, solving the technical problems in the related art that the sequential access throughput cannot be improved and is difficult to break through due to network communication costs (such as network delays and network failures), improving the query efficiency and query accuracy, and making the sequential access throughput of the database cluster unaffected by cross-IDC (Internet Data Center) and network topology, greatly improving the utilization rate of computing resources of the database cluster.

[0063] like Figure 2 As shown, in one embodiment, step S101 includes:

[0064] S201: Determine the key value contained in the query condition character string;

[0065] S202: Perform N-word segmentation processing on the key value to obtain target index information, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2.

[0066] Exemplarily, the target index information may be summary information of the target data to be accessed by the query request. Specifically, keywords may be extracted from the query condition character string to obtain the key value corresponding to the keyword. For example, the query condition character string containing the keyword "service" is "service=baikalDB", and the keyword "service" in the character string is extracted to obtain the key value "baikalDB". The key value is then subjected to N-word segmentation processing, where N may be 3. By performing three-part word segmentation processing on the key value, a three-part phrase having multiple three-part words is obtained, namely "^^b,^ba,bai,aik,kal,alD,DB$,B$$", and the three-part phrase is the target index information corresponding to the query request.

[0067] It should be noted that when storing data, the log data of the stored data may be processed accordingly using the same or similar steps as steps S201 and S202 to obtain index information of the stored data, and then the index information is sent and stored to the index server.

[0068] For example, the index information of the storage data stored by the storage node can be obtained based on the log data of the storage data. The log data of the storage data includes the fields "service, reqId, time, errorinfo". The string containing the keyword "service" in the log data is extracted and the string is segmented into three parts to obtain the index information of the storage data.

[0069] According to the above embodiment, by performing N-word segmentation processing on the query condition character string, the target index information of the query condition can be generated, and the target index information is matched with the index information of the pre-stored storage data, so as to efficiently determine the target storage area and target storage node where the target data to be accessed by the query request is located.

[0070] like Figure 3 As shown, in one embodiment, the root index server includes a root filter, and the root filter pre-stores an index information directory corresponding to each storage area. Step S102 includes:

[0071] S301: Filter multiple storage areas using a root filter according to target index information and an index information directory to obtain a target storage area.

[0072] For example, in step S301, the index information directory pre-stores the region number of each storage region and the index information of the storage data stored in each storage region. The root filter matches the target index information with the index information of the storage data in each storage region stored in the index information directory, and filters the storage regions corresponding to the index information directories that do not contain the target index information. The root filter then selects the remaining storage regions, i.e., the storage regions corresponding to the index information directories that contain the target index information, as the target storage regions.

[0073] Through the above implementation, the target storage area associated with the target index information can be screened out from multiple storage areas, thereby quickly filtering out storage areas that do not meet the query conditions for the query request, preliminarily narrowing the query scope and improving query efficiency.

[0074] like Figure 4 As shown, in one embodiment, step S103 includes:

[0075] S401: Determine a target storage node using a regional index server corresponding to a target storage area.

[0076] Exemplarily, each storage area corresponds to a regional index server. The regional index server pre-stores index information for the storage data of all storage nodes in the storage area. The regional index server of the target storage area matches the target index information with the index information of all storage data corresponding to the target storage area to filter the multiple storage nodes included in the storage area, and ultimately determines the target storage node from the multiple storage nodes in the target storage area.

[0077] According to the above embodiment, by utilizing the regional index server, the target storage node associated with the target index information can be quickly and efficiently determined from multiple storage nodes in the target storage area, thereby further narrowing the query scope and further improving the query efficiency.

[0078] like Figure 5 As shown, in one embodiment, the regional index server includes a node filter, and the node filter pre-stores a sub-index information directory corresponding to each storage node; step S103 includes:

[0079] S501: Filter multiple storage nodes included in a target storage area using a node filter according to target index information and a sub-index information directory to obtain a target storage node.

[0080] Exemplarily, the sub-index information directory corresponding to the storage area may include index information of the storage data of all storage nodes in the storage area and the node number of each storage node. The node filter corresponding to the target storage area matches the target index information and the sub-index information directory to filter multiple storage nodes in the target storage area, thereby obtaining a target storage node associated with the target index information.

[0081] It can be understood that the index information of the storage data of each storage node pre-stored in the sub-index information directory can be fed back by the storage node to the regional index server after the storage data is stored in the storage node, and then the regional index server stores the index information to the node filter.

[0082] According to the above embodiment, by constructing a node filter in the regional index server, and the node filter includes the index information of the storage data of all storage nodes in the storage area, it is possible to quickly filter multiple storage nodes in the target storage area, thereby quickly determining the target storage node associated with the target index information, and improving the screening efficiency of the target storage node.

[0083] like Figure 6 As shown, in one embodiment, step S104 includes:

[0084] S601: Distribute the query request to each target storage node using the query server;

[0085] S602: Receive query results of each target storage node, and obtain target data according to each query result.

[0086] Exemplarily, after receiving a query request, the query server uses the root index server and regional index server to determine the target storage area and target storage node, respectively. It then breaks the query request into multiple sub-query requests and distributes each of these sub-query requests to the corresponding target storage nodes. In response to the sub-query requests, the storage node executes the query, obtains the query results, and feeds the query results back to the query server. Based on the query results fed back by each target storage node, the query server obtains the target data to be accessed by the query request.

[0087] Through the above implementation, it is possible to quickly query the target data to be accessed by the query request, and recall all the data stored in each target storage node without accessing all the storage nodes of the database cluster. This reduces the network communication cost when querying the database cluster and improves the utilization rate of network resources.

[0088] According to an embodiment of the present disclosure, a storage method for a database cluster is also provided.

[0089] like Figure 7 As shown, the storage method of the database cluster according to the embodiment of the present disclosure specifically includes the following steps:

[0090] S701: Obtain index information of stored data;

[0091] S702: Associating the index information of the stored data with the node number of the storage node storing the stored data, and storing the information in the sub-index information directory of the regional index server; and

[0092] S703: Associating the index information of the stored data with the area number of the storage area storing the stored data, and storing the information in the index information directory of the root index server.

[0093] Exemplarily, in step S701, the index information of the stored data may be summary information of the stored data. For example, after the data to be stored is stored in the storage node, the storage node may segment the string of the log data of the stored data to obtain the index information of the stored data.

[0094] Illustratively, in step S702, the storage node sends index information of stored data and the node ID of the storage node to the regional index server of the storage area where the storage node is located, and stores the information in the sub-index information directory of the node filter of the regional index server.

[0095] Illustratively, in step S703, the regional index server sends the index information of the stored data and the region number of the storage region corresponding to the regional index server to the root index server, and stores the information in the index information directory of the root filter of the root index server.

[0096] According to the storage method of the database cluster of the embodiment of the present disclosure, after the data is stored in the storage node, the index information corresponding to the stored data is stored in the sub-index information directory and the index information directory respectively. Therefore, when querying the database cluster, the pre-stored index information directory and the sub-index information directory can be used to filter out the target storage area and the target storage node respectively, thereby narrowing the query scope, achieving a quick response to the query request, reducing the occupancy of network resources during the query process, and improving the utilization rate of network resources.

[0097] like Figure 8 As shown, in one embodiment, obtaining index information of stored data includes:

[0098] S801: Obtain log data corresponding to the stored data;

[0099] S802: Perform N-word segmentation processing on the log data to obtain index information of the stored data, where the N-word segmentation includes N characters, and N is greater than or equal to 2.

[0100] Exemplarily, in step S801, index information for the stored data can be obtained based on the log data of the stored data. For example, if the log data of the stored data includes field information such as "service, reqId, time, errorinfo," a string containing the keyword "service" is extracted from the log data and the string is segmented into three parts to obtain the index information for the stored data.

[0101] According to the above embodiment, the index information of the stored data can be obtained by performing a simple segmentation process on the log data corresponding to the stored data, which is beneficial to simplifying the sub-index information directory and the index information directory.

[0102] like Figure 9 As shown, in one embodiment, the method further includes:

[0103] S901: Receive the data to be stored by using a data receiving router, and send the data to be stored to a node router;

[0104] S902: Using a node router, according to the status information of the storage nodes in each storage area, the data to be stored is stored in the storage nodes of the corresponding storage area to obtain the stored data.

[0105] It can be understood that each storage area corresponds to a node router, and the data receiving router performs data communication with the node router corresponding to each storage area.

[0106] In one specific example, each storage area is further provided with a corresponding node allocator. The node allocator is configured to periodically collect status information of each storage node within the storage area, such as the amount of stored data, processor information, and storage information of the storage node. Based on the status information of each storage node, the node allocator determines the optimal storage node corresponding to the data to be stored from multiple storage nodes, and then stores the data to be stored in the optimal storage node through a node router.

[0107] Through the above implementation, load balancing of multiple storage nodes in a storage area can be achieved, and reasonable allocation of storage resources in a large-scale database cluster can be achieved.

[0108] According to an embodiment of the present disclosure, a query device based on a database cluster is also provided.

[0109] like Figure 10 As shown, the query device based on the database cluster according to an embodiment of the present disclosure includes:

[0110] The target index information determination module 1001 is used to determine the target index information according to the query conditions of the query request;

[0111] The target storage area determination module 1002 is configured to determine a target storage area corresponding to the target index information from multiple storage areas using a root index server;

[0112] The target storage node determination module 1003 is configured to determine a target storage node corresponding to the target index information from a plurality of storage nodes included in the target storage area;

[0113] The target data acquisition module 1004 is used to send the query request to the target storage node to obtain the target data.

[0114] In one embodiment, the target index information determination module 1001 includes:

[0115] The key value determination submodule determines the key value contained in the query condition string;

[0116] The target index information generation submodule is used to perform N-word segmentation processing on the key value to obtain target index information, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2.

[0117] In one embodiment, the root index server includes a root filter, which pre-stores an index information directory corresponding to each storage area; the target storage area determination module 1002 is further configured to:

[0118] According to the target index information and the index information directory, a root filter is used to filter multiple storage areas to obtain a target storage area.

[0119] In one embodiment, the target storage node determination module 1003 is further configured to:

[0120] The target storage node is determined using the regional index server corresponding to the target storage area.

[0121] In one embodiment, the regional index server includes a node filter, which pre-stores a sub-index information directory corresponding to each storage node; the target storage node determination module 1003 is further configured to:

[0122] According to the target index information and the sub-index information directory, a node filter is used to filter multiple storage nodes included in the target storage area to obtain a target storage node.

[0123] In one embodiment, the target data acquisition module 1004 includes:

[0124] The distribution submodule is used to distribute the query request to each target storage node using the query server;

[0125] The receiving submodule is used to receive the query results of each target storage node and obtain the target data according to each query result.

[0126] According to an embodiment of the present disclosure, a storage device for a database cluster is also provided.

[0127] like Figure 11 As shown, the storage device of the database cluster includes:

[0128] Index information acquisition module 1101, used to obtain index information of stored data;

[0129] The sub-index information directory storage module 1102 is used to associate the index information of the stored data with the node number of the storage node storing the stored data, and store the associated information in the sub-index information directory of the regional index server; and

[0130] The index information directory module 1103 is used to associate the index information of the stored data with the area number of the storage area storing the stored data, and store the associated information in the index information directory of the root index server.

[0131] In one embodiment, the index information acquisition module 1101 includes:

[0132] The log data acquisition submodule is used to obtain the log data corresponding to the stored data;

[0133] The segmentation processing submodule is used to perform N-word segmentation processing on the log data to obtain index information of the stored data, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2.

[0134] In one embodiment, the device further comprises:

[0135] The sending module is used to receive the data to be stored by using the data receiving router and send the data to be stored to the node router;

[0136] The data storage module is used to store the data to be stored in the storage nodes of the corresponding storage area using the node router according to the status information of the storage nodes in each storage area, and obtain the stored data.

[0137] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0138] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0139] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0140] like Figure 12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. Various programs and data required for the operation of the device 1200 can also be stored in the RAM 1203. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0141] Various components in device 1200 are connected to I / O interface 1205, including an input unit 1206, such as a keyboard and mouse; an output unit 1207, such as various types of displays and speakers; a storage unit 1208, such as a magnetic disk and optical disk; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0142] The computing unit 1201 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as the query and / or storage method based on the database cluster. For example, in some embodiments, the query and / or storage method based on the database cluster can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 1208. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the query and / or storage method based on the database cluster described above can be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute a query and / or storage method based on a database cluster in any other appropriate manner (eg, by means of firmware).

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

[0144] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

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

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

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

[0148] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0149] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

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

Claims

1. A query method based on a database cluster, comprising: Determine the key value contained in the query string; Performing N-word segmentation processing on the key value to obtain target index information, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2; the target index information is summary information of the target data to be accessed by the query request; Based on the target index information and the index information directory, a root filter in a root index server is used to filter multiple storage areas to obtain a storage area in the index information directory that stores the target index information as the target storage area; the root filter pre-stores an index information directory corresponding to each storage area; the index information directory includes an area number of each storage area and index information of stored data in each storage area; The target storage area corresponds to a regional index server; the regional index server includes a node filter, and the node filter pre-stores a sub-index information directory corresponding to each storage node; According to the target index information and the sub-index information directory, the node filter is used to filter the multiple storage nodes included in the target storage area to obtain the target storage node; The query request is sent to the target storage node to obtain target data.

2. The method according to claim 1, wherein Sending the query request to the target storage node to obtain target data includes: Distributing the query request to each of the target storage nodes using a query server; Receive query results of each target storage node, and obtain the target data according to each query result.

3. A storage method based on a database cluster, comprising: Get the log data corresponding to the stored data; Performing N-word segmentation processing on the log data to obtain index information of the stored data, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2; Associating the index information of the stored data with the node number of the storage node storing the stored data, and storing the information in the sub-index information directory of the regional index server; and The index information of the stored data and the area number of the storage area storing the stored data are associated with each other and stored in the index information directory of the root index server; the index information directory includes the area number of each storage area and the index information of the stored data in each storage area; the index information directory is configured to support filtering operations based on target index information, so as to use the root filter to filter multiple storage areas during the query phase, and obtain the storage area in the index information directory that stores the target index information as the target storage area; the target index information is the summary information of the target data to be accessed by the query request.

4. The method according to claim 3, wherein: Also includes: Utilizing a data receiving router to receive data to be stored, and sending the data to be stored to a node router; The node router is used to store the data to be stored in the storage node of the corresponding storage area according to the status information of the storage node of each storage area, thereby obtaining the stored data.

5. A query device based on a database cluster, comprising: A target index information determination module is used to determine the key value contained in the query condition character string; Performing N-word segmentation processing on the key value to obtain target index information, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2; the target index information is summary information of the target data to be accessed by the query request; a target storage area determination module configured to filter the plurality of storage areas using a root filter in a root index server based on the target index information and the index information directory, and obtain a storage area in the index information directory storing the target index information as the target storage area; the root filter pre-stores an index information directory corresponding to each storage area; the index information directory includes an area number of each storage area and index information of stored data in each storage area; The target storage area corresponds to a regional index server; the regional index server includes a node filter, and the node filter pre-stores a sub-index information directory corresponding to each storage node; According to the target index information and the sub-index information directory, the node filter is used to filter the multiple storage nodes included in the target storage area to obtain the target storage node; The target data acquisition module is used to send the query request to the target storage node to obtain the target data.

6. The device according to claim 5, wherein The target data acquisition module includes: A distribution submodule, configured to distribute the query request to each of the target storage nodes using a query server; The receiving submodule is configured to receive query results of each target storage node and obtain the target data according to each query result.

7. A storage device based on a database cluster, comprising: Index information acquisition module, used to obtain log data corresponding to stored data; Performing N-word segmentation processing on the log data to obtain index information of the stored data, wherein the N-word segmentation includes N characters, and N is greater than or equal to 2; a sub-index information directory storage module, configured to associate the index information of the stored data with the node number of the storage node storing the stored data, and store the associated information in the sub-index information directory of the regional index server; and An index information directory module is used to associate the index information of the stored data with the area number of the storage area storing the stored data, and store it in the index information directory of the root index server; the index information directory includes the area number of each storage area and the index information of the stored data in each storage area; the index information directory is configured to support filtering operations based on target index information, so as to use the root filter to filter multiple storage areas during the query phase, and obtain the storage area in the index information directory that stores the target index information as the target storage area; the target index information is the summary information of the target data to be accessed by the query request.

8. The device according to claim 7, wherein Also includes: A sending module, configured to receive the data to be stored by using a data receiving router, and send the data to be stored to a node router; The data storage module is used to use the node router to store the data to be stored in the storage node of the corresponding storage area according to the status information of the storage node of each storage area, so as to obtain the stored data.

9. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.

11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data query method and device, storage medium and electronic equipment

    CN110704453A