Service request processing method and apparatus, storage medium, and electronic device
By acquiring performance metrics data from service nodes and performing weighted calculations, access request traffic is dynamically allocated, solving the problem of insufficient service node performance caused by uneven request distribution in existing technologies and improving the reliability of business systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2026-03-17
AI Technical Summary
Existing load balancing strategies cannot be dynamically adjusted according to the actual operating conditions of the server, resulting in uneven request distribution and affecting the reliability of the business system.
By acquiring performance metrics data from service nodes, weighted calculations are performed to obtain evaluation data. Based on the evaluation data, access request traffic is dynamically allocated, and target service nodes are selected.
This system enables dynamic allocation of service requests based on the actual operating status of service nodes, avoiding insufficient service node performance caused by uneven request allocation, and improving the success rate of service requests and the reliability of business systems.
Smart Images

Figure CN116546028B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and more specifically, to a method, apparatus, storage medium, and electronic device for processing service requests. Background Technology
[0002] With the rapid development of the internet and increasingly complex business scenarios, business system architectures are constantly iterating and improving to meet these demands. Distributed microservice architectures, due to their strong high availability capabilities, are becoming increasingly widely used in practical business systems. Simultaneously, the continuous growth of internet users has led to an explosive increase in server access requests, posing a significant challenge to server performance. Load balancing technology, as a core capability for addressing request traffic distribution, is a crucial function of microservice frameworks.
[0003] Currently, load balancing strategies in existing technologies are mainly divided into static load balancing strategies and dynamic load balancing strategies. Static load balancing strategies use pre-defined algorithms (such as random, round-robin, and consistent hashing algorithms) to distribute requests to appropriate servers. They can only allocate traffic based on preset metrics and cannot dynamically adjust according to the actual operating conditions of the servers. This leads to uneven request distribution, resulting in insufficient service node performance and affecting the reliability of the business system. Dynamic load balancing strategies (such as least connections and shortest response times) mainly consider the server's load status (such as the current number of connections and response time) when distributing requests. They lack consideration for real-time server performance and cannot accurately reflect the server's operating status and actual request handling capacity. Therefore, uneven request distribution also leads to insufficient service node performance and affects the reliability of the business system.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a service request processing method, apparatus, storage medium, and electronic device to at least solve the technical problem in the prior art where insufficient service node performance and low reliability of business systems are caused by uneven request distribution.
[0006] According to one aspect of the present invention, a method for processing service requests is provided, comprising: acquiring access request traffic, wherein the access request traffic includes at least one access request, the at least one access request being used to request a target service; acquiring evaluation data of multiple service nodes, and determining a target service node from the multiple service nodes based on the evaluation data, wherein the evaluation data is obtained by weighted calculation of performance index data of the multiple service nodes; and allocating the access request traffic to the target service node, wherein the target service node is used to respond to at least one access request.
[0007] Furthermore, before acquiring access request traffic, the method also includes: collecting data from multiple service nodes using a data acquisition component based on a preset sampling frequency to obtain performance indicator data for multiple service nodes; generating a data collection message based on the performance indicator data of multiple service nodes and sending the data collection message to the data analysis component through a message queue between the data acquisition component and the data analysis component; performing weighted calculations on the performance indicator data of multiple service nodes using the data analysis component to obtain evaluation data and storing the evaluation data in a preset database.
[0008] Furthermore, the performance index data of multiple service nodes are weighted and calculated using a data analysis component to obtain evaluation data. This includes: determining the weight of each performance index data of each service node using the data analysis component; calculating the evaluation score of each performance index data based on the weight of each performance index data and the first calculation formula; and summing the evaluation scores of each performance index data to obtain the evaluation data of each service node.
[0009] Furthermore, based on the evaluation data, the target service node is determined from multiple service nodes, including: sorting the evaluation data of each service node to obtain a sorting result; and based on the sorting result, selecting the service node corresponding to the evaluation data with the highest score as the target service node.
[0010] Furthermore, after sorting the evaluation data of each service node to obtain the sorting result, the method further includes: if there are evaluation data with the same score in the sorting result, then obtain the evaluation status diagram of the service node corresponding to the evaluation data with the same score, and obtain at least two evaluation status diagrams, wherein the evaluation status diagram is used to characterize the changing trend of the evaluation data; based on the at least two evaluation status diagrams, the service node corresponding to the evaluation data that is in an upward trend is taken as the target service node.
[0011] Furthermore, after obtaining the evaluation data of multiple service nodes, the method further includes: determining whether there is any evaluation data in the evaluation data of multiple service nodes that is less than a first threshold; if there is any evaluation data in the evaluation data of multiple service nodes that is less than the first threshold, then determining the number of nodes of the first service node corresponding to the evaluation data less than the first threshold; and determining the target degradation measures for the service cluster associated with the multiple service nodes based on the number of nodes, wherein the target degradation measures are used to implement traffic restrictions on the access request traffic of the service cluster.
[0012] Furthermore, based on the number of nodes, the target degradation measures for the service cluster associated with multiple service nodes are determined, including: if the number of nodes is less than the second threshold, disabling the first service node is taken as the target degradation measure, and the first service node is reactivated if the evaluation data of the first service node is greater than or equal to the first threshold; if the number of nodes is greater than or equal to the second threshold, disabling the service cluster is taken as the target degradation measure, and the service cluster is reactivated if the number of nodes is less than the second threshold.
[0013] According to another aspect of the present invention, a service request processing apparatus is also provided, comprising: a first acquisition module, configured to acquire access request traffic, wherein the access request traffic includes at least one access request, the at least one access request being used to request a target service; a first determination module, configured to acquire evaluation data of multiple service nodes, and determine a target service node from the multiple service nodes based on the evaluation data, wherein the evaluation data is obtained by weighted calculation of performance index data of multiple service nodes; and a first allocation module, configured to allocate the access request traffic to the target service node, wherein the target service node is used to respond to at least one access request.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the above-described service request processing method when running.
[0015] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a method for running the programs, wherein the programs are configured to execute the above-described service request processing method during runtime.
[0016] In this embodiment of the invention, dynamic load balancing is achieved using evaluation data calculated based on the performance metrics of service nodes. First, access request traffic is acquired. Then, evaluation data from multiple service nodes is acquired. Based on the evaluation data, a target service node is determined from the multiple service nodes, and the access request traffic is then distributed to the target service node. The access request traffic includes at least one access request, which requests the target service. The evaluation data is obtained by weighted calculation of the performance metrics data of multiple service nodes, and the target service node is used to respond to at least one access request.
[0017] In the above process, by obtaining evaluation data from multiple service nodes, the target service node can be identified from among them, and access request traffic can be allocated to the target service node. This realizes the dynamic allocation of service requests based on performance indicators that reflect the current actual operating status of the service node, avoiding insufficient service node performance caused by uneven request allocation, reducing the situation of service request failure due to route unavailability, improving the success rate of service requests, ensuring the availability of the service cluster, and thus improving the reliability of the business system.
[0018] Therefore, the technical solution of the present invention achieves the goal of avoiding service timeouts and anomalies caused by insufficient service node performance, thereby improving the reliability of the business system and solving the technical problem of low reliability of the business system caused by insufficient service node performance due to uneven request distribution in the prior art. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0020] Figure 1 This is a flowchart of an optional service request processing method according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of an optional allocation service request structure according to an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the structure of optional analytical performance index data according to an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of an optional process for rate limiting of service nodes according to an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of an optional service request processing apparatus according to an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] It should be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this invention are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it needs to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.
[0029] Example 1
[0030] According to an embodiment of the present invention, an embodiment of a service request processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] Figure 1 This is a flowchart of an optional service request processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0032] Step S101: Obtain access request traffic, wherein the access request traffic includes at least one access request, and the at least one access request is used to request the target service.
[0033] In the above steps, access request traffic can be obtained through application systems, processors, electronic devices, etc. Optionally, access request traffic can be obtained through a service request processing system. The target service can be a service that implements a specific function in the business system. For example, a user sends an access request for service A to the service cluster associated with the business system. The access request traffic is obtained through the service request processing system, the request is allocated, and the server node (i.e., the service node) that can implement service A responds to the request.
[0034] Step S102: Obtain evaluation data from multiple service nodes, and determine the target service node from the multiple service nodes based on the evaluation data. The evaluation data is obtained by weighted calculation of the performance index data of multiple service nodes.
[0035] Optionally, the performance metrics data includes at least one of the following: CPU usage data, memory usage data, disk usage data, disk input / output data, and network throughput data. The evaluation data is obtained by weighting the performance metrics data of multiple service nodes, that is, the total score obtained by adding up the performance metrics after setting a certain weight for each performance metric is the evaluation data of the service node.
[0036] Optionally, the evaluation data of multiple service nodes of the service cluster associated with the business system can be obtained from a preset database. Based on the evaluation data, the target service node can be determined from the multiple service nodes. For example, both service node 1 and service node 2 can implement service A. If the evaluation data of service node 1 is 80 points and the evaluation data of service node 2 is 90 points, then service node 2 will be used as the target service node to respond to the access request for service A.
[0037] Step S103: Distribute the access request traffic to the target service node, wherein the target service node is used to respond to at least one access request.
[0038] Optionally, after the target service node is determined, the access request traffic is allocated to the target service node, and the target service node responds to at least one access request. This realizes the dynamic allocation of service requests based on performance indicators that reflect the current actual operation of the service node, avoiding insufficient service node performance caused by uneven request allocation.
[0039] Based on the scheme defined in steps S101 to S103 above, it can be understood that in this embodiment of the invention, dynamic load balancing is achieved using evaluation data calculated based on the performance indicators of service nodes. First, access request traffic is acquired; then, evaluation data of multiple service nodes is acquired; and based on the evaluation data, a target service node is determined from the multiple service nodes. Finally, the access request traffic is allocated to the target service node. The access request traffic includes at least one access request, which requests the target service. The evaluation data is obtained by weighted calculation of the performance indicator data of multiple service nodes, and the target service node is used to respond to at least one access request.
[0040] It is worth noting that in the above process, by obtaining evaluation data from multiple service nodes, the target service node can be identified from among them, thereby allocating access request traffic to the target service node. This achieves dynamic allocation of service requests based on performance indicators that reflect the current actual operating status of the service node, avoiding insufficient service node performance caused by uneven request allocation, reducing service request failures due to route unavailability, improving the success rate of service requests, ensuring the availability of the service cluster, and thus improving the reliability of the business system.
[0041] Therefore, the technical solution of the present invention achieves the goal of avoiding service timeouts and anomalies caused by insufficient service node performance, thereby improving the reliability of the business system and solving the technical problem of low reliability of the business system caused by insufficient service node performance due to uneven request distribution in the prior art.
[0042] In one optional embodiment, before acquiring access request traffic, a data acquisition component collects data from multiple service nodes based on a preset sampling frequency to obtain performance index data of multiple service nodes; a data collection message is generated based on the performance index data of multiple service nodes, and the data collection message is sent to the data analysis component through a message queue between the data acquisition component and the data analysis component; the data analysis component performs weighted calculation on the performance index data of multiple service nodes to obtain evaluation data, and stores the evaluation data in a preset database.
[0043] Optionally, the service request processing system includes at least a data acquisition component and a data analysis component. The data acquisition component may be a performance metric acquisition component, and the data analysis component may be a performance metric analysis component. Figure 2 This is a schematic diagram of an optional allocation service request structure according to an embodiment of the present invention. Optionally, as shown... Figure 2As shown, performance metrics collection components are deployed on each service node of the service cluster. The performance metrics collection components collect performance metrics data such as CPU utilization, memory utilization, disk I / O, and network throughput of each service node at a certain frequency (i.e., the preset sampling frequency) to obtain performance metrics data of multiple service nodes.
[0044] Optionally, data collection messages are generated based on performance metrics data from multiple service nodes and sent to the performance metrics analysis component via a message queue, such as... Figure 2 As shown, the performance index analysis component performs weight adjustment and summation calculation (i.e., weighted calculation) on the uploaded performance index data according to the preset calculation method (i.e., load balancing strategy) to obtain evaluation data, and stores the evaluation data in the preset database.
[0045] It should be noted that by collecting real-time performance metrics data, service requests can be dynamically allocated based on the current actual operating status of service nodes. This avoids insufficient service node performance caused by uneven request allocation, improves the success rate of service requests, and enhances the reliability of the business system.
[0046] In one optional embodiment, the performance index data of multiple service nodes are weighted and calculated using a data analysis component to obtain evaluation data. This includes: determining the weight of each performance index data of each service node using the data analysis component; calculating the evaluation score of each performance index data based on the weight of each performance index data and a first calculation formula; and summing the evaluation scores of each performance index data to obtain the evaluation data of each service node.
[0047] Optionally, a service performance evaluation model can be set up by the service cluster based on the characteristics of the current service (i.e., the performance consumption of the service), and the weight of each performance indicator can be determined. The parameters of the service performance evaluation model consist of server parameters such as CPU utilization, memory utilization, disk utilization, disk I / O, and network I / O, while also taking into account the trend of service performance evaluation scores, i.e., recording the trend of service performance evaluation scores.
[0048] Optionally, each service node can provide multiple services, each consuming different resources. Therefore, it is necessary to adjust the weights of the performance metrics that are being compared. The weight of each performance metric for each service node is determined using a data analysis component. Specifically, each performance metric on the server is assigned a weight K, with the sum of all weights equal to 1, and the performance metric value is V. If the business system deployed in the service cluster is CPU-intensive, the evaluation model can appropriately increase the weight of the CPU metric. Optionally, if the performance metric data is in the form of percentage data such as CPU utilization, memory utilization, or disk utilization, the performance metric calculation formula (i.e., the first calculation formula) is (1-V)*100*K. Based on the weight of each performance metric and the first calculation formula, the evaluation score for each performance metric can be calculated. Furthermore, by summing the evaluation scores of each performance metric, the evaluation data for each service node can be obtained.
[0049] Optionally, if the performance indicator data is of absolute value data type such as disk I / O or network I / O, a baseline value S can be set, and the corresponding indicator value can be calculated according to the indicator range. For example, if the baseline value is set to 50, the indicator calculation is divided into 6 ranges, namely (0, 10], (10, 20], (20, 30], (30, 40], (40, 50], and 50 and above. The performance indicator calculation is 100 points for 50 and above, and 80 points for (40, 50].
[0050] Figure 3 This is a schematic diagram of the structure of optional analytical performance index data according to an embodiment of the present invention, such as... Figure 3 As shown, the performance index analysis component collects data from the server, including performance index data such as CPU utilization, memory utilization, disk utilization, disk I / O, and network I / O. The data is then weighted and calculated according to the rules of the service performance evaluation model to obtain the service performance evaluation score for each service (i.e., business function) of the service node. The performance evaluation scores of each service are then added together to obtain the evaluation data of the service node. The trend of the service performance evaluation score of each service of the service node can also be recorded.
[0051] It should be noted that in the above process, the service cluster can flexibly set the performance indicator evaluation model according to the characteristics of the business system. Different evaluation models can be set for different systems, so as to allocate service requests more reasonably according to the performance status of service nodes.
[0052] In one optional embodiment, determining the target service node from multiple service nodes based on evaluation data includes: sorting the evaluation data of each service node to obtain a sorting result; and selecting the service node corresponding to the evaluation data with the highest score as the target service node based on the sorting result.
[0053] Optionally, in the process of determining the target service node from multiple service nodes based on evaluation data, the evaluation data of each service node is first sorted to obtain a sorting result. Then, based on the sorting result, the service node corresponding to the evaluation data with the highest score is selected as the target service node. For example, after comprehensively calculating the evaluation data corresponding to the performance index parameters, when the microservice selects a service node for load balancing routing, it prioritizes the service node with the higher total performance index score (i.e., evaluation data).
[0054] It should be noted that service requests are dynamically allocated based on the current actual operating status of the service nodes, which avoids insufficient performance of service nodes due to uneven request allocation and improves the reliability of the business system.
[0055] In one optional embodiment, after sorting the evaluation data of each service node to obtain the sorting result, if there are evaluation data with the same score in the sorting result, the evaluation status diagram of the service node corresponding to the evaluation data with the same score is obtained respectively, and at least two evaluation status diagrams are obtained. The evaluation status diagram is used to characterize the changing trend of the evaluation data. Based on the at least two evaluation status diagrams, the service node corresponding to the evaluation data that is in an upward trend is taken as the target service node.
[0056] Optionally, after comprehensively calculating the evaluation data corresponding to the performance index parameters, when the microservice selects service nodes for load balancing routing, after sorting the evaluation data of each service node and obtaining the sorting results, if the total performance index scores are the same or close, the trend of the total performance index scores is considered, and the evaluation status diagrams of the service nodes corresponding to the evaluation data with the same score are obtained respectively. Based on the evaluation status diagrams, the service nodes whose total performance index scores are on the rise are selected first, that is, the service nodes corresponding to the evaluation data that are on the rise are selected as the target service nodes.
[0057] It should be noted that, in the above process, by considering the overall trend of performance metrics, the insufficient performance of service nodes caused by uneven request distribution is further avoided, the failure of service requests due to unavailable routing is reduced, the success rate of service requests is improved, the availability of the service cluster is guaranteed, and thus the reliability of the business system is improved.
[0058] In one optional embodiment, after obtaining the evaluation data of multiple service nodes, it is determined whether there is any evaluation data in the evaluation data of multiple service nodes that is less than a first threshold; if there is any evaluation data in the evaluation data of multiple service nodes that is less than the first threshold, the number of nodes of the first service node corresponding to the evaluation data less than the first threshold is determined; based on the number of nodes, a target degradation measure for the service cluster associated with the multiple service nodes is determined, wherein the target degradation measure is used to implement traffic restriction on the access request traffic of the service cluster.
[0059] Optionally, to accommodate abnormal situations, corresponding degradation measures are set up. After obtaining evaluation data from multiple service nodes, the services deployed on the service nodes can be downgraded or temporarily disabled based on the evaluation data.
[0060] Optionally, after obtaining the evaluation data of multiple service nodes, the evaluation data of the multiple service nodes is compared with a first threshold to determine whether there are any evaluation data points below the first threshold. If there are evaluation data points below the first threshold, the number of first service nodes corresponding to the evaluation data points below the first threshold is determined. Based on the number of nodes, the target degradation measures for the service cluster associated with the multiple service nodes are determined. For example, if the first threshold is 60 points, and the comprehensive calculated value of the performance index (i.e., the evaluation data) of some service nodes (i.e., the first service nodes) is less than 60 points, then the performance of these service nodes is considered poor, and the corresponding target degradation measures need to be determined based on the number of these service nodes.
[0061] Optionally, if there is no evaluation data below the first threshold among the evaluation data of multiple service nodes, that is, if the evaluation data of multiple service nodes is greater than or equal to the first threshold, then there is no need to limit the traffic of access requests to the service cluster.
[0062] Figure 4 This is a schematic diagram of an optional process for rate limiting of service nodes according to an embodiment of the present invention, such as... Figure 4 As shown, after comprehensively calculating the evaluation data corresponding to the performance index parameters, when the microservice selects a service node for a service request in the load balancing routing, it determines whether the comprehensive calculated value of a certain performance index is 0. If the comprehensive calculated value of a certain performance index is not 0, it determines whether the comprehensive calculated value of the performance index (i.e., the evaluation data) is less than a set threshold. If it is not less than a set threshold, the service request is executed. If the comprehensive calculated value of a certain performance index is 0, for example, the calculated value of CPU is 0, that is, the CPU utilization rate is 100%, or if the comprehensive calculated value of the performance index (i.e., the evaluation data) is less than a set threshold, the service node is considered to have poor performance, and a first-level rate limiting measure is implemented, directly disabling the corresponding service node. Newly sent service requests are routed to other nodes through the load balancing strategy.
[0063] In one optional embodiment, based on the number of nodes, a target degradation measure for a service cluster associated with multiple service nodes is determined, including: if the number of nodes is less than a second threshold, disabling the first service node is taken as the target degradation measure, and the first service node is reactivated if the evaluation data of the first service node is greater than or equal to the first threshold; if the number of nodes is greater than or equal to the second threshold, disabling the service cluster is taken as the target degradation measure, and the service cluster is reactivated if the number of nodes is less than the second threshold.
[0064] Optionally, based on the number of nodes, a target degradation measure for the service cluster associated with multiple service nodes can be determined. If the number of nodes is less than a second threshold, disabling the first service node is used as the target degradation measure, and the first service node is reactivated if its evaluation data is greater than or equal to the first threshold. If the number of nodes is greater than or equal to the second threshold, disabling the service cluster is used as the target degradation measure, and the service cluster is reactivated if the number of nodes is less than the second threshold. Specifically, as follows... Figure 4 As shown, the system continues to determine whether the comprehensive calculated value of a certain performance indicator of other service nodes in the service cluster is 0 or less than a set threshold. If the comprehensive calculated value of a certain performance indicator of other service nodes in the service cluster is not 0 or is not less than the set threshold, the service request is routed to other service nodes and executed. If the comprehensive calculated value of a certain performance indicator of all service nodes in the service cluster is 0 or less than the set threshold, it indicates that the overall performance of the service cluster is poor. A second-level rate limiting measure is adopted to reject all requests. After the performance indicators of the service cluster meet the requirements (i.e., the number of nodes is less than the second threshold), new service requests are accepted again.
[0065] It should be noted that by setting degradation measures to limit the traffic of access requests to the service cluster, the availability of the service cluster is further guaranteed, service request failures are avoided due to the unavailability of service nodes, the success rate of service requests is improved, and the reliability of the business system is enhanced.
[0066] It should be noted that in this embodiment, by collecting performance indicators of service nodes in the service cluster in real time, such as CPU utilization, memory utilization, disk I / O, and network throughput, and setting an evaluation algorithm to perform weighted scoring calculations on performance indicators, as well as degrading or disabling services deployed on service nodes, problems such as service timeouts, anomalies, or server node crashes caused by insufficient service node performance are avoided, effectively ensuring the availability of the service cluster and improving the reliability of the business system.
[0067] Therefore, the technical solution of the present invention achieves the goal of avoiding service timeouts and anomalies caused by insufficient service node performance, thereby improving the reliability of the business system and solving the technical problem of low reliability of the business system caused by insufficient service node performance due to uneven request distribution in the prior art.
[0068] Example 2
[0069] According to an embodiment of the present invention, an embodiment of a service request processing apparatus is provided, wherein, Figure 5 This is a schematic diagram of an optional service request processing apparatus according to an embodiment of the present invention, such as... Figure 5 As shown, the device includes: a first acquisition module 501, used to acquire access request traffic, wherein the access request traffic includes at least one access request, and the at least one access request is used to request a target service; a first determination module 502, used to acquire evaluation data of multiple service nodes, and determine a target service node from the multiple service nodes based on the evaluation data, wherein the evaluation data is obtained by weighted calculation of the performance index data of multiple service nodes; and a first allocation module 503, used to allocate the access request traffic to the target service node, wherein the target service node is used to respond to at least one access request.
[0070] It should be noted that the first acquisition module 501, the first determination module 502 and the first allocation module 503 mentioned above correspond to steps S101 to S103 in the above embodiments. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment 1.
[0071] Optionally, the service request processing apparatus further includes: a collection module, used to collect data from multiple service nodes based on a preset sampling frequency using a data collection component before acquiring access request traffic, to obtain performance index data of multiple service nodes; a first generation module, used to generate a data collection message based on the performance index data of multiple service nodes, and send the data collection message to the data analysis component through a message queue between the data collection component and the data analysis component; and a first calculation module, used to perform weighted calculation on the performance index data of multiple service nodes through the data analysis component to obtain evaluation data, and store the evaluation data in a preset database.
[0072] Optionally, the first calculation module includes: a second determining module, used to determine the weight of each performance indicator data of each service node through a data analysis component; a second calculation module, used to calculate the evaluation score of each performance indicator data based on the weight of each performance indicator data and the first calculation formula; and a third calculation module, used to perform summation calculation based on the evaluation scores of each performance indicator data to obtain the evaluation data of each service node.
[0073] Optionally, the first determining module includes: a sorting module, used to sort the evaluation data of each service node to obtain a sorting result; and a third determining module, used to select the service node corresponding to the evaluation data with the highest score as the target service node based on the sorting result.
[0074] Optionally, the service request processing device further includes: a second acquisition module, configured to, after sorting the evaluation data of each service node and obtaining the sorting result, if there are evaluation data with the same score in the sorting result, acquire the evaluation status diagram of the service node corresponding to the evaluation data with the same score respectively, and obtain at least two evaluation status diagrams, wherein the evaluation status diagram is used to characterize the changing trend of the evaluation data; and a fourth determination module, configured to, based on the at least two evaluation status diagrams, select the service node corresponding to the evaluation data that is in an upward trend as the target service node.
[0075] Optionally, the service request processing apparatus further includes: a judgment module, used to determine whether there is any evaluation data less than a first threshold among the evaluation data of multiple service nodes after obtaining the evaluation data of multiple service nodes; a fifth determination module, used to determine the number of nodes of the first service node corresponding to the evaluation data less than the first threshold if there is any evaluation data less than the first threshold among the evaluation data of multiple service nodes; and a sixth determination module, used to determine the target degradation measures for the service cluster associated with multiple service nodes based on the number of nodes, wherein the target degradation measures are used to implement traffic restriction on the access request traffic of the service cluster.
[0076] Optionally, the sixth determining module includes: a seventh determining module, used to disable the first service node as a target degradation measure if the number of nodes is less than the second threshold, and to re-enable the first service node if the evaluation data of the first service node is greater than or equal to the first threshold; and an eighth determining module, used to disable the service cluster as a target degradation measure if the number of nodes is greater than or equal to the second threshold, and to re-enable the service cluster if the number of nodes is less than the second threshold.
[0077] Example 3
[0078] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described service request processing method when running.
[0079] Example 4
[0080] According to another aspect of the present invention, an electronic device is also provided, wherein, Figure 6 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as... Figure 6 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement a method for running the program, wherein the program is configured to execute the aforementioned service request processing method during runtime. When the processor executes the program, it performs the following steps: acquiring access request traffic, wherein the access request traffic includes at least one access request, the at least one access request being used to request a target service; acquiring evaluation data of multiple service nodes, and determining a target service node from the multiple service nodes based on the evaluation data, wherein the evaluation data is obtained by weighted calculation of performance indicator data of the multiple service nodes; and allocating the access request traffic to the target service node, wherein the target service node is used to respond to at least one access request.
[0081] Optionally, the processor also performs the following steps when executing the program: before acquiring access request traffic, the data acquisition component collects data from multiple service nodes based on a preset sampling frequency to obtain performance index data of multiple service nodes; a data collection message is generated based on the performance index data of multiple service nodes, and the data collection message is sent to the data analysis component through a message queue between the data acquisition component and the data analysis component; the performance index data of multiple service nodes is weighted and calculated by the data analysis component to obtain evaluation data, and the evaluation data is stored in a preset database.
[0082] Optionally, the performance index data of multiple service nodes are weighted and calculated using a data analysis component to obtain evaluation data, including: determining the weight of each performance index data of each service node using the data analysis component; calculating the evaluation score of each performance index data based on the weight of each performance index data and the first calculation formula; and summing the evaluation scores of each performance index data to obtain the evaluation data of each service node.
[0083] Optionally, the target service node is determined from multiple service nodes based on the evaluation data, including: sorting the evaluation data of each service node to obtain a sorting result; and selecting the service node corresponding to the evaluation data with the highest score as the target service node based on the sorting result.
[0084] Optionally, after sorting the evaluation data of each service node and obtaining the sorting result, if there are evaluation data with the same score in the sorting result, the evaluation status diagram of the service node corresponding to the evaluation data with the same score is obtained respectively, and at least two evaluation status diagrams are obtained. The evaluation status diagram is used to characterize the changing trend of the evaluation data. Based on the at least two evaluation status diagrams, the service node corresponding to the evaluation data that is in an upward trend is taken as the target service node.
[0085] Optionally, after obtaining the evaluation data of multiple service nodes, it is determined whether there is any evaluation data in the evaluation data of multiple service nodes that is less than a first threshold; if there is any evaluation data in the evaluation data of multiple service nodes that is less than the first threshold, the number of nodes of the first service node corresponding to the evaluation data less than the first threshold is determined; based on the number of nodes, a target degradation measure for the service cluster associated with multiple service nodes is determined, wherein the target degradation measure is used to implement traffic restriction on the access request traffic of the service cluster.
[0086] Optionally, based on the number of nodes, a target degradation measure for the service cluster associated with multiple service nodes is determined, including: if the number of nodes is less than a second threshold, disabling the first service node is used as the target degradation measure, and the first service node is reactivated if the evaluation data of the first service node is greater than or equal to the first threshold; if the number of nodes is greater than or equal to the second threshold, disabling the service cluster is used as the target degradation measure, and the service cluster is reactivated if the number of nodes is less than the second threshold.
[0087] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0088] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0089] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0090] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0092] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0093] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0094] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of processing a service request, characterized by, The method comprises the following steps: obtaining access request traffic, wherein the access request traffic comprises at least one access request for requesting a target service; obtaining evaluation data of a plurality of service nodes, and determining a target service node from the plurality of service nodes according to the evaluation data, wherein the evaluation data is obtained by weighting performance index data of the plurality of service nodes; allocating the access request traffic to the target service node, wherein the target service node is used to respond to the at least one access request; wherein, according to the evaluation data, the target service node is determined from the plurality of service nodes, comprising: sorting the evaluation data of each service node to obtain a sorting result; if there are evaluation data with the same score in the sorting result, obtaining an evaluation state diagram of the service node corresponding to the evaluation data with the same score to obtain at least two evaluation state diagrams, wherein the evaluation state diagram is used to represent the change trend of the evaluation data; according to the at least two evaluation state diagrams, the service node corresponding to the evaluation data in the rising trend is taken as the target service node; wherein, the method further comprises setting different evaluation models for different systems; wherein, after obtaining the evaluation data of the plurality of service nodes, the method further comprises: judging whether there is evaluation data less than a first threshold value in the evaluation data of the plurality of service nodes; if there is evaluation data less than the first threshold value in the evaluation data of the plurality of service nodes, determining the number of nodes of a first service node corresponding to the evaluation data less than the first threshold value; determining a target degradation measure for a service cluster associated with the plurality of service nodes according to the number of nodes; determining a target degradation measure for a service cluster associated with the plurality of service nodes according to the number of nodes, comprising: if the number of nodes is less than a second threshold value, disabling the first service node as the target degradation measure, and re-enabling the first service node if the evaluation data of the first service node is greater than or equal to the first threshold value; if the number of nodes is greater than or equal to the second threshold value, disabling the service cluster as the target degradation measure, and re-enabling the service cluster if the number of nodes is less than the second threshold value.
2. The method of claim 1, wherein, Before obtaining the access request traffic, the method further comprises: performing data collection on the plurality of service nodes based on a preset sampling frequency by a data collection component to obtain performance index data of the plurality of service nodes; generating a data collection message according to the performance index data of the plurality of service nodes, and sending the data collection message to a data analysis component through a message queue between the data collection component and the data analysis component; performing weighting calculation on the performance index data of the plurality of service nodes by the data analysis component to obtain the evaluation data, and storing the evaluation data in a preset database.
3. The method of claim 2, wherein, The data analysis component is configured to perform weighted calculation on the performance indicator data of the plurality of service nodes to obtain the evaluation data, including: The data analysis component is configured to determine the weight of each performance indicator data of each service node; According to the weight of each performance indicator data and a first calculation formula, the evaluation score of each performance indicator data is calculated; According to the evaluation score of each performance indicator data, the evaluation data of each service node is obtained by summation calculation.
4. The method of claim 3, wherein, According to the evaluation data, the target service node is determined from the plurality of service nodes, including: According to the ranking result, the service node corresponding to the evaluation data with the highest score is taken as the target service node.
5. A service request processing apparatus characterized by comprising: Including: The first acquisition module is configured to acquire access request traffic, wherein the access request traffic includes at least one access request, and the at least one access request is used to request a target service; The first determination module is configured to acquire evaluation data of a plurality of service nodes, and determine a target service node from the plurality of service nodes according to the evaluation data, wherein the evaluation data is obtained by performing weighted calculation on performance indicator data of the plurality of service nodes; The first allocation module is configured to allocate the access request traffic to the target service node, wherein the target service node is used to respond to the at least one access request; The first determination module includes a sorting module configured to sort the evaluation data of each service node to obtain a ranking result; The device further includes a second acquisition module configured to, after sorting the evaluation data of each service node to obtain a ranking result, if there are evaluation data with the same score in the ranking result, acquire an evaluation state diagram of the service node corresponding to the evaluation data with the same score respectively to obtain at least two evaluation state diagrams, wherein the evaluation state diagram is used to represent the change trend of the evaluation data; and a fourth determination module configured to, according to the at least two evaluation state diagrams, take the service node corresponding to the evaluation data in an upward trend as the target service node; The device further includes different evaluation models for different systems; The device further includes a judgment module configured to, after acquiring the evaluation data of the plurality of service nodes, judge whether there is evaluation data less than a first threshold value in the evaluation data of the plurality of service nodes; a fifth determination module configured to, if there is evaluation data less than the first threshold value in the evaluation data of the plurality of service nodes, determine the number of nodes of a first service node corresponding to the evaluation data less than the first threshold value; and a sixth determination module configured to, according to the number of nodes, determine a target degradation measure of a service cluster associated with the plurality of service nodes, wherein the target degradation measure is used to realize traffic limitation of access request traffic of the service cluster. The sixth determining module comprises: a seventh determining module, configured to, if the number of nodes is less than the second threshold value, take disabling the first service node as the target degradation measure, and re-enable the first service node if the evaluation data of the first service node is greater than or equal to the first threshold value; and an eighth determining module, configured to, if the number of nodes is greater than or equal to the second threshold value, take disabling the service cluster as the target degradation measure, and re-enable the service cluster if the number of nodes is less than the second threshold value.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is configured to execute the processing method of the service request in any one of claims 1 to 4 when running.
7. An electronic device, comprising: The electronic device comprises one or more processors; The memory is configured to store one or more programs, and the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a program for running, wherein the program is configured to execute the processing method of the service request in any one of claims 1 to 4 when running. The electronic device comprises one or more processors; The memory is configured to store one or more programs, and the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a program for running, wherein the program is configured to execute the processing method of the service request in any one of claims 1 to 4 when running.
Citation Information
Patent Citations
Service capability control method and system of server cluster
CN103023938A
Dispatching method in hybrid cloud environment and flow control equipment
CN106453132A
Method and device for accessing a service in content delivery network
CN111064760A