Search traffic switching method, device and computer-readable storage medium

By dynamically calling Shard shard number in the distributed storage system of the search database to generate logical groups, the problems of waste of resources and complex operations in the existing technology are solved, and efficient retrieval strategy updates and traffic switching are achieved.

CN113157746BActive Publication Date: 2025-09-02ZUOYEBANG EDUCATION TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110477959.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-30
Publication Date
2025-09-02
Estimated Expiration
2041-04-30

AI Technical Summary

Technical Problem

The prior art requires two sets of servers to conduct small traffic retrieval experiments when updating the search strategy, resulting in complex resource waste and flow cutting operations, which are costly and inconvenient.

Method used

By dynamically calling the number of Shard shards in the search database, a logical group matching the search traffic is generated, and search policy updates and traffic switching are performed on the logical group. The architectural structure characteristics of the distributed storage system are used to reduce resource consumption and simplify the switching process.

Benefits of technology

It realizes traffic switching on the same set of database services, reduces resource consumption, simplifies operations, improves the efficiency and flexibility of retrieval policy updates, and ensures data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157746B_ABST
    Figure CN113157746B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of intelligent retrieval technology, and discloses a search traffic switching method, device, and computer-readable storage medium. The search traffic switching method includes: configuring search traffic; dynamically calling the number of Shard shards of each Node node of the retrieval database, and automatically generating a logical group that matches the search traffic according to the configuration; updating the retrieval strategy for the logical group, and switching the search traffic to the updated logical group. The search traffic switching method of the present invention automatically switches traffic through traffic configuration at the upper service layer based on the architectural structure characteristics of the distributed storage system of the retrieval database; dynamically calling the number of Shard shards of each Node node of the retrieval database, and automatically generating a logical group that matches the search traffic according to the configuration to perform a test before the retrieval strategy is updated. Only the configuration and distribution of traffic and the corresponding logical group are performed, and resource consumption is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent retrieval technology, and in particular to a search traffic switching method, device, and computer-readable storage medium. Background Art

[0002] Intelligent retrieval is the process of searching for data and information through computers. The four basic elements of intelligent retrieval are to simulate human cognitive functions and intelligent activities, effectively utilize all knowledge sources, and quickly find information that meets user needs.

[0003] For intelligent retrieval systems, the retrieval database and retrieval strategy are their main core and directly affect the retrieval results. In order to continuously improve the comprehensiveness and relevance of the retrieval system's retrieval results, the retrieval database needs to be constantly updated. At the same time, the retrieval strategy also needs to be updated or changed in a timely manner. However, unlike the update of the retrieval database, the update or change of the retrieval strategy needs to be very cautious, because once the retrieval strategy is updated or changed unreasonably, it will directly affect the retrieval results and directly affect the user's retrieval experience. Therefore, before updating or changing the retrieval strategy, a small-traffic retrieval test is required. The so-called small-traffic retrieval test is to control and switch a small part of the search traffic request to the retrieval database where the new retrieval strategy is located, and judge whether the new retrieval strategy meets the requirements of the update and upgrade based on the results of the small-traffic retrieval test.

[0004] However, search strategies are based on a search database, which can only execute one set of search strategies. Therefore, low-traffic search tests cannot affect normal searches. Therefore, existing techniques involve reconfiguring a new server to store the search database for low-traffic search tests. The low-traffic search test results are obtained by switching the low-traffic search test traffic to the new server. Since the low-traffic search test and normal search requests are handled by separate servers, the low-traffic search test will not affect normal search requests.

[0005] The existing small traffic search test plan: start two sets of services and send traffic to different services for experimental comparison. The shortcomings of the existing small traffic search test plan are:

[0006] 1. It consumes resources and requires twice the service resources to support it. It is time-consuming and labor-intensive, and the cost is relatively high. In addition, the new server is only used to retrieve small traffic tests, resulting in a waste of resources.

[0007] 2. Small flow retrieval tests require upstream control, and flow cutting is troublesome.

[0008] In view of this, the present invention is proposed. Summary of the Invention

[0009] In order to solve the above problems, the present invention proposes a search traffic switching solution that consumes less resources and has simple and convenient traffic switching.

[0010] In order to achieve the above-mentioned object of the invention, the present invention provides the following technical solutions:

[0011] A search traffic switching method, comprising:

[0012] Configure search traffic;

[0013] Dynamically call the number of Shard shards of each Node node of the retrieval database, and automatically generate logical groups that match the search traffic according to the configuration;

