Index management method and device, electronic equipment, medium and product

By detecting the index capacity and creating a new index in ElasticSearch, the management efficiency and business discontinuation problems caused by insufficient index capacity are solved, and the index capacity expansion and business discontinuation effects are achieved.

CN119149540APending Publication Date: 2024-12-17MASHANG CONSUMER FINANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411218414.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

When using ElasticSearch, the management efficiency and business service outage caused by insufficient index capacity are ineffective. The existing technology needs to stop writing operations when copying data to a new index, resulting in a long time of shutdown of the write service, affecting management efficiency.

Method used

By detecting the used capacity in the index group, if the threshold is exceeded, a new index will be created, and new data addition operations will be configured in the new index, and new data addition operations will be deleted in the original index, so as to achieve index capacity expansion, avoid overloading of a single index, and ensure that the business will not be Stop service.

Benefits of technology

It improves index management efficiency, realizes continuous service of services, reduces the impact on the business, and continuously creates new indexes to achieve index capacity expansion, avoiding the overload of a single index.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149540A_ABST
    Figure CN119149540A_ABST
Patent Text Reader

Abstract

The invention discloses an index management method and device, electronic equipment, a medium and a product. The method comprises the steps that the used capacity of a first index in a first index group is acquired; wherein the first index is the index with the minimum used capacity in the first index group; if the used capacity of the first index is greater than an index capacity threshold value corresponding to the first index group, creating a second index in the first index group; and configuring a data addition operation in the data operation type of the second index, and deleting the data addition operation in the data operation type of the first index. By means of the method, efficient detection and timely capacity expansion of the capacity of the index can be achieved, and therefore efficient management of the index is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an index management method, an index management device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] ElasticSearch is a distributed, highly scalable, and highly real-time search and data analysis engine. It can easily enable large amounts of data to be searched, analyzed, and explored. Elasticsearch mainly uses indexes to manage data, including data storage, query, modification, and deletion. In the process of using ElasticSearch, how to efficiently manage indexes based on index capacity is one of the current research hotspots. Summary of the invention

[0003] The embodiments of the present application provide an index management method, device, electronic device, medium, and product, which can efficiently manage indexes.

[0004] On the one hand, an embodiment of the present application discloses an index management method, the method comprising:

[0005] Obtaining the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group;

[0006] If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, creating a second index in the first index group;

[0007] The data adding operation is configured in the data operation type of the second index, and the data adding operation is deleted in the data operation type of the first index.

[0008] The present application discloses an index management device, which includes:

[0009] An acquisition unit, configured to acquire a used capacity of a first index in a first index group; wherein the first index is an index with the smallest used capacity in the first index group;

[0010] a processing unit, configured to create a second index in the first index group if the used capacity of the first index is greater than an index capacity threshold corresponding to the first index group;

[0011] The processing unit is further configured to configure a data adding operation in the data operation type of the second index, and to delete the data adding operation in the data operation type of the first index.

[0012] On the one hand, an embodiment of the present application discloses an electronic device, which includes a processor suitable for implementing one or more computer programs; and a computer-readable storage medium, wherein the computer-readable storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by the processor and executed in accordance with the above-mentioned index management method.

[0013] In one aspect, the present application discloses a computer-readable storage medium storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by a processor and executing the above-mentioned index management method.

[0014] In one aspect, the present application discloses a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the above-mentioned index management method.

[0015] In an embodiment of the present application, the used capacity of the first index in the first index group is obtained; wherein, the first index is the index with the smallest used capacity in the first index group. If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group. By detecting the index capacity in the index group, it is possible to promptly detect that the index capacity is insufficient. And in the case of insufficient index capacity, a new second index is created. A data addition operation is configured in the data operation type of the second index, and the data addition operation is deleted in the data operation type of the first index. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index. In this process, the index capacity is expanded by continuously creating new indexes in the index group, which avoids the situation of overloading a single index and effectively improves the management efficiency of the index; at the same time, by processing the data addition operation through the newly created index, the business can be kept from being interrupted, thereby effectively reducing the impact on the business. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 It is a schematic diagram of a network architecture of an index management system disclosed in an embodiment of the present application;

[0018] Figure 2It is a flowchart of an index management method disclosed in an embodiment of the present application;

[0019] Figure 3 It is a flowchart of a data operation request processing method disclosed in an embodiment of the present application;

[0020] Figure 4 It is a framework flow chart of a data operation request processing disclosed in an embodiment of the present application;

[0021] Figure 5 It is a framework flow chart of distributing data operation requests disclosed in an embodiment of the present application;

[0022] Figure 6 It is a structural schematic diagram of an index management device disclosed in an embodiment of the present application;

[0023] Figure 7 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] Before describing the embodiments of the present application, the relevant terms involved in the index management method are explained first:

[0026] ElasticSearch: is a distributed, highly scalable, and highly real-time search and data analysis engine. It can easily enable the search, analysis, and exploration of large amounts of data.

[0027] Index: It is one of the most basic concepts in Elasticsearch and can be regarded as a table in a database. Each Index consists of a batch of documents, and each document has a unique ID. Documents in the Index can be searched, aggregated, filtered, and sorted.

[0028] Index Shard: The horizontal division unit of an index. ElasticSearch can divide a complete index into multiple shards and distribute the shards to different nodes. Each node can correspond to a machine. Distributing shards on different machines can achieve horizontal expansion of data.

[0029] Index Group: Multiple indexes created in a predefined time period. Multiple indexes under the same index group have the same data structure definition. Multiple indexes in an index group can be numbered according to the creation time and stored according to the creation time. Usually, when the capacity of the current index is insufficient, a new index is created to ensure that the data addition operation can be successfully executed.

