Request processing method and apparatus, storage medium, and electronic device
By generating route identifier prefixes and user characteristic information for traffic selection, the problem of the difficulty in flexibly modifying and expanding routing strategies in existing technologies is solved, and more flexible and accurate query cluster determination is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
- Filing Date
- 2023-03-21
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies struggle to support flexible modification and expansion of routing strategies, and the routing distribution method is globally unique, making it unsuitable for flexible switching between different clusters and users.
By generating a route identifier prefix for the query request, and combining user characteristic information and preset cluster information, traffic is selected and the target query cluster is determined.
It enables flexible identification of different business and query requirements, avoiding the problem of route identification being difficult to modify or extend due to the addition of new business types or query requirements, and improving the accuracy of determining query clusters.
Smart Images

Figure CN116304224B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a request processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] As business content and types increase, and data volume grows exponentially, service query solutions will change according to cost and access volume. For example, when calling data services to query different business dimensions, different types of clusters will be called, or queries on the same dimension will be distributed to different clusters to provide query services according to changes in query requirements.
[0003] The current approach involves developers writing a complete routing method in the code to select the query cluster based on the target and dimension corresponding to the request, according to predefined rules. However, due to the rapid growth of data volume, the predefined targets and dimensions can no longer meet the routing requirements of business queries. Furthermore, there are situations where routing to different clusters may be determined based on the different needs of the caller. Therefore, the current approach is relatively simplistic, making it difficult to support flexible modification and expansion of routing strategies. In addition, the routing distribution method is globally unique and cannot support flexible switching.
[0004] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide a request processing method, apparatus, storage medium, and electronic device, thereby overcoming, to at least a certain extent, the problems of existing processing methods that are difficult to support flexible modification and expansion of routing strategies, have globally unique traffic distribution methods, and cannot support flexible switching.
[0006] According to one aspect of this disclosure, a request processing method is provided, comprising:
[0007] Obtain the query request initiated by the user for the target business;
[0008] Based on the parameter information corresponding to the target service and the query request, generate a route identifier prefix for the query request;
[0009] Based on the user's characteristic information and the routing identifier prefix corresponding to the query request, the preset cluster information is selected for traffic splitting, and the target query cluster for processing the user's query request is determined.
[0010] Optionally, generating a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request includes:
[0011] Based on the parameter information corresponding to the target service and the query request, determine the target cluster type used for the query;
[0012] The parameter information corresponding to the target service and the query request are concatenated to generate target concatenation information;
[0013] The routing identifier prefix is generated based on the target cluster type and the target splicing information.
[0014] Optionally, determining the target cluster type for querying based on the parameter information corresponding to the target service and the query request includes:
[0015] Based on the parameter information corresponding to the target business and the query request, determine the included dimension information;
[0016] If the number of dimension information items matches the number of pre-calculated dimensions, determine whether the dimension combination path corresponding to the dimension information item overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions.
[0017] If they overlap, the pre-computation cluster type indicated by the pre-computation path shall be used as the target cluster type; if they do not overlap, the associated cluster type corresponding to the target service shall be used as the target cluster type.
[0018] Optionally, if the number of dimensional information items does not match the pre-calculated number of dimensions, the method further includes:
[0019] Read the associated cluster type corresponding to the target service;
[0020] The associated cluster type is used as the target cluster type.
[0021] Optionally, determining the target cluster type for querying based on the parameter information corresponding to the target service and the query request includes:
[0022] Based on the parameter information corresponding to the target service, obtain the associated cluster type corresponding to the target service;
[0023] Use the associated cluster type as the target cluster type for querying.
[0024] Optionally, the step of concatenating the parameter information corresponding to the target service and the query request to generate target concatenation information includes:
[0025] Based on the parameter information corresponding to the target business and the query request, multiple target dimension information values are determined according to the preset dimension information value correspondence relationship;
[0026] The multiple target dimension information values are concatenated to generate the target concatenation information.
[0027] Optionally, the step of selecting and routing preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request includes:
[0028] At least one matching candidate cluster is determined from the preset cluster information based on the routing identifier prefix;
[0029] The user's identification code is calculated according to a preset segmentation strategy to obtain the traffic splitting result value;
[0030] The traffic splitting result value is compared with the preset traffic splitting ratio corresponding to the at least one candidate cluster to determine the target query cluster that matches the traffic splitting result value.
[0031] According to one aspect of this disclosure, a request processing apparatus is provided, the apparatus comprising:
[0032] The acquisition module is used to acquire query requests initiated by users for the target business.
[0033] The generation module is used to generate a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request;
[0034] The first determining module is used to perform traffic selection on preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request, and determine the target query cluster for the user to process the query request.
[0035] Optionally, the generation module is further configured to:
[0036] Based on the parameter information corresponding to the target service and the query request, determine the target cluster type used for the query;
[0037] The parameter information corresponding to the target service and the query request are concatenated to generate target concatenation information;
[0038] The routing identifier prefix is generated based on the target cluster type and the target splicing information.
[0039] Optionally, the generation module is further configured to:
[0040] Based on the parameter information corresponding to the target business and the query request, determine the included dimension information;
[0041] If the number of dimension information items matches the number of pre-calculated dimensions, determine whether the dimension combination path corresponding to the dimension information item overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions.
[0042] If they overlap, the pre-computation cluster type indicated by the pre-computation path shall be used as the target cluster type; if they do not overlap, the associated cluster type corresponding to the target service shall be used as the target cluster type.
[0043] Optionally, if the number of dimension information items does not match the pre-calculated number of dimensions, the device further includes:
[0044] The reading module is used to read the associated cluster type corresponding to the target service;
[0045] The second determining module is used to use the associated cluster type as the target cluster type.
[0046] Optionally, the generation module is further configured to:
[0047] Based on the parameter information corresponding to the target service, obtain the associated cluster type corresponding to the target service;
[0048] Use the associated cluster type as the target cluster type for querying.
[0049] Optionally, the generation module is further configured to:
[0050] Based on the parameter information corresponding to the target business and the query request, multiple target dimension information values are determined according to the preset dimension information value correspondence relationship;
[0051] The multiple target dimension information values are concatenated to generate the target concatenation information.
[0052] Optionally, the first determining module is further configured to:
[0053] At least one matching candidate cluster is determined from the preset cluster information based on the routing identifier prefix;
[0054] The user's identification code is calculated according to a preset segmentation strategy to obtain the traffic splitting result value;
[0055] The traffic splitting result value is compared with the preset traffic splitting ratio corresponding to the at least one candidate cluster to determine the target query cluster that matches the traffic splitting result value.
[0056] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the request processing method described in any of the preceding claims.
[0057] According to one aspect of this disclosure, an electronic device is provided, comprising:
[0058] Processor; and
[0059] Memory for storing the executable instructions of the processor;
[0060] The processor is configured to execute the request processing method described above by executing the executable instructions.
[0061] In summary, the request processing method provided in this disclosure can obtain a user's query request for a target service, generate a routing identifier prefix for the query request based on the parameter information corresponding to the target service and the query request, and perform traffic selection on preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request. In this way, by generating a routing identifier prefix for the query request, different services and different query requirements can be identified, thereby avoiding the problem of difficulty in modifying or expanding routing identifiers due to the addition of new service types or query requirements. Furthermore, determining the target query cluster by selecting the preset cluster information based on the user's feature information and the routing identifier prefix can adapt to traffic selection for different users and different routing identifiers, making the traffic selection method for determining the target query cluster more flexible, thereby improving the accuracy of query cluster determination.
[0062] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0063] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0064] Figure 1 This is a flowchart of the steps of a request processing method provided in an embodiment of this disclosure;
[0065] Figure 2 This is a flowchart illustrating the steps for generating a route identifier prefix according to an embodiment of this disclosure;
[0066] Figure 3 This is a flowchart illustrating the steps for determining a target cluster type according to an embodiment of this disclosure;
[0067] Figure 4This is a schematic diagram illustrating the determination of a target cluster type according to an embodiment of this disclosure;
[0068] Figure 5 This is a flowchart illustrating the steps for determining a target cluster type according to an embodiment of this disclosure;
[0069] Figure 6 This is a schematic diagram illustrating another method for determining the target cluster type provided in this embodiment of the disclosure;
[0070] Figure 7 This is a flowchart illustrating another step in determining the target cluster type provided in this embodiment of the disclosure;
[0071] Figure 8 This is a schematic diagram illustrating the determination of a target query cluster provided in an embodiment of this disclosure;
[0072] Figure 9 This is a block diagram of a request processing apparatus provided in an embodiment of this disclosure;
[0073] Figure 10 This is an electronic device provided in this disclosure for implementing the above-described request processing method. Detailed Implementation
[0074] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0075] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0076] Figure 1This is a flowchart of the steps of a request processing method provided in an embodiment of this disclosure, as follows: Figure 1 As shown, the method may include:
[0077] Step S101: Obtain the query request initiated by the user for the target business.
[0078] In this embodiment of the disclosure, the target business can be the business that the user indicates to query. The target business can be sales, logistics, finance, etc. The query request can be to query the business volume of the target business in a certain dimension. The query request can include information such as user ID, target business ID, and specific query content. Obtaining the query request initiated by the user for the target business can be based on the user's input operation. For example, the user can perform a click operation on the plugin corresponding to the target business on a webpage or client, and the terminal responds to the click operation by generating a query request for the target business.
[0079] Step S102: Generate a routing identifier prefix for the query request based on the parameter information corresponding to the target service and the query request.
[0080] In this embodiment of the disclosure, the parameter information corresponding to the target service can be information used to characterize the attribute features of the target service. For example, the parameter information can include information such as region, time, target audience, and customer traffic. Based on the parameter information corresponding to the target service and the query request, a routing identifier prefix for the query request is generated. This can be achieved by determining the cluster type used to process the query request based on the parameter information corresponding to the target service and the query request, then generating corresponding parameter concatenation information based on the parameter information corresponding to the target service and the query request, and finally combining the cluster type and parameter concatenation information to generate the routing identifier prefix for the query request.
[0081] It should be noted that the routing identifier prefix can be information used to indicate the route for handling the query request. The query route can refer to node A receiving a query request for a specific service from node B via communication transmission. After receiving the query request, node A calls node C, which is responsible for handling the query request. Node C responds to the query request, obtains the query results, and returns the results to node A. Node A then sends the received results to node B. For example, if the target service's service type is "biz," and the cluster type is determined to be "clickhouse" based on the parameter information and query request, and the concatenated information is scenario A, then the routing identifier prefix would be "biz.clkickhouse.A."
[0082] Step S103: Based on the user's feature information and the routing identifier prefix corresponding to the query request, perform traffic selection on the preset cluster information to determine the target query cluster for processing the user's query request.
[0083] In this embodiment, a matching candidate cluster may be selected from multiple preset cluster information based on the routing identifier prefix. Then, a target query cluster for processing the user's query request may be determined from the candidate clusters according to a preset traffic splitting selection strategy. The preset cluster information may be various pre-set clusters, such as JIMDB clusters, ES clusters, Clickhouse clusters, etc. The preset traffic splitting selection strategy may be a pre-set traffic splitting strategy for determining the target query cluster. Specifically, it may involve calculating the user's traffic splitting result value based on the user's feature information, comparing the traffic splitting result value with a preset traffic splitting ratio corresponding to each candidate cluster, determining the preset traffic splitting ratio that matches the traffic splitting result value, and then using the candidate cluster corresponding to the matched preset traffic splitting ratio as the target query cluster.
[0084] In summary, the request processing method provided in this disclosure can obtain a user's query request for a target service, generate a routing identifier prefix for the query request based on the parameter information corresponding to the target service and the query request, and perform traffic selection on preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request. In this way, by generating a routing identifier prefix for the query request, different services and different query requirements can be identified, thereby avoiding the problem of difficulty in modifying or expanding routing identifiers due to the addition of new service types or query requirements. Furthermore, determining the target query cluster by selecting the preset cluster information based on the user's feature information and the routing identifier prefix can adapt to traffic selection for different users and different routing identifiers, making the traffic selection method for determining the target query cluster more flexible, thereby improving the accuracy of query cluster determination.
[0085] Optionally, in this embodiment of the present disclosure, the operation of generating a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request is as follows: Figure 2 As shown, it can specifically include:
[0086] Step S1021: Based on the parameter information corresponding to the target service and the query request, determine the target cluster type used for querying.
[0087] In this embodiment of the disclosure, since the query cluster types corresponding to query requests for different services or different content can be different, it is necessary to determine the target cluster type for querying based on the parameter information corresponding to the target service and the characteristics of the query request. Specifically, corresponding associated cluster types for querying can be set in advance according to different services and different query requests. One implementation method is to directly determine the matching associated cluster type from the cluster type correspondence based on the parameter information corresponding to the target service and the characteristics of the query request, and use it as the target cluster type. Another implementation method is to determine the included dimension information based on the parameter information corresponding to the target service and the query request, and determine the target cluster type that meets the conditions based on the dimension information and the dimension combination path generated by the dimension information.
[0088] Step S1022: Concatenate the parameter information corresponding to the target service and the query request to generate target concatenation information.
[0089] In this embodiment, the parameter information corresponding to the target service can be the type, indicators, attributes, and other parameter information of the target service. To generate target concatenated information by concatenating the parameter information corresponding to the target service and the query request, a first feature can be extracted from the parameter information corresponding to the target service, a second feature can be extracted from the content of the query request, and then the first and second features can be concatenated to generate the target concatenated information. The extraction of the first and second features can be based on word statistics to extract keywords, such as the TF-IDF index and N-gram methods, or it can be a machine learning method for extracting keywords, or other keyword extraction methods.
[0090] For example, the parameter information corresponding to the target business is the business type "biz", and the associated cluster type set for this business type "biz" is the ClickHouse cluster. According to the parameter information and query request, the additional information to be added for routing is the scenario, that is, routing is performed according to the scenario. The additional parameter refers to the classification of the scenario, which can be divided into scenarios A, B, and C.
[0091] Step S1023: Generate the routing identifier prefix according to the target cluster type and the target splicing information.
[0092] In this embodiment, the target cluster type and target concatenation information can be combined according to a preset format to obtain the routing identifier prefix corresponding to the query request. This preset format can be pre-set according to actual conditions. The routing identifier prefix can be added to the attributes of the query request or stored as a tag corresponding to the query request.
[0093] Optionally, in this embodiment of the disclosure, the operation for determining the target cluster type corresponding to the target service based on the parameter information corresponding to the target service and the query request is as follows: Figure 3 As shown, it can specifically include:
[0094] Step S201: Determine the included dimension information based on the parameter information corresponding to the target business and the query request.
[0095] In this embodiment of the disclosure, features can be extracted from the parameter information corresponding to the target business and the query request to determine the included dimension information. For example, the business type, business characteristics, etc. can be determined based on the parameter information corresponding to the target business, and the corresponding query dimension can be determined based on the content of the query request, thereby obtaining all included dimension information.
[0096] Step S202: If the number of dimension information matches the number of pre-calculated dimensions, determine whether the dimension combination path corresponding to the dimension information overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions.
[0097] In this embodiment of the disclosure, the number of pre-computed dimensions can be obtained after pre-aggregating and calculating the dimensions. Specifically, the number of pre-computed dimensions can be set according to the actual application; for example, the number of pre-computed dimensions can be 8. Specifically, it can be first determined whether the number of dimension information obtained meets the number of pre-computed dimensions. If it meets the number of pre-computed dimensions, the corresponding dimension combination path is first generated based on the dimension information, and then it is determined whether the dimension combination path overlaps with the pre-computed path corresponding to the pre-computed dimensions.
[0098] Step S203: If they overlap, the pre-computation cluster type indicated by the pre-computation path shall be taken as the target cluster type; if they do not overlap, the associated cluster type corresponding to the target service shall be taken as the target cluster type.
[0099] In this embodiment of the disclosure, when the dimension combination path coincides with the pre-computation path corresponding to the pre-computation dimension, the pre-computation cluster type indicated by the pre-computation path can be used as the target cluster type. When the dimension combination path does not coincide with the pre-computation path corresponding to the pre-computation dimension, the associated cluster type corresponding to the target service can be used as the target cluster type.
[0100] Optionally, in this embodiment of the disclosure, if the number of dimension information items does not conform to the pre-calculated number of dimensions, the method may further include:
[0101] Read the associated cluster type corresponding to the target service; use the associated cluster type as the target cluster type.
[0102] In this embodiment of the disclosure, if the number of dimension information does not meet the pre-calculated number of dimensions, the associated cluster type corresponding to the target business can be directly read and the associated cluster type can be used as the target cluster type.
[0103] Example, Figure 4 This is a schematic diagram illustrating the determination of a target cluster type according to an embodiment of this disclosure, such as... Figure 4 As shown, S31, determine the dimension information based on the parameter information and query request; S32, determine whether the number of dimension information matches the pre-calculated number of dimensions. If yes, proceed to S33; otherwise, proceed to S35; S33, determine whether the dimension combination path overlaps with the pre-calculated path. If yes, proceed to S34; otherwise, proceed to S35; S34, use the pre-calculated cluster type as the target cluster type; S35, use the associated cluster type as the target cluster type.
[0104] Optionally, in this embodiment of the disclosure, the operation for determining the target cluster type corresponding to the target service based on the parameter information corresponding to the target service and the query request is as follows: Figure 5 As shown, it can specifically include:
[0105] Step S204: Obtain the associated cluster type corresponding to the target service based on the parameter information corresponding to the target service.
[0106] In this embodiment of the disclosure, the cluster type corresponding to the target service can be determined by searching the parameter information corresponding to the target service in the cluster type correspondence relationship, and the cluster type can be used as the associated cluster type.
[0107] Step S205: Use the associated cluster type as the target cluster type for querying the target business.
[0108] Example, Figure 6 This is a schematic diagram illustrating another method for determining the target cluster type provided in this embodiment of the disclosure, such as... Figure 6 As shown, S41, input the parameter information corresponding to the target service; S42, read the associated cluster type corresponding to the target service; S43, use the associated cluster type as the target cluster type.
[0109] Optionally, in this embodiment of the present disclosure, the operation of concatenating the parameter information corresponding to the target service and the query request to generate target concatenated information may specifically include:
[0110] Based on the parameter information corresponding to the target business and the query request, multiple target dimension information values are determined according to the preset dimension information value correspondence; the multiple target dimension information values are concatenated to generate the target concatenation information.
[0111] In this embodiment of the disclosure, the included dimension information may be determined first based on the parameter information and query request corresponding to the target business, and then the corresponding dimension information value may be determined from the preset dimension information value correspondence relationship according to the included dimension information to obtain multiple target dimension information values. Finally, the multiple target dimension information values may be concatenated to generate target concatenated information.
[0112] It's worth noting that the preset dimension information value mapping allows for the categorization of dimension information values, grouping those belonging to the same category together. This can reduce the number of route prefixes to a certain extent, lowering subsequent maintenance costs. For example, using the value of dim0 as part of the route prefix concatenation, this dimension information value contains 6 categories, which can be divided into two main categories. In this case, setting categorization values facilitates the use of cluster routing rules later, reducing the number of route identifier prefixes to about three times the original number.
[0113] Optionally, in this embodiment of the disclosure, the operation of selecting and routing preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request is as follows: Figure 7 As shown, it can specifically include:
[0114] Step S1031: Determine at least one matching candidate cluster from the preset cluster information based on the routing identifier prefix.
[0115] In this embodiment of the disclosure, corresponding cluster information can be pre-configured for different routing identifiers. Specifically, cluster information matching the routing identifier prefix can be determined from the preset cluster information to obtain at least one candidate cluster.
[0116] Step S1032: Calculate the identity identification code corresponding to the user according to the preset division strategy to obtain the traffic splitting result value.
[0117] In this embodiment, the user's identification code can be the user's Personal Identification Number (PIN), the user's Internet Protocol Address (IP), or other identification codes. This identification code can be obtained from a query request. The preset partitioning strategy can be pre-set according to actual conditions to guide the partitioning calculation of the user's identification code to obtain the traffic distribution result value. This preset partitioning strategy can involve first calculating the hash value corresponding to the user's identification code, then taking the modulo of the hash value based on a preset partitioning base value (mod), and using the modulo result as the traffic distribution result value corresponding to the user's identification code. The preset partitioning base value can be set according to actual conditions.
[0118] Step S1033: Compare the traffic splitting result value with the preset traffic splitting ratio corresponding to the at least one candidate cluster to determine the target query cluster that matches the traffic splitting result value.
[0119] In this embodiment, the traffic splitting result value can be compared with a preset traffic splitting ratio corresponding to at least one candidate cluster. The preset traffic splitting ratio that matches the result value is selected, and the candidate cluster corresponding to this matching ratio is used as the target query cluster. Using the same information, such as a pin, for partitioning considers that different clusters have different data sources for write tasks, which may lead to some differences. Partitioning based on the user's unique identifier ensures that the data seen during a query is consistent within a certain timeframe, improving the user query experience. For example, if the candidate clusters corresponding to the route identifier prefix are cluster A and cluster B, and the preset traffic splitting ratios for the candidate clusters are less than 40 for cluster A and greater than 40 for cluster B, and the traffic splitting result value calculated based on the user's identification code is 51, then the traffic splitting ratio matching the result value is greater than 40, and cluster B, with a traffic splitting ratio greater than 40, is used as the target query cluster.
[0120] Example, Figure 8 This is a schematic diagram illustrating the determination of a target query cluster provided in an embodiment of this disclosure, such as... Figure 8 As shown, S51, input the user's corresponding identification code; S52, calculate the traffic splitting result value according to the preset splitting strategy; S53, compare the traffic splitting result value with the preset traffic splitting ratio corresponding to the alternative machine 1 and alternative cluster 2. If they match, execute S54; if they do not match, execute S55; S54, use alternative cluster 1 as the target query cluster; S55, use alternative cluster 2 as the target query cluster.
[0121] Figure 9This is a block diagram of a request processing apparatus provided in an embodiment of this disclosure, such as... Figure 9 As shown, the device 60 may include:
[0122] The acquisition module 601 is used to acquire query requests initiated by users for the target business.
[0123] The generation module 602 is used to generate a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request;
[0124] The first determining module 603 is used to perform traffic selection on preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request, and determine the target query cluster for the user to process the query request.
[0125] In summary, the request processing apparatus provided in this embodiment can acquire query requests initiated by users for target services, generate routing identifier prefixes for query requests based on parameter information corresponding to the target service and the query request, and perform traffic selection on preset cluster information based on user feature information and the routing identifier prefixes corresponding to the query request to determine the target query cluster for processing the user's query request. In this way, by generating routing identifier prefixes for query requests, different services and different query requirements can be identified, thereby avoiding the problem of difficulty in modifying or expanding routing identifiers due to the addition of new service types or query requirements. Furthermore, determining the target query cluster by selecting preset cluster information based on user feature information and routing identifier prefixes can adapt to traffic selection for different users and different routing identifiers, making the traffic selection method for determining the target query cluster more flexible, thereby improving the accuracy of query cluster determination.
[0126] Optionally, the generation module 602 is further configured to:
[0127] Based on the parameter information corresponding to the target service and the query request, determine the target cluster type used for the query;
[0128] The parameter information corresponding to the target service and the query request are concatenated to generate target concatenation information;
[0129] The routing identifier prefix is generated based on the target cluster type and the target splicing information.
[0130] Optionally, the generation module 602 is further configured to:
[0131] Based on the parameter information corresponding to the target business and the query request, determine the included dimension information;
[0132] If the number of dimension information items matches the number of pre-calculated dimensions, determine whether the dimension combination path corresponding to the dimension information item overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions.
[0133] If they overlap, the pre-computation cluster type indicated by the pre-computation path shall be used as the target cluster type; if they do not overlap, the associated cluster type corresponding to the target service shall be used as the target cluster type.
[0134] Optionally, if the number of dimension information items does not match the pre-calculated number of dimensions, the device 60 further includes:
[0135] The reading module is used to read the associated cluster type corresponding to the target service;
[0136] The second determining module is used to use the associated cluster type as the target cluster type.
[0137] Optionally, the generation module 602 is further configured to:
[0138] Based on the parameter information corresponding to the target service, obtain the associated cluster type corresponding to the target service;
[0139] Use the associated cluster type as the target cluster type for querying.
[0140] Optionally, the generation module 602 is further configured to:
[0141] Based on the parameter information corresponding to the target business and the query request, multiple target dimension information values are determined according to the preset dimension information value correspondence relationship;
[0142] The multiple target dimension information values are concatenated to generate the target concatenation information.
[0143] Optionally, the first determining module 603 is further configured to:
[0144] At least one matching candidate cluster is determined from the preset cluster information based on the routing identifier prefix;
[0145] The user's identification code is calculated according to a preset segmentation strategy to obtain the traffic splitting result value;
[0146] The traffic splitting result value is compared with the preset traffic splitting ratio corresponding to the at least one candidate cluster to determine the target query cluster that matches the traffic splitting result value.
[0147] The specific details of each module in the above request processing device have been described in detail in the corresponding request processing methods, so they will not be repeated here.
[0148] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0149] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0150] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0151] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0152] The following reference Figure 10 To describe an electronic device 700 according to such an embodiment of the present disclosure. Figure 10 The electronic device 700 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0153] like Figure 10 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), and a display unit 740.
[0154] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 710 can perform actions such as... Figure 1The steps shown are: S101, obtaining a query request initiated by a user for a target service; S102, generating a routing identifier prefix for the query request based on the parameter information corresponding to the target service and the query request; and S103, selecting and distributing preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request.
[0155] Storage unit 720 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 7201 and / or cache memory 7202, and may further include a read-only memory (ROM) 7203.
[0156] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0157] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0158] Electronic device 700 can also communicate with one or more external devices 800 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0159] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0160] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.
[0161] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0162] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0163] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0164] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0165] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0166] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0167] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not invented by this disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A request processing method, characterized in that, The method includes: Obtain the query request initiated by the user for the target business; Based on the parameter information corresponding to the target service and the query request, generate a route identifier prefix for the query request; The step of generating a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request includes: Based on the parameter information corresponding to the target service and the query request, the target cluster type for querying is determined; according to the parameter information corresponding to the target service and the query request, the included dimension information is determined; if the number of dimension information matches the number of pre-calculated dimensions, it is determined whether the dimension combination path corresponding to the dimension information overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions; if they overlap, the pre-calculated cluster type indicated by the pre-calculated path is taken as the target cluster type; The parameter information corresponding to the target service and the query request are concatenated to generate target concatenation information; The route identifier prefix is generated based on the target cluster type and the target concatenation information; Based on the user's characteristic information and the routing identifier prefix corresponding to the query request, the preset cluster information is selected for traffic splitting, and the target query cluster for processing the user's query request is determined.
2. The method according to claim 1, characterized in that, The method further includes: If they do not overlap, the associated cluster type corresponding to the target service will be used as the target cluster type.
3. The method according to claim 1, characterized in that, If the number of dimensional information items does not match the pre-calculated number of dimensions, the method further includes: Read the associated cluster type corresponding to the target service; The associated cluster type is used as the target cluster type.
4. The method according to claim 1, characterized in that, The step of determining the target cluster type for querying based on the parameter information corresponding to the target service and the query request includes: Based on the parameter information corresponding to the target service, obtain the associated cluster type corresponding to the target service; Use the associated cluster type as the target cluster type for querying.
5. The method according to claim 1, characterized in that, The step of concatenating the parameter information corresponding to the target service and the query request to generate target concatenation information includes: Based on the parameter information corresponding to the target business and the query request, multiple target dimension information values are determined according to the preset dimension information value correspondence relationship; The multiple target dimension information values are concatenated to generate the target concatenation information.
6. The method according to claim 1, characterized in that, The step of selecting and routing preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request to determine the target query cluster for processing the user's query request includes: At least one matching candidate cluster is determined from the preset cluster information based on the routing identifier prefix; The user's identification code is calculated according to a preset segmentation strategy to obtain the traffic splitting result value; The traffic splitting result value is compared with the preset traffic splitting ratio corresponding to the at least one candidate cluster to determine the target query cluster that matches the traffic splitting result value.
7. A request processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire query requests initiated by users for the target business. The generation module is used to generate a route identifier prefix for the query request based on the parameter information corresponding to the target service and the query request; The generation module is used to determine the target cluster type for querying based on the parameter information corresponding to the target service and the query request; determine the included dimension information according to the parameter information corresponding to the target service and the query request; if the number of dimension information meets the number of pre-calculated dimensions, determine whether the dimension combination path corresponding to the dimension information overlaps with the pre-calculated path; the pre-calculated path is determined based on the number of pre-calculated dimensions; if they overlap, the pre-calculated cluster type indicated by the pre-calculated path is taken as the target cluster type. The parameter information corresponding to the target service and the query request are concatenated to generate target concatenation information; The route identifier prefix is generated based on the target cluster type and the target concatenation information; The first determining module is used to perform traffic selection on preset cluster information based on the user's feature information and the routing identifier prefix corresponding to the query request, and determine the target query cluster for the user to process the query request.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the request processing method according to any one of claims 1-6.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the request processing method according to any one of claims 1-6 by executing the executable instructions.