[0014] A search strategy is updated for the logical group, and search traffic is switched to the updated logical group.

[0015] As an optional embodiment of the present invention, the dynamic call to retrieve the number of Shard shards of each Node node in the database and automatically generate a logical group matching the search traffic according to the configuration include:

[0016] Calculate the total number of Shards in the configured logical group based on search traffic;

[0017] Obtain the total number and status of Shard shards of each Node node, and call the Shard shards on each Node node to configure them into logical groups according to the calculated total number of Shard shards.

[0018] As an optional embodiment of the present invention, the configuring of the Shard shards in each Node node into logical groups according to the calculated total number of Shard shards includes:

[0019] The retrieval database is divided into N Node nodes, and each Node node deploys multiple identical Shard slices;

[0020] Traverse each Node node to obtain the total number of Shard shards of each Node node and the idle Shard shards not occupied by logical groups;

[0021] According to the calculated total number of Shard shards, one or more idle Shard shards in each Node node are called to configure into a logical group.

[0022] As an optional embodiment of the present invention, the configuring one or more idle Shard shards in each Node node into a logical group according to the calculated total number of Shard shards includes:

[0023] According to the calculated total number of Shard shards and the logical relationship between the Node nodes, the number of idle Shard shards to call each Node node is determined.

[0024] As an optional implementation manner of the present invention, updating the search strategy for the logical group and switching the search traffic to the updated logical group includes:

[0025] The search strategy to be executed is updated for the configured logical group, the search traffic request configured for the logical group is switched to the logical group, and the search result of the search traffic on the logical group is monitored.

[0026] As an optional embodiment of the present invention, the monitoring of search results of search traffic on a logical group includes:

[0027] Obtain the index data of each logical group in the search results respectively;

[0028] Analyze and compare the index data of each logic group that needs to be compared for test results to obtain the retrieval test results of the retrieval strategy executed by the logic group;

[0029] Optionally, the indicator data includes the number of search results, and / or the time of response to the search request, and / or the relevance of the search result matching.

[0030] As an optional embodiment of the present invention, the search traffic switching method of the present invention, the logical group includes multiple first logical groups that all execute the first search strategy, and the search traffic of each first logical group and / or the number of Shard shards of each Node node are adjusted by configuration. The search traffic running results after the search strategy of each first logical group is updated are used to obtain the search traffic carrying capacity of the first search strategy.

[0031] As an optional implementation manner of the present invention, before configuring the search traffic, it is necessary to determine the logical group search strategy to be executed by the logical group, and configure the search traffic according to the logical group search strategy;

[0032] Optionally, the search traffic may be manually configured according to the logical group search strategy, or automatically configured according to the test traffic requirement of the logical group search strategy.

[0033] The present invention also provides a search traffic switching device, comprising:

[0034] Traffic configuration module, configure search traffic;

[0035] The logic group configuration module dynamically calls the number of Shard shards of each Node node of the retrieval database and automatically generates a logic group that matches the search traffic according to the configuration;

[0036] and an update control module to update the search strategy for the logical group and switch the search traffic to the updated logical group.

[0037] The present invention also provides a computer-readable storage medium storing a computer-executable program, which, when executed, implements the search traffic switching method.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] Since the data in the retrieval database is divided and stored on each Node node, and in order to improve the concurrent processing capability of a single Node node, multiple identical Shard shards are deployed on each Node node. Therefore, the present invention configures the search traffic and calls the Shard shard configuration on each Node node to match the search traffic. Since the Shard shards of the logical group come from each Node node, the data integrity of the retrieval database is guaranteed. As for the number of Shard shards called on each Node node, it depends on the configured logical group required by the search traffic.

[0040] Therefore, the search traffic switching method of the present invention is used for retrieval strategy testing. According to the architectural structure characteristics of the distributed storage system of the retrieval database, the traffic is automatically switched at the upper service layer through the configuration of the traffic; the number of Shard shards of each Node node of the retrieval database is dynamically called, and a logical group matching the search traffic is automatically generated according to the configuration to perform a test before the retrieval strategy is updated. Only the configuration and distribution of the traffic and the corresponding logical group are performed, and resource consumption is low; the logical group is linked with the update control system configuration, which is convenient for switching the search traffic and also convenient for the search traffic configuration logical group.

[0041] The advantages of the search traffic switching method of the present invention are:

[0042] 1. The search traffic switching method of the present invention is based on the same set of database services, and only performs configuration and distribution of traffic and corresponding logical groups, with low resource consumption.