[0030] Among them, for search engines, the search service that has been running online may have insufficient index capacity due to scale changes. To address this problem, the current method is usually to create a new index, copy the data of the original index to the new index, and then delete the original index. In the process of copying data to the new index, if there is a write operation in the original index, this part of the write operation will not be synchronized to the new index, so the write operation needs to be stopped. The larger the amount of data that needs to be synchronized, the longer the write service will be stopped, which makes the index management efficiency low.

[0031] In order to efficiently manage indexes, an embodiment of the present application provides an index management method, which can be executed by an electronic device. The electronic device may include a terminal or a server. The terminal may include but is not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals, smart cameras, virtual reality devices (such as AR (Augmented Reality) devices), and other devices; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0032] Specifically, the method includes: ① obtaining the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group. ② If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group. ③ Configuring a data addition operation in the data operation type of the second index, and deleting the data addition operation in the data operation type of the first index. By detecting the index capacity in the index group, insufficient index capacity can be detected in time. And when the index capacity is insufficient, a new second index is created. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index, thereby avoiding the overload of a single index and effectively improving the management efficiency of the index; at the same time, by processing the data addition operation through the newly created index, the business can be kept in service, thereby effectively reducing the impact on the business.

[0033] In a possible implementation, the index management method provided in the embodiment of the present application can be implemented based on cloud technology. In the embodiment of the present application, it can specifically involve one or more of cloud storage, cloud database, and big data in cloud technology. For example, the data required to execute the index management method (such as the used capacity of the first index in the first index group and the index capacity threshold corresponding to the first index group, etc.) is obtained from the database; or the data determined by executing the index management method (such as the data operation type of the first index and the second index) is stored in the cloud database.

[0034] In a possible implementation, the index management method provided by the present application can also be implemented based on blockchain technology. For example, the data required to execute the index management method can be stored in the form of blocks on the blockchain; the data determined by executing the index management method (such as the data operation types of the first index and the second index) can also be stored in the form of blocks on the blockchain to prevent internal data from being tampered with, thereby ensuring data security.

[0035] See also Figure 1 , is a schematic diagram of a network architecture of an index management system disclosed in an embodiment of the present application, and the index management system may include a first electronic device 101, a second electronic device 102, and a terminal device 103. Among them, the first electronic device 101 and the terminal device 103 are connected via a network, and the first electronic device 101 and the second electronic device 102 are connected via a network, for example, via a local area network, a wide area network, a mobile Internet, etc. It should be noted that the number of terminal devices 103 can be multiple, and the interaction between a terminal device 103 and the first electronic device 101 is taken as an example in the subsequent embodiments.

[0036] Among them, the first electronic device 101 is mainly responsible for executing the index management method, including: obtaining the used capacity of the first index in the first index group; when the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, creating a second index in the first index group, and configuring the data addition operation in the data operation type of the second index, and deleting the data addition operation in the data operation type of the first index. The first electronic device 101 is also used to receive a data operation request sent by the terminal device 103, analyze the data operation request, send the data operation request to the target index, and respond to the data operation request through the target index. Among them, the first electronic device 101 can be independent of the second electronic device 102 and the terminal device 103. In the embodiment of the present application, the first electronic device 101 can be a gateway.

[0037] The second electronic device 102 is an electronic device corresponding to the index group cluster, and in the embodiment of the present application, it may specifically refer to ElasticSearch (a search and data analysis engine). The second electronic device 102 may be mainly responsible for executing the data operation request (including data addition, data deletion, data modification, and data query, etc.) sent by the terminal device 103, and returning the execution result of the data operation request to the first electronic device 101.

[0038] The first electronic device 101 and the second electronic device 102 in the embodiment of the present application can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms, but the embodiments of the present application do not limit this.

[0039] Among them, the terminal device 103 is a terminal device corresponding to the object (i.e., user) with a data operation request. Generally, one terminal device corresponds to one object. The terminal device 103 mainly sends a data operation request to the first electronic device 101. The terminal device 103 is also used to receive the execution result of the data operation request returned by the first electronic device 101. The execution result of the data operation request is sent to the terminal device 103 by the first electronic device 101 after receiving the execution result of the data operation request returned by the second electronic device 102. The terminal device 103 in the embodiment of the present application includes but is not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals, smart cameras, virtual reality devices (such as AR (Augmented Reality, augmented reality) devices) and other devices, and this application does not limit this.

[0040] Optionally, Figure 1 The network architecture diagram of the index management system is only an exemplary representation and is not intended to be limiting. Figure 1 The first electronic device 101 or the second electronic device 102 can be deployed as a node in the blockchain network, or the first electronic device 101 or the second electronic device 102 can be connected to the blockchain network, so that the first electronic device 101 or the second electronic device 102 can store the data involved in the data processing process in the blockchain network to prevent the internal data from being tampered with, thereby ensuring data security.

[0041] In the embodiment of the present application, in combination with the index management system, the index management method provided by the embodiment of the present application may generally include the following steps: the first electronic device 101 obtains the used capacity of the first index in the first index group from the local storage of the second electronic device 102 or the first electronic device 101; wherein the first index is the index with the smallest used capacity in the first index group, and the first index group is any index group in the index group cluster; if the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, the first electronic device 101 creates a second index in the first index group; configures the data addition operation in the data operation type of the second index, and deletes the data addition operation in the data operation type of the first index. By detecting the index capacity in the index group, it is possible to timely find that the index capacity is insufficient. And in the case of insufficient index capacity, a new second index is created. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index, which avoids the situation of overloading a single index and effectively improves the management efficiency of the index; at the same time, the data addition operation is processed by the newly created index, so that the service is not interrupted, thereby effectively reducing the impact on the service.

[0042] Optionally, in addition to configuring the data addition type for the second index, data query operations, data modification operations, and data deletion operations may also be configured for the second index. After the configuration is completed, the first electronic device 101 may also send the data operation type of the second index and the data operation type of the first index (the data addition operation has been deleted) to the second electronic device 102, and the second electronic device 102 saves the configuration information to achieve synchronization of the configuration information.

