Traffic scheduling method and device, equipment, storage medium and program product
By dynamically allocating query traffic to the high-availability cluster based on performance metrics data, the problem of not considering the current status of the cluster in existing technologies is solved, and service stability and resource utilization are optimized in high-concurrency and low-latency scenarios.
Patent Information
- Application Number
- CN202511897675.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-02-27
AI Technical Summary
In high-concurrency, low-latency query analysis scenarios, existing technologies for multi-cluster traffic distribution do not take into account the current status of the clusters, leading to abnormal clusters handling query traffic and affecting service availability and stability.
By determining performance weight values based on the performance metrics data of candidate clusters, query traffic is dynamically allocated to the target cluster. The performance weight values are directly proportional to the availability of the cluster, and query response is optimized by combining geographical location and load balancing.
It improved service availability and stability, reduced the probability of traffic distribution to abnormal clusters, and optimized resource utilization and query response speed.
Smart Images

Figure CN121585668A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a traffic scheduling method and device, equipment, a storage medium and a program product. BACKGROUND
[0002] In a high-concurrency and low-latency query analysis scenario, it is usually necessary to utilize multiple clusters to cooperatively process query traffic corresponding to a query request, so as to improve the stability and throughput of a service.
[0003] At present, when processing query traffic among multiple clusters, traffic distribution is usually performed according to a priority order among the multiple clusters. However, this traffic distribution manner does not take into account the current status of the clusters. Even if a cluster with a higher priority is in an abnormal situation, the query traffic will still be forwarded to the abnormal cluster, and the abnormal cluster is unable to normally process the query traffic, thereby affecting the availability and stability of the service. SUMMARY
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a traffic scheduling method, device, equipment, storage medium and program product.
[0005] The present disclosure provides a traffic scheduling method, which comprises: In response to a user query request, determining a performance weight value corresponding to each candidate cluster in a candidate cluster list; wherein the performance weight value is determined according to performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current running state of the candidate cluster, and the performance weight value is in a positive proportional relationship with the availability of the candidate cluster; Determining a target cluster corresponding to the user query request from the candidate cluster list according to the performance weight value corresponding to the candidate cluster; Forwarding query traffic corresponding to the user query request to the target cluster, so as to process the query traffic by the target cluster.
[0006] The present disclosure also provides a traffic scheduling device, which comprises: A first determining module is configured to determine a performance weight value corresponding to each candidate cluster in a candidate cluster list in response to a user query request; wherein the performance weight value is determined according to performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current running state of the candidate cluster, and the performance weight value is in a positive proportional relationship with the availability of the candidate cluster; A second determining module is configured to determine a target cluster corresponding to the user query request from the candidate cluster list according to the performance weight value corresponding to the candidate cluster. a forwarding model, configured to forward query traffic corresponding to the user query request to the target cluster to process the query traffic by the target cluster.
[0007] The electronic device provided by the embodiment of the present disclosure includes: a processor and a memory; The processor is configured to execute the method according to any of the embodiments of the present disclosure by invoking programs or instructions stored in the memory.
[0008] The present disclosure also provides a computer readable storage medium storing programs or instructions, which cause a computer to execute the method according to any of the embodiments of the present disclosure.
[0009] The traffic scheduling scheme provided by the embodiment of the present disclosure can determine the dynamic weight value corresponding to each candidate cluster according to the performance index data when receiving a user query request. Since the performance index data can be used to reflect the current running state of the candidate cluster, the dynamic weight value determined based on the performance index data can realize intelligent allocation of traffic. Compared with the method of determining the target cluster based on priority, the embodiment of the present disclosure can reduce the probability of forwarding traffic to an abnormal cluster, thereby improving the availability and stability of the service. BRIEF DESCRIPTION OF DRAWINGS
[0010] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0012] Figure 1 A flowchart of a traffic scheduling method provided by the embodiment of the present disclosure; Figure 2 A flowchart of another traffic scheduling method provided by the embodiment of the present disclosure; Figure 3 A flowchart of a traffic scheduling method provided by the embodiment of the present disclosure; Figure 4 A structural diagram of a traffic scheduling device provided by the embodiment of the present disclosure; Figure 5 A structural diagram of an electronic device provided by the embodiment of the present disclosure. DETAILED DESCRIPTION
[0013] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described in detail below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0014] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other different manners from those described herein; obviously, the embodiments described in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.
[0015] At present, when processing query traffic between multiple clusters, the traffic is usually distributed according to the priority order between multiple clusters, however, this traffic distribution method does not take into account the current situation of the cluster, even if the cluster with higher priority appears abnormal situation or load imbalance, the query traffic will still be forwarded to the cluster with higher priority, thereby affecting the availability and stability of the service.
[0016] Based on this, the embodiments of the present disclosure provide a traffic scheduling method, which can determine the dynamic weight value corresponding to each candidate cluster according to the performance index data when receiving a user query request. Since the performance index data can be used to reflect the current running state of the candidate cluster, the dynamic weight value determined based on the performance index data can realize intelligent allocation of traffic. Compared with the method of determining the target cluster based on priority, the embodiments of the present disclosure can reduce the probability of forwarding traffic to an abnormal cluster, thereby improving the availability and stability of the service.
[0017] The traffic scheduling method provided by the embodiments of the present disclosure is mainly applicable to the traffic distribution scene between multiple clusters. The traffic scheduling method can be executed by a traffic scheduling device, which can be realized by software and / or hardware. The device can be integrated in an electronic device with inter-cluster traffic scheduling function, such as mobile phone, palm computer, tablet computer, notebook computer or desktop computer, etc.
[0018] Figure 1 is a flow chart of a traffic scheduling method provided by the embodiments of the present disclosure. Referring to Figure 1 , the traffic scheduling method specifically includes: S110, in response to a user query request, determining a performance weight value corresponding to each candidate cluster in a candidate cluster list.
[0019] Among them, the performance weight value is determined according to the performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current running state of the candidate cluster, and the performance weight value is in a positive proportional relationship with the available degree of the candidate cluster.
[0020] The traffic scheduling method provided by the embodiments of the present disclosure can be applied to a load balancer, a load balancing service and the like. The load balancer is located between a client and a service, and is responsible for distributing user query requests sent by the client to a corresponding cluster. The load balancing service is a built-in service provided by a cloud platform, and is responsible for traffic scheduling between clusters.
[0021] The cluster is a system composed of a group of interconnected computers or servers. Each computer in the cluster can be regarded as a node, which provides computing, storage and network resources for the cluster. The service can use these resources to run. In a distributed system or a cloud computing environment, multiple clusters can be used to support different types of services or to achieve high availability and scalability of services.
[0022] The user query request refers to a request unit triggered by a single user and needs to be routed to a cluster for processing. The candidate cluster list refers to a set of all clusters that can currently receive and process user query requests. The candidate cluster list includes multiple candidate clusters.
[0023] The performance indicator data of the candidate cluster refers to dynamic data pulled from a monitoring system, which can reflect the current running state of the candidate cluster. The performance indicator data can include at least one of query time consumption, query failure rate and load pressure of the candidate cluster. The query time consumption is used to represent the query response speed of the candidate cluster in a first historical time period, for example, the 90th percentile value, the average value or the median of the query response time of the candidate cluster in the past 5 minutes, etc. The 90th percentile value refers to the query response time of the candidate cluster in the past 5 minutes, which is sorted in ascending order, and the query response time at the 90th percentile is determined as the query time consumption of the candidate cluster.
[0024] The query failure rate is used to represent the query failure of the candidate cluster in a second historical time period. The second historical time period and the first historical time period can be the same time period or different time periods. For example, the ratio of the number of failed user queries to the total number of user queries of the candidate cluster in the past 5 minutes. The query time consumption and the query failure rate can reflect the real-time running state of the candidate cluster from the user dimension. The load pressure is used to represent the current resource usage of the candidate cluster, for example, the ratio of the sum of the number of currently running tasks and the number of queued tasks to the total number of tasks.
[0025] Since performance metrics reflect the current operating status of each candidate cluster, and performance weights are determined based on the corresponding candidate cluster's performance metrics, these weights constantly change in response to the cluster's current operating status. When a candidate cluster experiences performance fluctuations or anomalies, its corresponding performance weight will also change. A higher performance weight indicates a higher availability of the candidate cluster, while a lower performance weight indicates a lower availability. In other words, there is a direct proportional relationship between performance weights and the availability of a candidate cluster.
[0026] As can be seen, when receiving a user query request, this embodiment of the present disclosure determines the performance weight value corresponding to each candidate cluster in the candidate cluster list, so that intelligent traffic allocation can be achieved based on the performance weight value. Since performance index data is used to reflect the current operating status of each candidate cluster, the performance weight value determined based on the performance index data in this embodiment of the present disclosure can quickly reduce the probability of distribution to abnormal clusters in abnormal scenarios, thereby improving the availability and stability of the service.
[0027] S120. Based on the performance weight values corresponding to the candidate clusters, determine the target cluster corresponding to the user's query request from the candidate cluster list.
[0028] In this embodiment of the disclosure, after determining the performance weight value corresponding to each candidate cluster in the candidate cluster list, the target cluster corresponding to the user query request can be determined from the candidate cluster list based on the performance weight value corresponding to each candidate cluster, so as to use the target cluster to process the user query request.
[0029] In some embodiments, after determining the performance weight value corresponding to each candidate cluster in the candidate cluster list, the candidate cluster with the highest performance weight value can be determined as the target cluster. Since the candidate cluster with the highest performance weight value corresponds to the highest availability, the target cluster determined in the above manner can also improve the availability of the service.
[0030] S130. Forward the query traffic corresponding to the user query request to the target cluster so that the target cluster can handle the query traffic.
[0031] In this embodiment of the disclosure, after determining the target cluster corresponding to the user query request based on the performance weight values corresponding to each candidate cluster, the query traffic corresponding to the user query request is forwarded to the target cluster so that the target cluster can process the query traffic corresponding to the user query request.
[0032] Since the target cluster in the embodiments of the present disclosure is determined based on the performance weight value between the candidate clusters, and the performance weight value can be used to represent the availability or health degree of the target cluster, that is, the target cluster determined by the performance weight value is the cluster with relatively high availability in the candidate cluster list, therefore, by forwarding the query traffic to the target cluster with high availability, the probability of traffic distribution to the abnormal cluster can be reduced, and the availability of the service can be improved.
[0033] The traffic scheduling method provided by the embodiments of the present disclosure can determine the dynamic weight value corresponding to each candidate cluster according to the performance index data when receiving a user query request. Since the performance index data can be used to reflect the current running state of the candidate cluster, the dynamic weight value determined based on the performance index data can realize intelligent allocation of traffic. Compared with the method of determining the target cluster based on priority, the embodiments of the present disclosure can reduce the probability of forwarding traffic to the abnormal cluster, thereby improving the availability and stability of the service.
[0034] In some embodiments, in order to more comprehensively reflect the current running state of each candidate cluster, the performance index data of multiple dimensions such as query time consumption, query failure rate and load pressure of the candidate cluster can also be integrated to provide more accurate data support for traffic scheduling.
[0035] Specifically, when receiving a user query request, the query time consumption of a first candidate cluster in the candidate cluster list is obtained, and a time consumption weight value corresponding to the first candidate cluster is determined based on the query time consumption; the load pressure of the first candidate cluster is obtained, and a load pressure weight value corresponding to the first candidate cluster is determined based on the load pressure; and the query failure rate of the first candidate cluster is obtained, and a query failure rate weight value corresponding to the first candidate cluster is determined based on the query failure rate; then, a performance weight value corresponding to the first candidate cluster is determined based on the time consumption weight value, the query failure rate weight value and the load pressure weight value.
[0036] The first candidate cluster can be any one of the candidate clusters in the candidate cluster list.
[0037] In practical applications, the query failure rate weight value corresponding to the first candidate cluster can be calculated by the following formula: (1); Wherein, represents the query failure rate weight value corresponding to the first candidate cluster, represents the query failure rate of the first candidate cluster. After the failure rate increases, the distribution probability of the abnormal cluster can be quickly reduced, and the effect of smooth weight reduction can be realized.
[0038] The calculation formula of the load pressure weight value corresponding to the first candidate cluster is as follows: (2); wherein, represents a load pressure weight value corresponding to the first candidate cluster, represents a load pressure of the first candidate cluster. The load pressure is high, and the effect of smooth weight reduction can be achieved.
[0039] The calculation formula of the time consumption weight value corresponding to the first candidate cluster is as follows: (3); wherein, represents a time consumption weight value corresponding to the first candidate cluster, represents a query time consumption of the first candidate cluster.
[0040] By mapping the performance indicator data of each dimension to a unified interval through the above formula, the performance indicator data with high priority (for example, query failure rate) can have a greater impact on the comprehensive performance weight value, thereby achieving rapid response and smooth migration in an abnormal scenario.
[0041] After determining the time consumption weight value, the query failure rate weight value and the load pressure weight value of the first candidate cluster, the time consumption weight value, the query failure rate weight value and the load pressure weight value are multiplied by the corresponding weight coefficients respectively, and then added to obtain the performance weight value corresponding to the first candidate cluster.
[0042] It can be seen that, by dynamically evaluating the performance indicator data of multiple dimensions such as load pressure, query time consumption and query failure rate of the candidate cluster, the embodiments of the present disclosure realize intelligent allocation of traffic, and can guarantee the overall high availability and performance stability of the service in an abnormal situation.
[0043] In some embodiments, in the process of determining the performance weight value corresponding to each candidate cluster based on the load pressure weight value, the query time consumption weight value and the query failure rate weight value, the geographical location relationship between the sending device of the user query request and each candidate cluster can also be combined, and the user query request is preferentially routed to the candidate cluster in the same region as the sending device, so as to reduce network delay and optimize query response speed.
[0044] In actual application, the cloud platform usually provides cloud services to users in units of regions, and the regions are divided according to geographical location and network delay dimensions, for example, Beijing region, Shanghai region, etc. A region usually includes multiple availability zones (AZ), and each availability zone has independent power and network facilities. Since the availability zones need to have disaster isolation capability, the availability zones are usually located far apart (about 100 kilometers), and the time delay between the availability zones is between 2 milliseconds and 3 milliseconds.
[0045] Obviously, if the distance between the availability zone to which the cluster processing the user query request belongs and the availability zone to which the sending device (i.e., the client) belongs is far, the network delay problem will occur.
[0046] Therefore, in the embodiments of the present disclosure, when receiving a user query request, the identity of the availability zone to which the sending device of the user query request belongs is first determined; then, by comparing the identity of the availability zone to which the sending device belongs with the identity of the availability zone to which the first candidate cluster belongs, the affinity weight value corresponding to the first candidate cluster is determined; and then, based on the time-consuming weight value, the load pressure weight value, the query failure rate weight value and the affinity weight value, the performance weight value corresponding to the first candidate cluster is determined.
[0047] Specifically, if it is determined that the identity of the availability zone to which the sending device belongs is the same as the identity of the availability zone to which the first candidate cluster belongs, the affinity weight value corresponding to the first candidate cluster is set to a first value, and if not, the affinity weight value corresponding to the first candidate cluster is set to a second value. The first value may be, for example, 1.4, and the second value may be, for example, 0.
[0048] In this way, the user query request can be preferentially routed to the cluster belonging to the same availability zone as the sending device, so as to reduce the network delay and optimize the query response speed.
[0049] In actual application, when dealing with the high-concurrency and low-delay query analysis scene of an enterprise, if all query traffics are forwarded to the cluster with higher priority, the overall load of the service will be unbalanced, thereby affecting the availability and stability of the service.
[0050] Therefore, after determining the performance weight values corresponding to the candidate clusters in the candidate cluster list respectively, the embodiments of the present disclosure can further determine the probability distribution between the candidate clusters according to the performance weight values corresponding to the candidate clusters respectively, so as to determine the target cluster corresponding to the user query request from the candidate cluster list by using the probability distribution.
[0051] The probability distribution of the candidate cluster is used to represent the possibility of the query traffic corresponding to the user query request being allocated to the candidate cluster. The higher the performance weight value of the candidate cluster is, the larger the probability distribution interval corresponding to the candidate cluster is, and the greater the possibility of the query traffic being allocated to the candidate cluster is.
[0052] Specifically, the total cluster performance value is first determined according to the performance values corresponding to the candidate clusters respectively, and then the probability values corresponding to the candidate clusters respectively are determined according to the performance values corresponding to the candidate clusters and the total cluster performance value, and then the probability values corresponding to the candidate clusters respectively are converted into the corresponding probability distributions.
[0053] When receiving a user query request, a target cluster corresponding to the user query request is determined from a plurality of candidate clusters according to a probability distribution by means of random sampling, and query traffic corresponding to the user query request is forwarded to the target cluster, so as to process the query traffic by the target cluster.
[0054] Exemplarily, assuming that the performance weight value of cluster A in the candidate cluster list is 6, the performance weight value of cluster B is 4, and the performance weight value of cluster C is 10, after the above normalization processing, the probability value corresponding to cluster A is 0.3, the probability value corresponding to cluster B is 0.2, and the probability value corresponding to cluster C is 0.5. Correspondingly, the probability distribution corresponding to cluster A is [0, 0.3], the probability distribution corresponding to cluster B is [0.3, 0.5], and the probability distribution corresponding to cluster C is [0.5, 1]. For a user query request, a uniform distribution random number generator is called to output a random number in the range of [0, 1]. Since the larger the probability distribution interval is, the greater the possibility of the random number falling into the interval is, and the greater the possibility of the traffic being routed to the corresponding candidate cluster is. Assuming that 1000 user query requests are sent to the load balancing service at the same time, based on the above method, about 300 query traffics can be forwarded to cluster A, about 200 traffics can be forwarded to cluster B, and about 500 traffics can be forwarded to cluster C, avoiding the concentration of all traffics to a certain cluster, thereby improving the resource utilization rate of the cluster.
[0055] In this way, in the high-concurrency and low-latency query analysis scenario, the performance weight values of the candidate clusters are converted into probability distributions, and the fine-grained proportional distribution of the traffic is realized based on the random sampling method, avoiding the concentration of multiple query traffics to the same candidate cluster, thereby improving the resource utilization rate of the cluster.
[0056] Figure 2 is a flowchart of another traffic scheduling method provided by the embodiments of the present disclosure. It further optimizes the determination of the performance weight value corresponding to each candidate cluster in the candidate cluster list. The explanations of the same or corresponding terms as those in the above embodiments are not repeated here. Referring to Figure 2 The traffic scheduling method comprises the following steps. S210, in response to a user query request, obtaining a candidate cluster list and obtaining performance index data corresponding to each candidate cluster in the candidate cluster list.
[0057] The candidate cluster list includes a plurality of candidate clusters, and each candidate cluster can be a pre-pulled registered cluster. The registered cluster refers to a cluster that has been registered to the configuration center and can be used for traffic processing.
[0058] In some embodiments, in the process of reading the registered clusters from the configuration center, the cluster metadata corresponding to each registered cluster can also be read and stored into the candidate cluster list. That is, the cluster metadata corresponding to each candidate cluster can also be stored in the candidate cluster list.
[0059] The cluster metadata can include a cluster name, a cluster connection address, and an identifier of an availability zone to which the cluster belongs. The cluster name is used to uniquely identify the candidate cluster, the cluster connection address refers to an access address of the candidate cluster for providing services, and the identifier of the availability zone to which the cluster belongs is used to uniquely identify the availability zone where the candidate cluster is located, and the availability zone to which the cluster belongs is used to implement a traffic scheduling strategy such as nearby access.
[0060] Specifically, when determining the affinity weight value corresponding to any candidate cluster, the identifier of the availability zone to which the candidate cluster belongs can be obtained from the cluster metadata corresponding to each candidate cluster stored in the candidate cluster list, and the affinity weight value corresponding to the candidate cluster can be determined by comparing the identifier of the availability zone to which the sending device belongs with the identifier of the availability zone to which the candidate cluster belongs.
[0061] In other embodiments, the performance indicator data corresponding to each candidate cluster can also be periodically or regularly pulled from the monitoring system, and the latest performance indicator data pulled can be cached in the memory, so that the performance indicator data corresponding to each candidate cluster in the candidate cluster list can be directly obtained from the memory when a user query request is subsequently received.
[0062] S220, determining the performance weight value corresponding to each cluster according to the performance indicator data corresponding to each candidate cluster.
[0063] In the embodiments of the present disclosure, after obtaining the candidate cluster list and the performance indicator data corresponding to each candidate cluster in the candidate cluster list, the performance weight value corresponding to each cluster can be determined in real time according to the performance indicator data corresponding to each candidate cluster.
[0064] In some embodiments, after periodically or regularly pulling the performance indicator data corresponding to each candidate cluster and caching the latest performance indicator data pulled in the memory, the performance weight value corresponding to each candidate cluster can also be determined in advance according to the performance indicator data in the memory, and the performance weight value and the performance indicator data can be cached in the memory together, so that the performance weight value corresponding to each candidate cluster can be directly obtained from the memory when a user query request is subsequently received.
[0065] S230, determining the target cluster corresponding to the user query request from the candidate cluster list according to the performance weight value corresponding to the candidate cluster.
[0066] In the embodiments of the present disclosure, after determining the performance weight values corresponding to each candidate cluster in the candidate cluster list respectively, the target cluster corresponding to the user query request can be determined from the candidate cluster list according to the performance weight values corresponding to each candidate cluster respectively, so as to process the user query request by using the target cluster.
[0067] In the embodiments of the present disclosure, after determining the performance weight values corresponding to each candidate cluster in the candidate cluster list respectively, the target cluster corresponding to the user query request can be determined from the candidate cluster list according to the performance weight values corresponding to each candidate cluster respectively, so as to process the user query request by using the target cluster.
[0068] The above technical solutions of the embodiments of the present disclosure can dynamically determine the performance weight values corresponding to each candidate cluster by using multi-dimensional performance index data when receiving a user query request, so as to realize intelligent allocation of traffic by using dynamic weight values, thereby reducing the probability of forwarding traffic to an abnormal cluster and improving the availability and stability of services.
[0069] As shown in FIG. 1, a schematic diagram of a traffic scheduling process is provided in the embodiments of the present disclosure. Figure 3
[0070] When receiving a user query request, first, a candidate cluster list is obtained.
[0071] Each candidate cluster in the candidate cluster list is traversed, and performance index data corresponding to each candidate cluster is obtained.
[0072] The health degree corresponding to each candidate cluster is obtained, and the candidate cluster whose health degree does not satisfy a preset condition is filtered out from the candidate cluster list.
[0073] For each candidate cluster in the candidate cluster list whose health degree satisfies the preset condition, the performance weight value corresponding to each candidate cluster is determined based on the time-consuming weight value, the load pressure weight value, the query failure rate weight value and the affinity weight value of each candidate cluster.
[0074] The performance weight value corresponding to each candidate cluster is converted into a probability distribution, and the target cluster corresponding to the user query request is determined by using the probability distribution between each candidate cluster.
[0075] In this way, when receiving a user query request, the current running state of each candidate cluster can be dynamically evaluated by using multi-dimensional performance index data (i.e., health degree, query failure rate, query time-consuming, load pressure), and the query traffic can be proportionally allocated by using performance weight values. In an abnormal scenario, the distribution probability of an abnormal cluster can be effectively reduced, the traffic can be smoothly migrated to a cluster with higher availability, and network delay can be reduced by combining deployment affinity, thereby realizing high availability, resource balance and performance optimization of services.
[0076] Figure 4 A structural schematic diagram of a traffic scheduling device is provided in the embodiments of the present disclosure. As shown in FIG. 2, the traffic scheduling device comprises a candidate cluster list obtaining unit 21, a performance index data obtaining unit 22, a health degree filtering unit 23, a performance weight value determining unit 24, a target cluster determining unit 25 and a traffic forwarding unit 26.Figure 4 The flow scheduling apparatus includes: The first determining module 401 is configured to determine a performance weight value corresponding to each candidate cluster in the candidate cluster list in response to a user query request, wherein the performance weight value is determined according to performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current running state of the candidate cluster, and the performance weight value is in a positive proportional relationship with the availability of the candidate cluster. The second determining module 402 is configured to determine a target cluster corresponding to the user query request from the candidate cluster list according to the performance weight value corresponding to the candidate cluster. The forwarding module 403 is configured to forward query flow corresponding to the user query request to the target cluster, so that the target cluster processes the query flow.
[0077] The flow scheduling apparatus provided by the embodiment of the present disclosure can determine a dynamic weight value corresponding to each candidate cluster according to performance index data when receiving a user query request. Since the performance index data can be used to reflect the current running state of the candidate cluster, the dynamic weight value determined based on the performance index data can realize intelligent allocation of flow. Compared with the method of determining a target cluster based on priority, the embodiment of the present disclosure can reduce the probability of forwarding flow to an abnormal cluster, thereby improving the availability and stability of the service.
[0078] In some embodiments, the performance index data of the candidate cluster includes query time consumption, query failure rate and / or load pressure of the candidate cluster, the query time consumption is used to represent the query response speed of the candidate cluster in a first historical time period, the query failure rate is used to represent the query failure condition of the candidate cluster in a second historical time period, and the load pressure is used to represent the current resource usage of the candidate cluster.
[0079] In some embodiments, the first determining module includes: The first obtaining sub-module is configured to obtain the query time consumption of the first candidate cluster in the candidate cluster list, and determine a time consumption weight value corresponding to the first candidate cluster based on the query time consumption. The second obtaining sub-module is configured to obtain the load pressure of the first candidate cluster, and determine a load pressure weight value corresponding to the first candidate cluster based on the load pressure. The third obtaining sub-module is configured to obtain the query failure rate of the first candidate cluster, and determine a query failure rate weight value corresponding to the first candidate cluster based on the query failure rate. The first determining sub-module is configured to determine a performance weight value corresponding to the first candidate cluster based on the time consumption weight value, the load pressure weight value and the query failure rate weight value.
[0080] In some embodiments, the first determining module further includes: The second determining sub-module is configured to determine an identifier of an availability zone to which a sending device of the user query request belongs. The third determining sub-module is configured to determine an affinity weight value corresponding to the first candidate cluster by comparing the identifier of the availability zone to which the sending device belongs with an identifier of an availability zone to which the first candidate cluster belongs, wherein the affinity weight value is used to represent a geographical position relationship between the availability zone to which the sending device belongs and the availability zone to which the first candidate cluster belongs. Correspondingly, the first determining module is specifically configured to: determine a performance weight value corresponding to the first candidate cluster based on the time consumption weight value, the load pressure weight value, the query failure rate weight value and the affinity weight value.
[0081] In some embodiments, the first determining module includes: The fourth obtaining sub-module is configured to obtain a candidate cluster list and obtain performance index data corresponding to each candidate cluster in the candidate cluster list in response to a user query request. The fourth determining sub-module is configured to determine a performance weight value corresponding to each cluster based on the performance index data corresponding to each candidate cluster.
[0082] In some embodiments, the second determining module includes: The fifth determining sub-module is configured to determine a probability distribution corresponding to each candidate cluster based on the performance weight value corresponding to each candidate cluster. The sixth determining sub-module is configured to determine a target cluster corresponding to the user query request from the candidate cluster list by using the probability distribution between each candidate cluster.
[0083] In some embodiments, each candidate cluster in the candidate cluster list is a pre-pulled registered cluster, and the candidate cluster list further stores cluster metadata corresponding to each candidate cluster, wherein the cluster metadata includes a cluster name, a cluster connection address and an identifier of an availability zone to which the cluster belongs.
[0084] The traffic scheduling apparatus provided by the embodiments of the present disclosure can perform the traffic scheduling method provided by any of the embodiments of the present disclosure, and has the corresponding function modules and beneficial effects of performing the method.
[0085] It is worth noting that in the above embodiment of the flow scheduling device, each sub-module included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific name of each functional sub-module is only for easy mutual differentiation, and does not serve to limit the protection scope of the present disclosure.
[0086] Figure 5 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure. As shown in Figure 5 The electronic device 500 includes one or more processors 501 and a memory 502.
[0087] The processor 501 can be a central processing unit (CPU) or other forms of processing units with flow scheduling capability and / or instruction execution capability, and can control other components in the electronic device 500 to perform desired functions.
[0088] The memory 502 can include one or more computer program products, which can include various forms of computer readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory, etc. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions can be stored on the computer readable storage medium, and the processor 501 can run the program instructions to implement the flow scheduling method of the embodiments of the present disclosure described above and / or other desired functions. Various contents such as candidate cluster list, performance indicator data of candidate cluster, etc. can also be stored in the computer readable storage medium.
[0089] In one example, the electronic device 500 can further include an input device 503 and an output device 504, which are interconnected through a bus system and / or other forms of connection mechanism (not shown). The input device 503 can include, for example, a keyboard, a mouse, etc. The output device 504 can output various information to the outside, including the determined performance weight value of the candidate cluster, etc. The output device 504 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0090] Of course, in order to simplify, Figure 5 Only some of the components in the electronic device 500 related to the present disclosure are shown in the above description, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application circumstances, the electronic device 500 can also include any other appropriate components.
[0091] In addition to the method and device described above, the embodiments of the present disclosure can also be a computer program product, which includes computer program instructions, and the computer program instructions cause the processor to perform the flow scheduling method provided by the embodiments of the present disclosure when the processor runs.
[0092] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present disclosure, including an object-oriented programming language, such as Java, C++, and the like, and a conventional procedural programming language, such as "C" programming language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0093] In addition, the embodiments of the present disclosure can also be a computer readable storage medium, which stores computer program instructions, and the computer program instructions cause the processor to perform the flow scheduling method provided by the embodiments of the present disclosure when the processor runs.
[0094] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0095] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the description of the embodiments and the claims that follow, the following terminology will be understood to have the following meanings. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the description of the embodiments and the claims that follow, the following terminology will be understood to have the following meanings, unless otherwise indicated. The use of “including,” “containing,” or “comprising” and variations thereof herein is meant to encompass the items listed thereafter, and any subsequent items or additional items. Unless otherwise indicated, the use of “or” is meant to encompass both “and” and “or,” but not the exclusion of the other. Unless otherwise indicated, the use of “one or more of’ a list of items is meant to encompass the items one at a time and also in any combination of one or more of the items. Unless otherwise indicated, the use of “a” or “an” is meant to encompass both “a” and “an” as well as “one or more” unless otherwise indicated. The use of “first” and “second” and “third” and the like is meant to indicate different instances of an item, and is not meant to indicate any type of ordering or ranking. The use of “at least one of’ followed by a list of items is meant to encompass the items one at a time as well as in any combination of one or more of the items. The use of “and / or,” when used between items in a list is meant to include one and only one of the listed items as well as any combination of one or more of the items. The use of “and / or” when used between lists of items is meant to include one and only one of the items in each list as well as any combination of one or more of the items in each list.
[0096] The preceding merely illustrates the principles of the disclosure. Various modifications and alterations to the methods and devices described herein will become apparent to those skilled in the art from the preceding description. The particular embodiments disclosed above are illustrative only, as the present disclosure is to be limited only by the claims and equivalents thereof.
Claims
1. A traffic scheduling method, characterized in that, include: In response to a user query request, the performance weight value corresponding to each candidate cluster in the candidate cluster list is determined; wherein, the performance weight value is determined based on the performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current operating status of the candidate cluster, and the performance weight value is directly proportional to the availability of the candidate cluster. Based on the performance weight values corresponding to the candidate clusters, the target cluster corresponding to the user query request is determined from the candidate cluster list; The query traffic corresponding to the user query request is forwarded to the target cluster so that the target cluster can process the query traffic.
2. The method according to claim 1, characterized in that, The performance metrics data of the candidate cluster include the query time, query failure rate and / or load pressure of the candidate cluster. The query time is used to characterize the query response speed of the candidate cluster in a first historical time period. The query failure rate is used to characterize the query failure situation of the candidate cluster in a second historical time period. The load pressure is used to characterize the current resource usage of the candidate cluster.
3. The method according to claim 2, characterized in that, The step of obtaining the performance weight value corresponding to each candidate cluster in the candidate cluster list includes: Obtain the query time of the first candidate cluster in the candidate cluster list, and determine the time weight value corresponding to the first candidate cluster based on the query time; Obtain the load pressure of the first candidate cluster, and determine the load pressure weight value corresponding to the first candidate cluster based on the load pressure; Obtain the query failure rate of the first candidate cluster, and determine the query failure rate weight value corresponding to the first candidate cluster based on the query failure rate; The performance weight value corresponding to the first candidate cluster is determined based on the time consumption weight value, the load pressure weight value, and the query failure rate weight value.
4. The method according to claim 3, characterized in that, Before determining the performance weight value corresponding to the first candidate cluster based on the time consumption weight value, the load pressure weight value, and the query failure rate weight value, the method further includes: Determine the identifier of the availability zone to which the device sending the user query request belongs; By comparing the identifier of the availability zone to which the transmitting device belongs with the identifier of the availability zone to which the first candidate cluster belongs, the affinity weight value corresponding to the first candidate cluster is determined; the affinity weight value is used to characterize the geographical location relationship between the availability zone to which the transmitting device belongs and the availability zone to which the first candidate cluster belongs. Accordingly, determining the performance weight value corresponding to the first candidate cluster based on the time consumption weight value, the load pressure weight value, and the query failure rate weight value includes: Based on the time consumption weight value, the load pressure weight value, the query failure rate weight value, and the affinity weight value, the performance weight value corresponding to the first candidate cluster is determined.
5. The method according to claim 1, characterized in that, The step of responding to a user query request and determining the performance weight value corresponding to each candidate cluster in the candidate cluster list includes: In response to a user query request, a candidate cluster list is obtained, and performance metric data corresponding to each candidate cluster in the candidate cluster list is obtained. Based on the performance index data corresponding to each candidate cluster, the performance weight value corresponding to each cluster is determined.
6. The method according to claim 1, characterized in that, The step of determining the target cluster corresponding to the user query request from the candidate cluster list based on the performance weight value corresponding to the candidate cluster includes: Based on the performance weight values corresponding to each candidate cluster, determine the probability distribution corresponding to each candidate cluster. By utilizing the probability distribution among the candidate clusters, the target cluster corresponding to the user query request is determined from the list of candidate clusters.
7. The method according to claim 1, characterized in that, Each candidate cluster in the candidate cluster list is a pre-pulled registered cluster. The candidate cluster list also stores cluster metadata corresponding to each candidate cluster, including cluster name, cluster connection address, and identifier of the availability zone to which the cluster belongs.
8. A traffic flow scheduling device, characterized in that, include: The first determining module is used to respond to a user query request and determine the performance weight value corresponding to each candidate cluster in the candidate cluster list; wherein the performance weight value is determined based on the performance index data of the corresponding candidate cluster, the performance index data is used to reflect the current operating status of the candidate cluster, and the performance weight value is directly proportional to the availability of the candidate cluster. The second determining module is used to determine the target cluster corresponding to the user query request from the candidate cluster list based on the performance weight value corresponding to the candidate cluster; A forwarding model is used to forward the query traffic corresponding to the user query request to the target cluster so that the target cluster can process the query traffic.
9. An electronic device, characterized in that, The electronic device includes: Processor and memory; The processor executes the traffic scheduling method as described in any one of claims 1 to 7 by calling the program or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that cause a computer to perform the traffic scheduling method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product is used to implement the traffic scheduling method according to any one of claims 1-7.