[0043] 2. The traffic switching of the search traffic switching method of the present invention is transparent to the upstream and the services are decoupled.

[0044] 3. The control system configuration is linked with the search traffic configuration to facilitate the search traffic configuration logic group. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of the search traffic switching method of the present invention;

[0046] Figure 2 A flowchart of step S200 in the search traffic switching method of the present invention;

[0047] Figure 3 A flowchart of step S230 in the search traffic switching method of the present invention;

[0048] Figure 4 A flowchart of step S300 in the search traffic switching method of the present invention;

[0049] Figure 5 Module architecture diagram of the search traffic switching device of the present invention. DETAILED DESCRIPTION

[0050] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.

[0051] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely represents some embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0052] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions therein may be combined with each other.

[0053] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not require further definition or explanation in subsequent drawings.

[0054] In the description of the present invention, it should be noted that the terms "upper" and "lower" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or the orientations or positional relationships in which the inventive product is typically placed when in use, or the orientations or positional relationships commonly understood by those skilled in the art. Such terms are intended solely to facilitate the description of the present invention and simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" and the like are used solely for distinction and should not be construed as indicating or implying relative importance.

[0055] See also Figure 1 As shown, this embodiment provides a search traffic switching method for retrieval strategy testing, including:

[0056] S100, configuring search traffic, where the search traffic refers to the traffic of retrieval requests;

[0057] S200, dynamically calling the number of Shard shards of each Node node of the retrieval database, and automatically generating a logical group matching the search traffic according to the configuration;

[0058] S300: Update the search strategy for the logical group and switch the search traffic to the updated logical group.

[0059] In the field of intelligent retrieval technology, the amount of data stored in a retrieval database is too large to be stored entirely on a single device. Therefore, a distributed storage system is needed to store the retrieval database across multiple devices. Data sharding is a technology used to determine the distribution of data across multiple storage devices.

[0060] The storage layer VServer (virtual server) is a logical storage server and a storage unit of a distributed storage system. Multiple VServers can be deployed on a physical device. A VServer supports one write process and multiple read processes.

[0061] Using VServer will provide the following benefits:

[0062] Improve single-machine performance

[0063] In order to avoid introducing a complex locking mechanism, a single writing process design is adopted. If there is only one writing process on a single machine, the writing concurrency capability will be limited. Through the VServer method, the storage resources (memory, hard disk) on the single machine are divided into multiple storage units. This supports multiple writing processes working at the same time, greatly improving the writing concurrency capability of a single machine.

[0064] Better deployment scalability

[0065] The VServer method is very flexible in deployment. The number of VServers can be determined based on the resource situation of a single machine. Different numbers of VServers can be configured for different machine models. In this way, different machine models can fully utilize the resources on the machine. Even if multiple machine models are used in a system, the machine load can be relatively balanced.

[0066] Concepts related to data sharding

[0067] Schema:

[0068] Usually, for practical applications, there is no need to know the existence of middleware. Business developers only need to know the concept of database, so database middleware can be regarded as a logical library composed of one or more database clusters.

[0069] Logical table:

[0070] Since there are logical libraries, there must be logical tables. In a distributed database, for applications, the tables that read and write data are logical tables. A logical table can be distributed across one or more sharded libraries after data sharding, or it can be a single table without sharding.

[0071] Shard table:

[0072] These are tables with large data sets that need to be split across multiple databases. This way, each shard holds a portion of the data, and all shards together form the complete data set. In short, these are tables that need to be sharded.

[0073] Non-sharded table:

[0074] Not all tables in a database are large. Some tables do not need to be split. Non-sharded tables are relative to sharded tables, which are tables that do not require data splitting.

[0075] Shard Node (dataNode)

[0076] After data segmentation, a large table is divided into different shard databases, and the database where each table shard is located is the shard node (dataNode).

[0077] Node host (dataHost)

[0078] After data sharding, each shard node (dataNode) does not necessarily occupy a single machine. There can be multiple shard databases on the same machine. In this way, the machine where one or more shard nodes (dataNode) are located is the node host (dataHost). In order to avoid the concurrency limit of a single node host, try to evenly place shard nodes (dataNode) with high read and write pressure on different node hosts (dataHost).

[0079] Sharding rules

[0080] We have discussed data segmentation before. When a large table is divided into several shard tables, certain rules are required. The rule for dividing data into a certain shard according to certain business rules is called the sharding rule. It is very important to choose the appropriate sharding rule for data segmentation, which will greatly avoid the difficulty of subsequent data processing.