[0043] Furthermore, in combination with the index management system, it is also possible to realize rapid processing of data operation requests, and the specific process is as follows: the first electronic device 101 receives a data operation request sent by the terminal device 103, the data operation request carries the identifier of the first index group and data operation indication information, and the data operation indication information includes the data operation type; the first electronic device 101 determines the second index group from the index group cluster according to the identifier of the first index group; determines the target index from the first index group based on the data operation type, and responds to the data operation request through the target index. In the embodiment of the present application, the data operation request is made in the form of an index group, and compared with the single index method, this method can improve the processing efficiency of the data operation request.

[0044] It should be noted that the collection and processing of relevant data in this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0045] The index management method proposed in the embodiment of the present application is introduced in detail below.

[0046] See also Figure 2 , is a flow chart of an index management method disclosed in an embodiment of the present application. The index management method can be executed by an electronic device, and the electronic device can be Figure 1 Corresponding to the first electronic device 101 shown, the index management method may specifically include but is not limited to the following steps:

[0047] S201: Obtaining a used capacity of a first index in a first index group; wherein the first index is an index with the smallest used capacity in the first index group.

[0048] In one possible implementation, the first index group is any index group in the index group cluster, and the used capacity of each index in the first index group is first obtained; then, based on the used capacity of each index, the index with the minimum used capacity is determined from the first index group, and the index is used as the first index. The index group cluster is a concept of a collection, and the index group cluster includes at least one index group, each index group includes at least one index, and each index includes multiple shards. The relevant information of the index group cluster can be stored in a database, which can be a database corresponding to the first electronic device (such as a gateway), or a database corresponding to the second electronic device (such as a search engine), or it can also be an independent database, such as a cloud database.

[0049] In order to find out whether the index capacity is sufficient in time, the first electronic device can obtain the used capacity of the first index in the first index group from the database based on a preset time interval, and the used capacity of the first index refers to the capacity currently used by the first index. Among them, the preset time interval can be set according to demand, such as every hour, every day, or every week, etc. The preset time interval can be used to achieve regular detection of the index capacity, so as to find out the problem of insufficient capacity in time. Compared with manual detection, the embodiment of the present application uses the first electronic device to perform automatic detection, which can effectively improve the detection efficiency.

[0050] In some optional embodiments, the first index may also be the most recently created index in the first index group. In this case, the process of determining the first index is as follows: obtaining the attribute information of each index in the first index group, the attribute information including one or both of the index identifier and the creation time, wherein the index identifier may refer to the index number, such as a digital number, 001, 002, 003, etc., or an alphabetical number, A, B, C, etc. Then, the first index is determined from the first index group according to the attribute information, wherein the first index is the index with the largest index identifier in the first index group, or the first index is the index with the most recent creation time in the first index group.

[0051] For example, if the attribute information is an index identifier, the index with the largest index identifier is determined from the first index group as the first index. Taking digital numbering as an example, there are four indexes numbered 001, 002, 003, and 004 in the first index group, and the first index is the index numbered 004. For another example, if the attribute information is creation time, the index with the creation time closest to the current time is determined from the first index group as the first index. For example, if there are three indexes in the first index group, the creation time of index 1 is 13:01 on October 11, 2023, the creation time of index 2 is 13:31 on October 11, 2023, and the creation time of index 3 is 14:02 on October 11, 2023, then according to the creation time, index 3 can be determined as the first index.

[0052] S202: If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, create a second index in the first index group.

[0053] In a possible implementation, after obtaining the used capacity of the first index, the used capacity of the first index is compared with the index capacity threshold corresponding to the first index group. If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group. The index capacity threshold corresponding to the first index group indicates the index capacity threshold of each index in the first index group, and the index capacity thresholds of the various indexes included in the same index group are consistent. Because there are multiple indexes in the first index group, and the index capacity thresholds of the multiple indexes are the same, it is more efficient to perform capacity detection on the index with the smallest used capacity. If the index with the smallest used capacity is greater than the index capacity threshold corresponding to the first index group, then the used capacity of the other indexes is also greater than the index capacity threshold corresponding to the first index group. It should be noted that the index capacity threshold is less than the maximum capacity set for the first index. Alternatively, it can be understood that if the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group and less than the maximum capacity set for the first index, a second index is created in the first index group. After creating the second index, you can also generate identification information for the second index, set the index capacity threshold of the second index, and store the creation time of the second index. For example, when the index capacity threshold of an index is 50G, when it is detected that the used capacity of the index is greater than 50G, a new index can be created to avoid service outages. In an embodiment of the present application, rapid capacity expansion can be achieved by creating a new index in the index group, avoiding the overload of a single index. Since the new index is created directly in the index group, the client is unaware and capacity expansion can be performed without service outages, reducing the impact on the business.

[0054] In a possible implementation, if the first index is the index with the largest index identifier in the first index group, or the first index is the index with the latest creation time, then when the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group, and an index identifier of the second index is generated, the index identifier of the second index is greater than the index identifier of the first index, and correspondingly, the creation time of the second index is later than the creation time of the first index. For example, taking the index identifier as a digital number as an example, if the largest number in the first index group is 008, when it is detected that the capacity of the index numbered 008 is greater than the index capacity threshold corresponding to the index, a new index is created, and the number of the new index can be 009.