[0081] Since the data in the retrieval database is divided and stored on each Node node, and in order to improve the concurrent processing capabilities of a single Node node, multiple identical Shard shards are deployed on each Node node. Therefore, this embodiment configures the search traffic and calls the Shard shard configuration on each Node node to match the search traffic. Since the Shard shards of the logical group come from each Node node, the data integrity of the retrieval database is guaranteed. The number of Shard shards called on each Node node depends on the configured logical group required by the search traffic.

[0082] Therefore, the search traffic switching method of this embodiment automatically switches the traffic through traffic configuration at the upper service layer according to the architectural structure characteristics of the distributed storage system of the retrieval database; dynamically calls the number of Shard shards of each Node node of the retrieval database, and automatically generates a logical group matching the search traffic according to the configuration to perform a test before the retrieval strategy is updated. Only the configuration and distribution of the traffic and the corresponding logical group are performed, and less resource consumption is consumed; the logical group is linked with the update control system configuration, which is convenient for switching the search traffic and also convenient for updating the search traffic configuration logical group.

[0083] The advantages of the search traffic switching method of this embodiment are:

[0084] 1. The search traffic switching method of this embodiment is based on the same set of database services, and only performs configuration and distribution of traffic and corresponding logical groups, which consumes less resources.

[0085] 2. The traffic switching of the search traffic switching method of this embodiment is transparent to the upstream, and the services are decoupled.

[0086] 3. Update the control system configuration and search traffic configuration to facilitate the update of the search traffic configuration logic group.

[0087] As an optional implementation of this embodiment, see Figure 2 As shown, the embodiment of the dynamic call to retrieve the number of Shard shards of each Node node in the database and automatically generate logical groups that match the search traffic according to the configuration include:

[0088] S210, calculating the total number of Shards in the configured logical group based on the search traffic;

[0089] S220, obtain the total number and status of Shard shards of each Node node;

[0090] S230, calling the Shard shards in each Node node to configure into logical groups according to the calculated total number of Shard shards.

[0091] The total number of Shard shards of the configured logical group in step S210 of this embodiment can be calculated by a preset model formula. The model formula is a mathematical relationship between the search traffic and the total number of Shard shards of the logical group. The total number of Shard shards of the configured logical group can be obtained by inputting the search traffic.

[0092] In step S220 of this embodiment, the status of the Shard segment mainly requires determining whether the Shard segment has been configured to a logical group, or whether the Shard segment has the permission to be configured.

[0093] Further, see Figure 3 As shown, in this embodiment, the Shard shards in each Node node are respectively called according to the calculated total number of Shard shards to configure them into logical groups, including:

[0094] S231, the search database is divided into N Node nodes, and each Node node deploys multiple identical Shard slices;

[0095] S232: traverse each Node node to obtain the total number of Shard shards of each Node node and the idle Shard shards not occupied by the logical group. A Shard shard can only be allocated to one logical group. An already allocated Shard shard cannot be allocated to another logical group.

[0096] S233: According to the calculated total number of Shard shards, one or more idle Shard shards on each Node are called to configure into a logical group.

[0097] In addition, the number of idle Shard slices called on each Node node also depends on whether there is a logical relationship between the Node nodes. If so, it is necessary to call Shard slices that meet the quantity or proportion requirements according to the logical relationship between the Node nodes.

[0098] Specifically, calling one or more idle Shard shards in each Node node according to the calculated total number of Shard shards to configure into a logical group includes:

[0099] According to the calculated total number of Shard shards and the logical relationship between the Node nodes, the number of idle Shard shards to call each Node node is determined.

[0100] As an optional implementation of this embodiment, see Figure 5 As shown, in the search traffic switching method of this embodiment, updating the search strategy for the logical group and switching the search traffic to the updated logical group includes:

[0101] S310, updating the search strategy to be executed for the configured logical group;

[0102] S320: Switch the search traffic request configured by the logical group to the logical group, and monitor the search result of the search traffic on the logical group.

[0103] The search traffic switching method of this embodiment switches the search traffic to implement a small-traffic search test by configuring a logic group and updating it synchronously with the search strategy, and determines the effectiveness of the search strategy based on the search result data of the small-traffic search test.

[0104] Furthermore, the monitoring of search results of search traffic on a logical group in this embodiment includes:

[0105] S330, respectively obtaining the index data in the search results of each logical group;

[0106] S340, analyzing and comparing the indicator data of each logic group that needs to be compared for the test effect;