[0055] In an optional embodiment, different index capacity thresholds may also be set for each index in the first index group. In this case, the first index is not the index with the smallest used capacity in the first index group, but is determined according to the used capacity of each index in the first index group and the index capacity threshold of each index. The specific implementation method may be as follows: obtain the used capacity of each index in the first index group and the index capacity threshold of each index; determine the ratio between the used capacity of each index and the index capacity threshold of each index, and take the index with the largest ratio as the first index. The ratio is used to indicate the usage of the index. The larger the ratio, the more used capacity the index has. For example, there are 3 indexes in the first index group, the index capacity threshold corresponding to index 1 is 20, the index capacity threshold corresponding to index 2 is 50, and the index capacity threshold corresponding to index 3 is 80. Among them, the used capacity of index 1 is 15, the used capacity of index 2 is 25, and the used capacity of index 3 is 50, and the corresponding ratios are 0.75, 0.5 and 0.4 respectively, so index 1 can be used as the first index.

[0056] In an optional embodiment, an index quantity threshold may be set for each index group. Therefore, when creating a new index, not only the index capacity but also the index quantity needs to be considered. Specifically: after obtaining the used capacity of the first index, the used capacity of the first index is compared with the index capacity threshold corresponding to the first index group; if the capacity of the first index is greater than the index capacity threshold corresponding to the first index group, the number of indexes in the first index group is obtained; the number of indexes in the first index group is compared with the index quantity threshold, and if the number of indexes in the first index group is less than the index quantity threshold, a second index is created in the first index group. If the number of indexes in the first index group is greater than or equal to the index quantity threshold, a new index group is created, and a second index is created in the new index group.

[0057] Alternatively, an index group capacity threshold may be set for each index group, and when the index group capacity reaches the index group capacity threshold, a new index group is created. The index capacity thresholds of the respective indexes in the first index group are determined respectively, the index capacity thresholds of the respective indexes are added together to obtain the total capacity of the first index group, the total capacity of the first index group is compared with the index group capacity threshold, and if the total capacity of the first index group is greater than the index group capacity threshold, a new index group is created.

[0058] S203: configuring a data adding operation in the data operation type of the second index, and deleting the data adding operation in the data operation type of the first index.

[0059] In a possible implementation, after the second index is newly created, the data operation type of the second index can be configured. Since the new index is created when the capacity is insufficient, it is necessary to configure the data addition operation in the data operation type of the second index. In addition to the data addition operation, the data operation type of the second index can also include one or more of the data deletion operation, data query operation and data modification operation. Since the data operation type can be customized, the corresponding data operation type can be selectively set for the second index to achieve efficient management of the index.

[0060] In addition, it is also necessary to delete the data addition operation in the data operation type of the first index. Since the capacity of the first index is insufficient, new data is not allowed, so the data addition operation must be deleted. In this way, there is no need to add data in the index, which can reduce useless operations in data operation requests, thereby improving business efficiency. Similarly, previous indexes in the first index group (indexes included in the first index group before the second index is created) are not allowed to perform data addition operations. This processing method is conducive to the management of indexes. When data is added, the newly created second index is directly selected to add data, which can improve data processing efficiency.

[0061] It should be noted that when the first index group includes multiple indexes, for the third index whose used capacity is greater than the index capacity threshold corresponding to the first index group and whose used capacity is not the smallest, it is also necessary to delete the data addition operation in the data operation type of the third index to ensure that subsequent data addition operations are executed by the first index or by the newly created second index.

[0062] In summary, for any index group in the index group cluster, the method of steps S201 - 203 can be used to perform timed detection and dynamic capacity expansion to achieve efficient management of the index.

[0063] In the embodiment of the present application, it is mainly described how to implement the periodic detection and timely expansion of the index. Specifically, the electronic device obtains the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group. If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group. By detecting the index capacity in the index group, it is possible to timely find that the index capacity is insufficient. And in the case of insufficient index capacity, a new second index is created. The data addition operation is configured in the data operation type of the second index, and the data addition operation is deleted in the data operation type of the first index. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index. In this process, the index capacity expansion is achieved by continuously creating new indexes in the index group, which avoids the situation of overloading a single index and effectively improves the management efficiency of the index; at the same time, the data addition operation is processed by the newly created index, so that the business can be served without interruption, thereby effectively reducing the impact on the business.

[0064] In the above embodiment, the timed detection and expansion of the index capacity in the index group cluster are described. The purpose of the expansion is to better serve the business. Since the data operation requests are constantly being made, the timed detection and expansion are required. The following will describe the data operation requests in the search engine of the present application embodiment. Figure 3 , is a flow chart of a data operation request processing method disclosed in an embodiment of the present application, the method is executed by an electronic device, and the electronic device may be Figure 1 The first electronic device 101 shown may specifically be a gateway. Accordingly, the method includes but is not limited to the following steps:

[0065] S301: Receive a data operation request, where the data operation request carries an identifier of a first index group and data operation indication information, where the data operation indication information includes a data operation type.

[0066] In a possible implementation, a data operation request may be initiated by a terminal device, and the data operation request carries an identifier of a first index group and data operation indication information. The identifier of each index group is stored in a database or an electronic device, so the terminal device can obtain the identifier of each index group in the index group cluster. The data operation indication information includes a data operation type, and the data operation type is used to indicate the purpose of the data operation request. Specifically, the data operation type in the data operation indication information includes one or more of a data addition operation, a data deletion operation, a data query operation, and a data modification operation.

[0067] When the data operation type is different, the information included in the data operation indication information is also different. If the data operation type is a data adding operation, the data operation indication information also includes the added data; if the data operation type is a data deleting operation, the data operation indication information may also include the data identifier corresponding to the deleted data, or the indication information of deleting the data, or the type information of the deleted data, etc.; if the data operation type is a data query operation, the data operation indication information may also include the data identifier corresponding to the query data, or the indication information of the query data, or the type information of the query data, etc.; if the data operation type is a data modification operation, the data operation indication information may also include the data identifier corresponding to the modified data, or the indication information of modifying the data (such as how to modify), or the type information of the query data, etc.

[0068] S302: Determine a first index group from an index group cluster according to an identifier of the first index group.