[0107] S350: Obtain the effect of the search strategy executed by the logical group.

[0108] Optionally, the indicator data includes the number of search results, and / or the time of response to the search request, and / or the relevance of the search result matching.

[0109] Because the search traffic switching method of this embodiment can configure logical groups based on search traffic, it is possible to compare the effectiveness of the search strategy to be updated with the existing search strategy, as well as compare the effectiveness of low-traffic tests of multiple search strategies. Once the search strategy and the low-traffic test requirements for the search strategy are determined, a matching logical group can be configured to conduct the search strategy update test.

[0110] The search traffic switching method of this embodiment, when comparing the effects between the search strategy to be updated and the existing search strategy, configures a logical group that matches the search strategy to be updated, updates the search strategy to be executed for the configured logical group, and switches the search traffic request configured by the logical group to the said logical group; configures a matching logical group according to the existing online search strategy, and switches the traffic to the logical group of the existing search strategy; compares the traffic test results of the logical group of the search strategy to be updated with the traffic test results of the logical group of the existing online search strategy, and makes a comprehensive evaluation of the search strategy to be updated based on the data volume, relevance and ranking of the search results to determine whether it meets the conditions for updating the search strategy.

[0111] When comparing the effects of small-traffic tests on multiple sets of search strategies, the search traffic switching method of this embodiment configures logical groups that match each set of search strategies, updates the search strategies to be executed for each configured logical group, and switches the search traffic requests configured for each logical group to the logical group; compares the traffic test results of the logical groups of each search strategy, makes a comprehensive evaluation of the search strategy to be updated based on the data volume, relevance, and ranking of the search results, and gives a comprehensive ranking of each search strategy for reference in selecting the search strategy.

[0112] In addition, a search traffic switching method of this embodiment can also achieve the effect of the same search strategy to cope with various search traffic, which has certain guiding significance for the configuration and expansion of the service host of the retrieval database. Specifically, the logical group described in this embodiment includes multiple first logical groups that all execute the first search strategy. The search traffic of each first logical group and / or the number of Shard shards of each Node node are adjusted by configuration, and the search traffic carrying capacity of the first search strategy is obtained according to the search traffic operation results after the search strategy of each first logical group is updated.

[0113] The search traffic operation results of this embodiment mainly refer to the search response time. The search traffic operation results after updating the search strategy according to each first logical group obtain the search traffic carrying capacity of the first search strategy execution mainly based on the relationship between the search traffic and the search response time. When the search traffic exceeds a certain value, the search response time exceeds the acceptable maximum search response time, which is used to determine whether the search strategy meets the conditions for updating.

[0114] As an optional implementation method of this embodiment, before configuring the search traffic in the search traffic switching method described in this embodiment, it is necessary to determine the logical group retrieval strategy to be executed by the logical group, and configure the search traffic according to the logical group retrieval strategy. Since the retrieval strategy has different requirements for the small-traffic retrieval test, some retrieval strategies need to verify the number of search results, and a smaller search traffic can be configured. Some retrieval strategies need to verify the response time of the search, and a matching search traffic needs to be configured. Therefore, it is necessary to configure the search traffic according to the retrieval strategy for the small-traffic retrieval to be performed.

[0115] Optionally, the search traffic may be manually configured according to the logical group search strategy, or automatically configured according to the test traffic requirement of the logical group search strategy.

[0116] A search traffic switching method of this embodiment deploys a dynamic logic group module on the upper layer of the retrieval service. The dynamic logic group module can realize traffic configuration and logical calculation configuration. The creation of the corresponding logic group can be completed by inputting the traffic value to be configured.

[0117] Furthermore, the traffic configuration of this embodiment is executed by hot loading, so the dynamic logic group module needs to dynamically configure the logic group according to the hot loaded traffic configuration information and real-time component corresponding logic group.

[0118] The dynamic logic group module of this embodiment includes a logic group calculation unit that receives hot-loaded traffic configuration information and performs dynamic configuration of the logic group.

[0119] As an optional implementation of this embodiment, referring to Figure 5, in a search traffic switching method for retrieval strategy testing of this embodiment, the retrieval database is divided on the first Node node, the second Node node, ... and the Nth Node node, the first Node node deploys the same Shard 1, Shard 2, ..., Shard N1, the second Node node deploys the same Shard 1, Shard 2, ..., Shard N2, ..., the Nth Node node deploys the same Shard 1, Shard 2, ..., Shard Nn, and the number of Shards N1, N2, ..., Nn on each Node node is different or at least partially the same. When performing logical group configuration, the dynamic logical group module of this embodiment obtains the number of Shards on the first Node node, the second Node node, ... and the Nth Node node respectively, and each Node node calls at least one Shard to ensure the data integrity of the logical group.

[0120] As shown in Figure 5, this embodiment also provides a search traffic switching device, including:

[0121] Traffic configuration module, configure search traffic;

[0122] The logic group configuration module dynamically calls the number of Shard shards of each Node node of the retrieval database and automatically generates a logic group that matches the search traffic according to the configuration;

[0123] and update the control module to switch the search traffic online according to the logical group.

[0124] Since the data in the retrieval database is divided and stored on each Node node, and in order to improve the concurrent processing capability of a single Node node, multiple identical Shard shards are deployed on each Node node. Therefore, the search traffic switching device of this embodiment configures the search traffic through the traffic configuration module, and the logical group configuration module calls the Shard shard configuration on each Node node to match the logical group of the search traffic. Since the Shard shards of the logical group come from each Node node, the data integrity of the retrieval database is guaranteed. As for the number of Shard shards called on each Node node, it depends on the logical group configured for the search traffic.

[0125] Therefore, the search traffic switching device of this embodiment automatically switches the traffic through traffic configuration at the upper service layer according to the architectural structure characteristics of the distributed storage system of the retrieval database; dynamically calls the number of Shard shards of each Node node of the retrieval database, and automatically generates a logical group matching the search traffic according to the configuration; the logical group configuration module is linked with the update control module to facilitate switching of search traffic and also facilitate the search traffic configuration logical group to update the retrieval strategy.

[0126] The advantages of the search traffic switching device of this embodiment are:

[0127] 1. The search traffic switching device of this embodiment is based on the same set of database services and only performs configuration and distribution of traffic and corresponding logical groups, thus consuming less resources.

[0128] 2. The traffic switching of the search traffic switching device of this embodiment is transparent to the upstream, and the services are decoupled.

[0129] 3. The update control module of the search traffic switching device of this embodiment is linked with the logic group configuration module to facilitate the update retrieval strategy of the search traffic configuration logic group.

[0130] As an optional implementation of this embodiment, the logic group configuration module in this embodiment dynamically calls the number of shards of each node node in the retrieval database and automatically generates a logic group that matches the search traffic according to the configuration, including:

[0131] Calculate the total number of Shards in the configured logical group based on search traffic;

[0132] Obtain the total number and status of Shard shards of each Node node, and call the Shard shards in each Node node to configure them into logical groups according to the calculated total number of Shard shards.

[0133] In this embodiment, the total number of Shard shards of the configured logical group can be calculated by a preset model formula. The total number of Shard shards of the configured logical group can be obtained by inputting search traffic.

[0134] Furthermore, the logical group configuration module of this embodiment calls the Shard shards in each Node node to configure the logical group according to the calculated total number of Shard shards, including:

[0135] The retrieval database is divided into N Node nodes, and each Node node deploys multiple identical Shard slices;

[0136] Traverse each Node node to obtain the total number of Shard shards of each Node node and the idle Shard shards not occupied by logical groups;

[0137] According to the calculated total number of Shard shards, one or more idle Shard shards on each Node are called to configure into a logical group.

[0138] In addition, the number of idle Shard slices called on each Node node also depends on whether there is a logical relationship between the Node nodes. If so, it is necessary to call Shard slices that meet the quantity or proportion requirements according to the logical relationship between the Node nodes.

[0139] Specifically, the logical group configuration module of this embodiment calls one or more idle Shard shards in each Node node according to the calculated total number of Shard shards to configure them into logical groups, including:

[0140] According to the calculated total number of Shard shards and the logical relationship between the Node nodes, the number of idle Shard shards to call each Node node is determined.

[0141] As an optional implementation manner of this embodiment, the update control module of the search traffic switching device of this embodiment updates the search strategy for the logical group and switches the search traffic to the updated logical group, including:

[0142] After the logical group configuration module of this embodiment completes the configuration of the logical group, the update control module works in conjunction with the logical group configuration module to synchronize the configured logical group and the search strategy to be executed online, switching the search traffic request configured for the logical group to the logical group. The search traffic switching device of this embodiment includes a monitoring module that monitors the search results of the search traffic on the logical group.

[0143] A search traffic switching device of this embodiment configures a logic group and goes online synchronously with the search strategy, switches the search traffic to implement a small-traffic search test, and determines the effectiveness of the search strategy based on the search result data of the small-traffic search test.