[0069] In one possible implementation, determining the first index group from the index group cluster based on the identifier of the first index group can specifically include the following steps: obtaining the identifiers of each index group in the index group cluster, and then querying the index group corresponding to the identifier of the first index group from the index group cluster, and determining the index group corresponding to the identifier of the first index group in the index group cluster as the first index group.

[0070] In one possible implementation, the index group corresponding to the identifier of the first index group may not be found in the index group cluster. This situation usually occurs when the data operation type is a data addition operation. In this case, it represents that the user has specified the index group himself. Therefore, a second index group can be created in the index group cluster based on the index group identifier. The user specifies the index group to add data, which may be because the type of these newly added data is special, and the user does this to facilitate subsequent queries and subsequent data management. After the second index group is created, a new index needs to be created in the second index group. When the data operation type is a data addition operation, the newly created index is used to perform the data addition operation.

[0071] S303: Determine a target index from the first index group based on the data operation type, and respond to the data operation request through the target index.

[0072] When the data operation types are different, the corresponding target index is the same, which can be divided into the following cases:

[0073] 1. When the data operation type includes a data addition operation, the second index is determined as the target index. In the embodiment of the present application, in combination with the capacity management of the index, if the used capacity of the first index in the first index group is greater than the index capacity threshold corresponding to the first index group, a new second index group is created. Then, when the data operation type is a data addition operation, the newly created second index group can be directly used as the target index group.

[0074] 2. In the case where the data operation type includes any one of a data query operation, a data modification operation, and a data deletion operation, and the data operation indication information also includes the first data identifier of the operation data corresponding to the data operation type, based on the first data identifier of the operation data, and the correspondence between the data identifier and the shard identification information, determine the target index from the first index group. The process may specifically include: querying the target shard identification information corresponding to the first data identifier from the correspondence between the data identifier and the shard identification information, and determining the index identified by the target shard identification information in the first index group as the target index. Since the correspondence between the data identifier and the shard identification information is stored in the database, the corresponding shard identification information and the corresponding shard, as well as the index to which the shard belongs, can be directly queried through the first data identifier.

[0075] 3. In the case where the data operation type includes any one of a data query operation, a data modification operation, and a data deletion operation, if the data operation indication information does not include the first data identifier of the operation data, then at least one index matching the data operation type in the data operation indication information is determined from the first index group, and at least one index is determined as the target index. Since no identification information is carried, in this case, it is equivalent to a batch operation, so there are as many target indexes as the number of indexes determined. Since the data operation types of the indexes included in the first index group include one or more of add, delete, modify, and query (data addition operation, data deletion operation, data modification operation, and data query operation), it is necessary to determine at least one index matching the data operation type from the multiple indexes included in the first index group according to the data operation type, and determine at least one index as the target index. For example, if the data operation type is a data modification operation, then at least one index having a data deletion operation type is determined from the first index group. For another example, if the data operation type is a data deletion operation, then at least one index with the data deletion operation type is determined from the first index group. Some data is more important, so when adding it to the index, the data operation type of the index can be set to not include data deletion operations to avoid accidental deletion of data.

[0076] In an optional embodiment, after determining at least one index matching the data operation type in the data operation indication information from the first index group, the number of data operation requests in execution state for each index in the at least one index is determined, and a target index is determined from the at least one index according to the number of data operation requests in execution state for each index. Optionally, the index with the least number of data operation requests in execution state in the at least one index can be used as the target index. Since the number of data operation requests currently in execution state is small, the queuing time can be reduced to improve data processing efficiency.

[0077] In a possible implementation, if the data operation type in the data operation indication information is a data addition operation, correspondingly, the data operation indication information also includes the operation data corresponding to the data operation type, then responding to the data operation request through the target index may specifically include: obtaining the first data identifier of the operation data, determining the target shard from the shards included in the target index according to the first data identifier, and storing the operation data in the target shard so that the target shard performs the data addition operation, that is, adding the operation data corresponding to the data operation type to the target shard. After the data operation request is sent to the target shard, and the target shard successfully executes the data request, the first data identifier and the shard identification information of the target shard are associated and stored, that is, a corresponding relationship between the first data identifier and the shard identification information of the target shard is created, wherein the shard identification information is used to identify the target shard and the target index to which the target shard belongs. Through this method, the persistence of the association relationship can be achieved, and the subsequent processing efficiency of the data operation request can be improved, that is, the first data identifier and the shard identification information of the target shard can be directly queried according to the first data identifier, so as to determine the corresponding shard, so as to improve the processing efficiency of the data operation request.

[0078] Among them, one implementation method of determining the target slice from the slices included in the target index according to the first data identifier is as follows: hash the first data identifier to obtain the corresponding hash value, and then determine the slice corresponding to the hash value from the slices included in the target index, and use the slice as the target slice. For example, the slice codes included in the target index are N-1, N-2, N-3, N-4, N-5, N-6, N-7, and N-8, and the first data identifier is hashed to obtain a hash value of "0D0FB7", then the slice N-7 is used as the target slice.

[0079] When obtaining the first data identifier of the operation data as described above, it is first necessary to determine whether the data operation indication information carries the first data identifier of the operation data. If the data operation indication information carries the first data identifier of the operation data, the first data identifier of the operation data can be directly obtained from the data operation indication information. In this case, since the data operation type is a data addition operation, the first data identifier of the operation data included is generated by the terminal device. If the data operation indication information does not carry the first data identifier of the operation data, the first data identifier of the operation data is generated; the specific steps for generating the first data identifier of the operation data can be: performing hash processing on the operation data to obtain the first data identifier of the operation data, or processing the operation data using a binary method to obtain the first data identifier of the operation data.

[0080] In a possible implementation, when the data operation type in the data operation indication information is any one of a data query operation, a data modification operation, and a data deletion operation, the data operation request is responded to through the target index, which is divided into the following two cases:

[0081] 1. The data operation indication information includes a first data identifier of the operation data. In this case, the data operation request can be directly sent to the target shard corresponding to the target index corresponding to the first data identifier, so that the target shard performs the data operation corresponding to the data operation type.

[0082] 2. The data operation indication information does not include the first data identifier of the operation data. In this case, the data operation request is sent to all the slices included in the target index, so that all the slices perform the data operation corresponding to the data operation type.

[0083] In one possible implementation, after the target index responds to and executes the data operation request, it is also necessary to return the execution result corresponding to the data operation request. For example, if the data operation type is a data adding operation, then after executing the data adding operation, the execution result corresponding to the data operation request returned is a successful adding or a failed adding. If the data operation type is a data query operation, then after executing the data adding operation, the execution result corresponding to the data operation request returned is a successful query or a failed query. If the data operation type is a data deletion operation, then after executing the data deletion operation, the execution result corresponding to the data operation request returned is a successful deletion or a failed deletion; if the data operation type is a data modification operation, then after executing the data modification operation, the execution result corresponding to the data operation request returned is a successful modification or a failed modification.

[0084] Furthermore, after the first electronic device receives the execution result corresponding to the returned data operation request, it can also return the execution result corresponding to the data operation request to the terminal device, and the terminal device can perform subsequent work after receiving the returned execution result. For example, if the addition is unsuccessful, the reason for the unsuccessful addition is detected, and a new data operation request is initiated.

[0085] For the above different types of data operations, you can Figure 4 For a description of the framework flow chart, see Figure 4 , is a framework flow chart of a data operation request processing disclosed in an embodiment of the present application, Figure 4 There are 4 branches in the figure, corresponding to 4 types of data operations. The processing process is different for different data operation types. The specific processing process is to perform different processing logic according to the different data operation types (addition, deletion, modification and query). For data addition operations, when no identifier is specified for the newly added data or when the identifier is specified, the newly added data and the corresponding identifier can be stored to achieve persistence of the association relationship. For other data operation types, such as data modification operations, data deletion operations or data query operations, if there is a specified identifier, the correspondence between the data identifier and the shard identifier information can be directly queried, the shard of the index to which the specified identifier belongs can be confirmed, and the data operation request can be directly distributed to the shard; if no identifier is specified, the index with the same data operation type is determined according to the data operation type, and the data operation request is distributed to all shards under the corresponding index. For example, if the data operation type is a data addition operation, you can first determine whether the specified identifier exists. If so, you can directly query the correspondence between the data identifier and the shard identifier information, and send the data operation request to the queried target shard; if there is no specified identifier, obtain the index that matches the data deletion operation, and then send the data operation request to the corresponding target shard. In each of the above situations, since the correspondence between the data identifier and the shard identifier information records the relationship between each data identifier and the shard, when a data operation request carrying a specified identifier comes over, there is no need to initiate a request for each index. Only one shard request needs to be initiated to execute the data operation request, which can greatly improve data processing performance.

[0086] Further, the framework flow chart of sending the data operation request to the target slice of the index included in the second index group can be seen in Figure 5 , can be obtained from Figure 5It can be seen that this is an index group including N indexes, each index includes multiple shards, and the shards are distinguished by identifiers. The client sends a data operation request to the gateway, and the gateway distributes the data operation request. It can first determine the index group, and then determine the indexes in the index group and the shards under the index. Alternatively, it can directly determine the shards under the index according to the data identifier in the data operation request, thereby sending the data operation request to the shards. Among them, the client and the terminal device are equivalent, and the gateway refers to the first electronic device mentioned above. Based on the above explanation, it can be known that when the data identifier is not carried in the data operation request, the corresponding index can be determined according to the data operation type. In addition to the index name itself, the index also includes an index alias. Therefore, when determining the corresponding index according to the data operation type, it can be determined according to the index name and the index alias.

[0087] The embodiment of the present application describes a method for processing data operation requests. In this process, index group requests are processed, and data can be quickly processed based on the index group information carried in the data operation request. During the processing, the client does not need to perceive the internal relationship of the index group. When performing index reconstruction, upgrade and other operations, the client is unaware, does not stop the service, and does not make any changes, thereby achieving business interruption and effectively reducing the impact on the business.

[0088] Based on the above method embodiment, the present application embodiment also provides an index management device. Figure 6 , is a schematic diagram of the structure of an index management device disclosed in an embodiment of the present application, Figure 6 The index management device 600 shown can run the following units:

[0089] The acquisition unit 601 is used to acquire the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group;

[0090] The processing unit 602 is configured to create a second index in the first index group if the used capacity of the first index is greater than an index capacity threshold corresponding to the first index group;

[0091] The processing unit 602 is further configured to configure a data adding operation in the data operation type of the second index, and to delete the data adding operation in the data operation type of the first index.

[0092] In a possible implementation, the transceiver unit 604 is configured to receive a data operation request, where the data operation request carries an identifier of the first index group and data operation indication information, where the data operation indication information includes a data operation type;

[0093] The determining unit 603 is further configured to determine the first index group from the index group cluster according to the identifier of the first index group;

[0094] The determination unit 603 is further configured to determine a target index from the first index group based on the data operation type, and respond to the data operation request through the target index.

[0095] In a possible implementation, when the determination unit 603 determines the target index from the first index group based on the data operation type, it is specifically configured to perform the following steps:

[0096] When the data operation type includes a data adding operation, the second index in the first index group is determined as a target index.

[0097] In a possible implementation manner, the data operation indication information further includes a first data identifier of the operation data corresponding to the data operation type, and the determination unit 603 is further configured to perform the following steps:

[0098] In the case where the data operation type includes any one of a data query operation, a data modification operation and a data deletion operation, a target index is determined from the first index group based on a first data identifier of the operation data and a correspondence between the data identifier and the shard identification information.