[0144] Furthermore, the monitoring module of this embodiment monitors the search results of the search traffic on the logical group, including:

[0145] Obtain the index data of each logical group in the search results respectively;

[0146] The index data of each logic group that needs to be compared for test results are analyzed and compared to obtain the retrieval test results of the retrieval strategy executed by the logic group.

[0147] Optionally, the indicator data includes the number of search results, and / or the time of response to the search request, and / or the relevance of the search result matching.

[0148] Because the search traffic switching device of this embodiment can configure logical groups based on search traffic, it can compare the effectiveness of new search strategies with existing ones, as well as compare the effectiveness of low-traffic tests for multiple search strategies. Once the search strategy and the low-traffic test requirements for the search strategy are determined, a matching logical group can be configured, and the update test can be performed.

[0149] In addition, a search traffic switching device of this embodiment can also achieve the effect of the same search strategy to cope with various search traffics, which has certain guiding significance for the configuration and expansion of the service host of the retrieval database. Specifically, the logical group described in this embodiment includes multiple first logical groups that all execute the first search strategy. The search traffic of each first logical group and / or the number of Shard shards of each Node node are adjusted by configuration, and the search traffic carrying capacity of the first search strategy is obtained according to the search traffic operation results after the search strategy of each first logical group is updated.

[0150] As an optional implementation of this embodiment, the traffic configuration module in the search traffic switching device described in this embodiment must determine the logical group search strategy to be executed by the logical group before configuring the search traffic, and configure the search traffic based on the logical group search strategy. Because the search strategy has different requirements for low-traffic search tests, it is necessary to configure the search traffic based on the search strategy of the low-traffic search test to be performed.

[0151] Optionally, the search traffic may be manually configured according to the logical group search strategy, or automatically configured according to the test traffic requirement of the logical group search strategy.

[0152] A search traffic switching device of this embodiment deploys a dynamic logic group module on the upper layer of the retrieval service. The dynamic logic group module can realize traffic configuration and logical calculation configuration. The creation of the corresponding logic group can be completed by inputting the traffic value to be configured.

[0153] Furthermore, the traffic configuration of this embodiment is executed by hot loading, so the dynamic logic group module needs to dynamically configure the logic group according to the hot loaded traffic configuration information and real-time component corresponding logic group.

[0154] The dynamic logic group module of this embodiment includes a logic group calculation unit that receives hot-loaded traffic configuration information and performs dynamic configuration of the logic group.

[0155] As an optional implementation of this embodiment, see Figure 5 As shown, a search traffic switching device of this embodiment, the retrieval database is divided into the first Node node, the second Node node, ... and the Nth Node node, the first Node node deploys the same Shard 1, Shard 2, ..., Shard N1, the second Node node deploys the same Shard 1, Shard 2, ..., Shard N2, ..., the Nth Node node deploys the same Shard 1, Shard 2, ..., Shard Nn, the number of Shards N1, N2, ..., Nn on each Node node is different or at least partially the same. When performing logical group configuration, the dynamic logical group module of this embodiment obtains the number of Shards on the first Node node, the second Node node, ... and the Nth Node node respectively, and each Node node calls at least one Shard to ensure the data integrity of the logical group.

[0156] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer executable program. When the computer program is executed by the processor, the processor executes the search traffic switching method.

[0157] The electronic device is implemented as a general-purpose computing device. The processor may be one or multiple processors operating in concert. The present invention also does not exclude distributed processing, meaning the processors may be dispersed across different physical devices. The electronic device of the present invention is not limited to a single entity but may also be the sum of multiple physical devices.

[0158] The memory stores a computer executable program, typically a machine-readable code, which can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least some of the steps in the method.

[0159] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).

[0160] It should be understood that the electronic devices of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as screens, and some electronic devices also include human-computer interaction elements such as buttons and keyboards. As long as the electronic device can execute a computer-readable program stored in its memory to implement the method of the present invention or at least some of the steps of the method, it is considered an electronic device covered by the present invention.

[0161] This embodiment also provides a computer-readable storage medium storing a computer-executable program. When the computer-executable program is executed, the search traffic switching method is implemented.