[0099] In a possible implementation, when the determination unit 603 determines the target index from the first index group based on the first data identifier of the operation data and the correspondence between the data identifier and the shard identifier information, it is specifically configured to perform the following steps:

[0100] Query the target shard identification information corresponding to the first data identification from the correspondence between the data identification and the shard identification information;

[0101] The index identified by the target shard identification information in the first index group is determined as the target index.

[0102] In a possible implementation, the determining unit 603 is further configured to perform the following steps:

[0103] In a case where the data operation type includes any one of a data query operation, a data modification operation, and a data deletion operation, if the data operation indication information does not include a first data identifier of the operation data, determining at least one index matching the data operation type in the data operation indication information from the first index group;

[0104] The at least one index is determined as a target index.

[0105] In a possible implementation, the data operation type in the data operation indication information is a data adding operation, and the data operation indication information also includes operation data corresponding to the data operation type. When the processing unit 602 responds to the data operation request through the target index, it is specifically configured to perform the following steps:

[0106] Acquire a first data identifier of the operation data;

[0107] Determine a target shard from the shards included in the target index according to the first data identifier;

[0108] The operation data is stored in the target shard.

[0109] In a possible implementation, the processing unit 602 is further configured to perform the following steps:

[0110] The first data identifier and the shard identification information of the target shard are stored in association, and the shard identification information is used to identify the target shard and the target index to which the target shard belongs.

[0111] It can be understood that the functions of each functional unit of the index management device provided in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the relevant description in the above method embodiment, which will not be repeated here.

[0112] In a feasible embodiment, the index management device provided in the embodiment of the present application can be implemented in software. The index management device can be stored in a memory. It can be software in the form of programs and plug-ins, and includes a series of units, including an acquisition unit, a processing unit, a determination unit, and a transceiver unit; wherein the acquisition unit, the processing unit, the determination unit, and the transceiver unit are used to implement the index management method provided in the embodiment of the present application.

[0113] In other feasible embodiments, the index management device provided in the embodiments of the present application may also be implemented in a combination of software and hardware. As an example, the index management device provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the index management method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.

[0114] In the embodiment of the present application, in combination with the acquisition unit, the processing unit, the determination unit and the transceiver unit, the method includes: the acquisition unit acquires the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group. If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, the processing unit creates a second index in the first index group. By detecting the index capacity in the index group, it is possible to timely find that the index capacity is insufficient. And in the case of insufficient index capacity, a new second index is created. The processing unit configures the data addition operation in the data operation type of the second index, and deletes the data addition operation in the data operation type of the first index. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index. In this process, the index capacity is expanded by continuously creating new indexes in the index group, which avoids the situation of overloading a single index and effectively improves the management efficiency of the index; at the same time, the data addition operation is processed by the newly created index, so that the service is not interrupted, thereby effectively reducing the impact on the service.

[0115] Based on the description of the above method embodiment and the device embodiment, the present application embodiment further provides an electronic device; the electronic device may be the first electronic device 101 mentioned above. Figure 7 The electronic device may include at least a processor 701, an input interface 702, an output interface 703 and a computer-readable storage medium 704; wherein the processor 701, the input interface 702, the output interface 703 and the computer-readable storage medium 704 may be connected via a bus or other connection methods.

[0116] The computer-readable storage medium 704 may be stored in the memory of the electronic device, the computer-readable storage medium 704 is used to store computer programs, and the processor 701 is used to execute the computer programs stored in the computer-readable storage medium 704. The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more computer programs, and is specifically suitable for loading and executing one or more computer programs to implement corresponding method flows or corresponding functions.

[0117] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the electronic device and, of course, extended storage media supported by the electronic device. The computer-readable storage medium provides a storage space that stores the operating system of the electronic device. In addition, one or more computer programs (including program codes) suitable for being loaded and executed by the processor are also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.

[0118] In the embodiment of the present application, the processor 701 may load and execute one or more computer programs stored in the computer-readable storage medium 704 to implement the above-mentioned Figure 2-Figure 5 In a specific implementation, the computer program in the computer-readable storage medium 704 is loaded by the processor 701 and executes the following steps:

[0119] Obtaining the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group;

[0120] If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, creating a second index in the first index group;

[0121] The data adding operation is configured in the data operation type of the second index, and the data adding operation is deleted in the data operation type of the first index.

[0122] In a possible implementation, the computer program in the computer-readable storage medium 704 is further used by the processor 701 to load and execute the following steps:

[0123] receiving a data operation request, wherein the data operation request carries an identifier of the first index group and data operation indication information, wherein the data operation indication information includes a data operation type;

[0124] Determining the first index group from an index group cluster according to an identifier of the first index group;

[0125] A target index is determined from the first index group based on the data operation type, and the data operation request is responded to through the target index.

[0126] In a possible implementation, when the computer program in the computer-readable storage medium 704 is loaded and executed by the processor 701 to determine the target index from the first index group based on the data operation type, the computer program is specifically configured to perform the following steps:

[0127] When the data operation type includes a data adding operation, the second index in the first index group is determined as a target index.

[0128] In a possible implementation, the data operation indication information further includes a first data identifier of the operation data corresponding to the data operation type, and the computer program in the computer-readable storage medium 704 is further used by the processor 701 to load and execute the following steps:

[0129] In the case where the data operation type includes any one of a data query operation, a data modification operation and a data deletion operation, a target index is determined from the first index group based on a first data identifier of the operation data and a correspondence between the data identifier and the shard identification information.

[0130] In a possible implementation, the computer program in the computer-readable storage medium 704 is loaded and executed by the processor 701. When determining the target index from the first index group based on the first data identifier of the operation data and the correspondence between the data identifier and the shard identifier information, the computer program is specifically used to perform the following steps:

[0131] Query the target shard identification information corresponding to the first data identification from the correspondence between the data identification and the shard identification information;

[0132] The index identified by the target shard identification information in the first index group is determined as the target index.

[0133] In a possible implementation, the computer program in the computer-readable storage medium 704 is further used by the processor 701 to load and execute the following steps:

[0134] In a case where the data operation type includes any one of a data query operation, a data modification operation, and a data deletion operation, if the data operation indication information does not include a first data identifier of the operation data, determining at least one index matching the data operation type in the data operation indication information from the first index group;

[0135] The at least one index is determined as a target index.

[0136] In a possible implementation, the data operation type in the data operation indication information is a data adding operation, and the data operation indication information also includes operation data corresponding to the data operation type. When the computer program in the computer-readable storage medium 704 is loaded and executed by the processor 701 to respond to the data operation request through the target index, it is specifically used to perform the following steps:

[0137] Acquire a first data identifier of the operation data;

[0138] Determine a target shard from the shards included in the target index according to the first data identifier;

[0139] The operation data is stored in the target shard.

[0140] In a possible implementation, the computer program in the computer-readable storage medium 704 is further used by the processor 701 to load and execute the following steps:

[0141] The first data identifier and the shard identification information of the target shard are stored in association, and the shard identification information is used to identify the target shard and the target index to which the target shard belongs.

[0142] In an embodiment of the present application, the computer program in the computer-readable storage medium 704 is loaded and executed by the processor 701: obtaining the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group. If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, a second index is created in the first index group. By detecting the index capacity in the index group, it is possible to promptly detect that the index capacity is insufficient. And in the case of insufficient index capacity, a new second index is created. A data addition operation is configured in the data operation type of the second index, and a data addition operation is deleted in the data operation type of the first index. Since the capacity of the first index is insufficient, the data addition operation is deleted, and the data addition operation is processed by the newly created second index. In this process, the index capacity is expanded by continuously creating new indexes in the index group, which avoids the situation of overloading a single index and effectively improves the management efficiency of the index; at the same time, the data addition operation is processed by the newly created index, so that the business can be served without interruption, thereby effectively reducing the impact on the business.

[0143] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the index management method provided in the above-mentioned various optional modes.

[0144] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0145] In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, and the division of the modules described above is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0146] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0147] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An index management method, It is characterized in that The method comprises: Obtaining the used capacity of the first index in the first index group; wherein the first index is the index with the smallest used capacity in the first index group; If the used capacity of the first index is greater than the index capacity threshold corresponding to the first index group, creating a second index in the first index group; The data adding operation is configured in the data operation type of the second index, and the data adding operation is deleted in the data operation type of the first index.

2. The method according to claim 1, It is characterized in that The method further comprises: receiving a data operation request, wherein the data operation request carries an identifier of the first index group and data operation indication information, wherein the data operation indication information includes a data operation type; Determining the first index group from an index group cluster according to an identifier of the first index group; A target index is determined from the first index group based on the data operation type, and the data operation request is responded to through the target index.

3. The method according to claim 2, It is characterized in that The determining a target index from the first index group based on the data operation type includes: When the data operation type includes a data adding operation, the second index in the first index group is determined as a target index.

4. The method according to claim 2, It is characterized in that The data operation indication information also includes a first data identifier of the operation data corresponding to the data operation type; and the method further includes: In the case where the data operation type includes any one of a data query operation, a data modification operation and a data deletion operation, a target index is determined from the first index group based on a first data identifier of the operation data and a correspondence between the data identifier and the shard identification information.

5. The method according to claim 4, It is characterized in that The determining a target index from the first index group based on the first data identifier of the operation data and the correspondence between the data identifier and the shard identifier information includes: Query the target shard identification information corresponding to the first data identification from the correspondence between the data identification and the shard identification information; The index identified by the target shard identification information in the first index group is determined as the target index.

6. The method according to claim 4, It is characterized in that The method further comprises: In a case where the data operation type includes any one of a data query operation, a data modification operation, and a data deletion operation, if the data operation indication information does not include a first data identifier of the operation data, determining at least one index matching the data operation type in the data operation indication information from the first index group; The at least one index is determined as a target index.

7. The method according to any one of claims 2 to 6, It is characterized in that The data operation type in the data operation indication information is a data adding operation, the data operation indication information also includes operation data corresponding to the data operation type, and responding to the data operation request through the target index includes: Acquire a first data identifier of the operation data; Determine a target shard from the shards included in the target index according to the first data identifier; The operation data is stored in the target shard.

8. The method according to any one of claims 2 to 6, It is characterized in that The method further comprises: The first data identifier and the shard identification information of the target shard are stored in association, and the shard identification information is used to identify the target shard and the target index to which the target shard belongs.

9. An index management device, It is characterized in that The device comprises: An acquisition unit, configured to acquire a used capacity of a first index in a first index group; wherein the first index is an index with the smallest used capacity in the first index group; a processing unit, configured to create a second index in the first index group if the used capacity of the first index is greater than an index capacity threshold corresponding to the first index group; The processing unit is further configured to configure a data adding operation in the data operation type of the second index, and to delete the data adding operation in the data operation type of the first index.

10. An electronic device, It is characterized in that The electronic device comprises: a processor adapted to implement one or more computer programs; and, A computer-readable storage medium storing one or more computer programs, wherein the one or more computer programs are suitable for being loaded by the processor and executing the index management method according to any one of claims 1 to 8.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores one or more computer programs, and the one or more computer programs are suitable for being loaded by a processor and executing the index management method according to any one of claims 1-8.

12. A computer program product, It is characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor of the electronic device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the electronic device executes the index management method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Distributed storage method, server and client

    CN111061431A

  • Method and device for processing incremental index data

    CN112748866A

  • Bucket index resplitting method and device, equipment and medium

    CN113703678A