[0162] The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. The data signal propagated may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0163] Through the above description of the implementation mode, it is easy for those skilled in the art to understand that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and the electronic processing unit, server, client, mobile phone, control unit, processor, etc. contained in the system. The present invention can also be implemented by computer software that executes the method of the present invention, such as control software executed by a microprocessor, an electronic control unit, a client, a server, etc. However, it should be noted that the computer software that executes the method of the present invention is not limited to being executed by one or more specific hardware entities, and it can also be implemented in a distributed manner by unspecified specific hardware. For computer software, the software product can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), or it can be distributed and stored on a network, as long as it enables an electronic device to execute the method according to the present invention.

[0164] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although this specification has described the present invention in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.

Claims

1. A search traffic switching method, characterized in that: include: Configure search traffic; Dynamically call the number of Shard shards of each Node node of the retrieval database, and automatically generate logical groups that match the search traffic according to the configuration; updating the search strategy for the logical group and switching the search traffic to the updated logical group; The dynamic call to retrieve the number of Shards of each Node node in the database and automatically generate logical groups that match the search traffic according to the configuration include: Calculate the total number of Shards in the configured logical group based on search traffic; Obtain the total number and status of Shard shards of each Node node, and call the Shard shards on each Node node to configure them into logical groups according to the calculated total number of Shard shards; The configuring of the Shard shards in each Node node into logical groups according to the calculated total number of Shard shards includes: The retrieval database is divided into N Node nodes, and each Node node deploys multiple identical Shard slices; Traverse each Node node to obtain the total number of Shard shards of each Node node and the idle Shard shards not occupied by logical groups; According to the calculated total number of Shard shards, one or more idle Shard shards in each Node node are called to configure into a logical group.

2. A search traffic switching method according to claim 1, characterized in that: The configuring of one or more idle Shard shards in each Node node into a logical group according to the calculated total number of Shard shards includes: According to the calculated total number of Shard shards and the logical relationship between the Node nodes, the number of idle Shard shards to call each Node node is determined.

3. A search traffic switching method according to claim 1, characterized in that: The updating of the search strategy for the logical group and switching the search traffic to the updated logical group includes: The search strategy to be executed is updated for the configured logical group, the search traffic request configured for the logical group is switched to the logical group, and the search result of the search traffic on the logical group is monitored.

4. A search traffic switching method according to claim 3, characterized in that: The monitoring of search results of search traffic on the logical group includes: Obtain the index data of each logical group in the search results respectively; The index data of each logic group that needs to be compared for test results are analyzed and compared to obtain the retrieval test results of the retrieval strategy executed by the logic group.

5. A search traffic switching method according to claim 4, characterized in that: The indicator data includes the number of search results, and / or the time of response to the search request, and / or the relevance of the search result matching.

6. A search traffic switching method according to claim 3, characterized in that: The logical group includes multiple first logical groups that all execute the first search strategy. The search traffic of each first logical group and / or the number of Shard shards of each Node node are adjusted by configuration, and the search traffic carrying capacity of the first search strategy is obtained according to the search traffic operation results after the search strategy of each first logical group is updated.

7. A search traffic switching method according to any one of claims 1 to 6, characterized in that: Before configuring the search traffic, it is necessary to determine the logical group search strategy to be executed by the logical group, and configure the search traffic according to the logical group search strategy.

8. A search traffic switching method according to claim 7, characterized in that: The search traffic may be manually configured according to the logic group search strategy, or automatically configured according to the test traffic requirement of the logic group search strategy.

9. A search traffic switching device, characterized in that: include: Traffic configuration module, configure search traffic; The logic group configuration module dynamically calls the number of Shard shards of each Node node of the retrieval database and automatically generates a logic group that matches the search traffic according to the configuration; and an update control module to update the search strategy for the logical group and switch the search traffic to the updated logical group; The logic group configuration module dynamically calls the number of Shard shards of each Node node in the retrieval database, and automatically generates logic groups that match the search traffic according to the configuration, including: Calculate the total number of Shards in the configured logical group based on search traffic; Obtain the total number and status of Shard shards of each Node node, and call the Shard shards in each Node node to configure them into logical groups according to the calculated total number of Shard shards; The logical group configuration module calls the Shard shards in each Node node to configure the logical group according to the calculated total number of Shard shards, including: The retrieval database is divided into N Node nodes, and each Node node deploys multiple identical Shard slices; Traverse each Node node to obtain the total number of Shard shards of each Node node and the idle Shard shards not occupied by logical groups; According to the calculated total number of Shard shards, one or more idle Shard shards on each Node are called to configure into a logical group.

10. A computer-readable storage medium, characterized in that A computer executable program is stored, and when the computer executable program is executed, a search traffic switching method according to any one of claims 1 to 8 is implemented.