CN116886774A - Request processing method and device, electronic equipment and computer readable storage medium - Google Patents

Request processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116886774A
CN116886774A CN202310684733.0A CN202310684733A CN116886774A CN 116886774 A CN116886774 A CN 116886774A CN 202310684733 A CN202310684733 A CN 202310684733A CN 116886774 A CN116886774 A CN 116886774A
Authority
CN
China
Prior art keywords
access request
target
gateway
routing path
cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310684733.0A
Other languages
Chinese (zh)
Inventor
桑银邦
魏鑫
高楚皓
成诺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310684733.0A priority Critical patent/CN116886774A/en
Publication of CN116886774A publication Critical patent/CN116886774A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a request processing method and device, electronic equipment and a computer readable storage medium, and can be applied to the technical fields of big data, computer and financial science and technology. The request processing method comprises the following steps: receiving an access request to be processed; determining the message capacity of an access request to be processed; based on the message capacity, determining a target routing path corresponding to the access request to be processed according to a pre-configured routing rule, wherein the routing rule is used for representing: the mapping relation between the message capacity of the access request and the routing path of the access request; and distributing the pending access request to the target gateway cluster based on the target routing path.

Description

Request processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the technical field of big data, the technical field of computers, and the technical field of financial science, and in particular, to a request processing method, apparatus, device, medium, and program product.
Background
In the request service processing process, a single architecture and a distributed architecture coexist, and when the single architecture accesses a service provided in a distributed architecture application, the single architecture generally needs to use an HTTP mode, and therefore, a set of service gateway needs to be built to support HTTP request processing, so that access to the service is realized. Because the size of the message carried by each HTTP request transaction is different, the gateway node has different calculation resources and processing time of the gateway which are required to be consumed in the processing process after receiving the request, and the gateway needs more CPU resources and longer processing time when processing the HTTP request with large message; the opposite is true of the request of report Wen Xiao.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: under the condition of sudden increase of concurrency, the large message requests for resources such as CPU, memory and the like of the gateway node, so that the processing of the small message in the gateway is affected, and the risk of failure in request processing exists.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a request processing method, apparatus, device, medium, and program product.
In one aspect of the present disclosure, a request processing method is provided, including:
receiving an access request to be processed;
determining the message capacity of an access request to be processed;
based on the message capacity, determining a target routing path corresponding to the access request to be processed according to a pre-configured routing rule, wherein the routing rule is used for representing: the mapping relation between the message capacity of the access request and the routing path of the access request;
and distributing the pending access request to the target gateway cluster based on the target routing path.
According to an embodiment of the present disclosure, the target gateway cluster includes at least one sub-cluster, and the method further includes:
determining a target sub-cluster from at least one sub-cluster according to a pre-configured forwarding rule based on a target application service called by the pending access request, wherein the forwarding rule is used for representing: the mapping relation between the application service called by the access request and the subset group for forwarding the access request;
And forwarding the pending access request to the target application service through the target sub-cluster.
According to an embodiment of the present disclosure, the above method further includes:
acquiring resource utilization data of gateway nodes in a target gateway cluster from a monitoring configuration center;
and adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data.
According to an embodiment of the present disclosure, wherein the resource utilization data includes a CPU utilization, adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data includes:
and under the condition that the CPU utilization rate is larger than a preset utilization rate threshold value, increasing the number of gateway nodes of the target gateway cluster.
According to an embodiment of the present disclosure, wherein increasing the number of gateway nodes of the target gateway cluster comprises:
reading history processing information of a plurality of history access requests within a predetermined history period from a log center;
determining the number of target nodes which can be adapted to the target gateway cluster according to the historical processing information;
and increasing the number of gateway nodes of the target gateway cluster to the number of target nodes.
Another aspect of the present disclosure provides a request processing apparatus, including a receiving module, a first determining module, a second determining module, and a distributing module.
The receiving module is used for receiving the access request to be processed;
the first determining module is used for determining the message capacity of the access request to be processed;
the second determining module is configured to determine, based on the message capacity, a target routing path corresponding to the access request to be processed according to a pre-configured routing rule, where the routing rule is used for characterizing: the mapping relation between the message capacity of the access request and the routing path of the access request;
and the distribution module is used for distributing the pending access request to the target gateway cluster based on the target routing path.
According to the embodiment of the disclosure, the target gateway cluster comprises at least one sub-cluster, and the device further comprises a third determining module and a forwarding module.
The third determining module is configured to determine a target sub-cluster from at least one sub-cluster according to a pre-configured forwarding rule based on a target application service called by the pending access request, where the forwarding rule is used to characterize: the mapping relation between the application service called by the access request and the subset group for forwarding the access request;
and the forwarding module is used for forwarding the pending access request to the target application service through the target sub-cluster.
According to the embodiment of the disclosure, the target gateway cluster is a first gateway cluster or a second gateway cluster, the target routing path is a first routing path or a second routing path, and the second determining module comprises a first determining unit and a second determining unit.
The first determining unit is configured to determine, when the message capacity of the to-be-processed access request is in a first preset numerical range, that a target routing path corresponding to the to-be-processed access request is a first routing path, where the first routing path is used to instruct to distribute the to-be-processed access request to the first gateway cluster;
the second determining unit is configured to determine, when the message capacity of the to-be-processed access request is in a second preset numerical range, that the target routing path corresponding to the to-be-processed access request is a second routing path, where the second routing path is used to instruct to distribute the to-be-processed access request to the second gateway cluster, and the first preset numerical range and the second preset numerical range are different.
According to the embodiment of the disclosure, the device further comprises an acquisition module and an adjustment module.
The acquisition module is used for acquiring the resource utilization data of the gateway nodes in the target gateway cluster from the monitoring configuration center;
And the adjusting module is used for adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data.
According to an embodiment of the disclosure, the resource utilization data includes a CPU utilization, and the adjustment module includes an increasing unit configured to increase the number of gateway nodes of the target gateway cluster if the CPU utilization is greater than a preset utilization threshold.
According to an embodiment of the present disclosure, the adding unit includes a reading subunit, a determining subunit, and an adding subunit.
The reading subunit is used for reading the history processing information of the plurality of history access requests in the preset history time period from the log center;
a determining subunit, configured to determine, according to the historical processing information, the number of target nodes that can be adapted to the target gateway cluster;
and the adding subunit is used for adding the number of gateway nodes of the target gateway cluster to the number of target nodes.
Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the request processing method described above.
Another aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described request processing method.
Another aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described request processing method.
According to the request processing method of the embodiment of the disclosure, unlike the conventional technology that only one gateway cluster is set, the service gateway in the embodiment of the disclosure comprises a plurality of different gateway clusters, and a routing rule is preconfigured to set a mapping relationship between a message capacity of an access request and a routing path. Based on the method, the message capacity is determined, a target routing path corresponding to the to-be-processed access request is determined according to a pre-configured routing rule based on the message capacity, and the to-be-processed access request is further distributed to the target gateway cluster according to the target routing path. In this way, the processing of the large message request and the small message request with different capacities in the respective independent gateway clusters is realized according to the self-adaptive matching of the message sizes to the different service gateway clusters, the processing is completed in the respective independent gateway clusters, the physical isolation is realized, the risk that the large message request and the small message request are coupled together is reduced, the risk that the small message request is influenced by the large message is reduced, and the technical problem that the processing of the small message gateway is influenced due to the resources such as a CPU (central processing unit) and a memory of a robbing gateway node when the large message gateway is suddenly increased in concurrency is solved, and the risk of failure in request processing exists; the method improves the efficiency of message processing, improves the resource utilization rate of different message gateways, reduces the risk of message processing failure, and improves the stability of a message processing system.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a request processing method, apparatus, device, medium and program product according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a request processing method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a system architecture diagram of a request processing method according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a request processing method according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a request processing apparatus according to an embodiment of the present disclosure;
fig. 6 schematically illustrates a block diagram of an electronic device adapted to implement a request processing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc., of the data involved (including, but not limited to, user personal information) all comply with relevant legal regulations, are used for legal purposes, and do not violate well-known. In particular, necessary measures are taken for personal information of the user, illegal access to personal information data of the user is prevented, and personal information security, network security and national security of the user are maintained.
In embodiments of the present disclosure, the user's authorization or consent is obtained before the user's personal information is obtained or collected.
It should be noted that, the request processing method and apparatus, the electronic device and the computer readable storage medium of the present disclosure may be applied to the big data technical field, the computer technical field, and the financial science and technology field, and may also be applied to any field other than the big data technical field, the computer technical field, and the financial science and technology field, and the application fields of the request processing method and apparatus, the electronic device and the computer readable storage medium of the present disclosure are not limited.
The embodiment of the disclosure provides a request processing method, which comprises the following steps:
receiving an access request to be processed; determining the message capacity of an access request to be processed; based on the message capacity, determining a target routing path corresponding to the access request to be processed according to a pre-configured routing rule, wherein the routing rule is used for representing: the mapping relation between the message capacity of the access request and the routing path of the access request; and distributing the pending access request to the target gateway cluster based on the target routing path.
Fig. 1 schematically illustrates an application scenario diagram of a request processing method, apparatus, device, medium and program product according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include load balancing 101, a gateway 102, and an application service 103. The load balancing 101, the gateway 102, the application service 103 communicate via a network, which may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
The load balancing 101 may be a soft load balancing or a hardware load balancing. The method is used for realizing balanced forwarding of the user request.
The gateway 102 is configured to support the conversion of http protocol to rpc protocol, and to sequence and reverse sequence the request message, and to forward the request.
The application service 103 may employ a monolithic architecture and a distributed architecture, where service clusters are employed to handle service invocation requests.
The application service 103 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using terminal devices. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
The user may interact with the application service 103 via a network using the terminal device to receive or send messages or the like. Various communication client applications may be installed on the terminal device, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, and the like (by way of example only).
In the application scenario of the embodiment of the present disclosure, the user request is first subjected to load balancing, the load balancing forwards the user request to the gateway 102, and after the gateway 102 performs serialization and anti-serialization processing on the request message, the gateway forwards the message to the application service 103 for performing service processing.
It should be understood that the number of load balancing, gateways, servers in fig. 1 is merely illustrative. There may be any number of load balancing, gateways, servers, as desired for implementation.
The request processing method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 6 based on the scenario described in fig. 1.
Fig. 2 schematically illustrates a flow chart of a request processing method according to an embodiment of the disclosure. Fig. 3 schematically illustrates a system architecture diagram of a request processing method according to an embodiment of the present disclosure. The request processing method of this embodiment will be described below with reference to fig. 2 and 3.
As shown in fig. 2, the request processing method of this embodiment includes operations S201 to S204.
In operation S201, receiving a pending access request;
in operation S202, determining the message capacity of the access request to be processed (the message size, such as 50K for the message capacity of request 1, 1M for the message capacity of request 2, etc.);
in operation S203, a target routing path corresponding to the pending access request is determined according to a pre-configured routing rule based on the message capacity, where the routing rule is used to characterize: the mapping relation between the message capacity of the access request and the routing path of the access request;
in operation S204, the pending access request is distributed to the target gateway cluster based on the target routing path.
As shown in fig. 3, a system architecture to which the request processing method of the embodiments of the present disclosure may be applied may include load balancing, service gateway, application service, log center, monitoring configuration center, and the like.
The load balancing may be soft load balancing as shown, or may be hardware load balancing.
The service gateway is used for supporting the conversion of the http protocol into rpc protocol processing, carrying out serialization and anti-sequence processing on the request message, and forwarding the request to the corresponding application service cluster.
The application service may employ a distributed architecture, for example, a Dubbo service (a distributed service developed based on the Dubbo framework) for processing service call requests. A container or virtual machine that deploys the Dubbo service may be employed and the service call request may be processed. Under the condition of adopting the distributed architecture service, the system also comprises a Zookpeer service center, wherein the Zookpeer is an open-source distributed collaborative service system, provides consistency service for the distributed system, and provides service registration and subscription capability.
The log center may be used to record processing information such as related calls, forwarding, etc. of the request. After the HTTP request message is received by the service gateway, recording the size of the message, the application service called by the access request, the forwarding path and other log information in fixed formats. And further sending information to a log center through a distributed message middleware such as kafka and the like, and storing and analyzing each log in the log center for inquiring at the front end of the log center. The log center provides the analyzed log message format, including the called application service name, message size, forwarding path and other processing information carried in each request message.
The monitoring configuration center is preconfigured with routing rules and forwarding rules. The routing rule is used for representing the mapping relation between the message capacity of the access request and the routing path of the access request. The forwarding rule is used for representing the mapping relation between the application service called by the access request and the gateway sub-cluster for forwarding the access request. The monitoring configuration center can call and consult various types of log information from the log center so as to dynamically adjust the configured routing rules and forwarding rules in combination with the log information.
The monitoring configuration center can be used for monitoring the resource utilization data of each gateway node in the service gateway, such as the use conditions of a CPU, a memory, a hard disk and the like, and is convenient for dynamically adjusting the number of the nodes in the service gateway according to the monitoring data.
In the process of processing a request service, when a single architecture accesses a service provided in a distributed architecture application, an HTTP mode is generally needed, and therefore, a set of service gateway needs to be built to support HTTP request processing, so that access to the service is realized. Because the size of the message carried by each HTTP request transaction is different, the gateway node has different calculation resources and processing time of the gateway which are required to be consumed in the processing process after receiving the request, and the gateway needs more CPU resources and longer processing time when processing the HTTP request with large message; the opposite is true of the request of report Wen Xiao. Under the condition of sudden increase of concurrency, the large message requests for resources such as CPU, memory and the like of the gateway node, so that the processing of the small message in the gateway is affected, and the risk of failure in request processing exists. In the related art, for example, the processing capability of a single gateway is prevented from being insufficient by limiting the current to the gateway server. However, controlling the transaction request amount of a single gateway only ensures that the gateway does not present systematic risks, but does not thoroughly solve the problem of mixed processing of size message requests in the gateway.
According to an embodiment of the present disclosure, in the above request processing method, unlike the conventional technology, only one gateway cluster is set, and the service gateway includes a plurality of different gateway clusters.
The routing rules pre-configured by the monitoring configuration center are used for representing the mapping relation between the message capacity of the access request and the routing path of the access request. Wherein the routing path based on the routing rule may determine to which service gateway cluster the request message is sent. For example, the message capacity is smaller than 50k, and the message is sent to the gateway cluster 1; the message capacity is greater than or equal to 50k and less than 500k, and the message capacity is sent to the gateway cluster 2; the message capacity is greater than 500k, and is sent to gateway cluster 3, etc.
According to an embodiment of the present disclosure, the execution subject of the request processing method of this embodiment may be soft load balancing. After receiving the pending access request, the soft load balancing determines the size of the message of the pending access request through operation S202, reads a pre-configured routing rule from the monitoring configuration center through operation S203, and determines a target routing path corresponding to the request, that is, determines which service gateway cluster to send the request message to based on the routing path of the routing rule; through operation S204, the pending access request is distributed to the target gateway cluster based on the target routing path. After the target gateway cluster performs serialization and anti-serialization processing on the request message, the target gateway cluster forwards the message to the application service for business processing
According to the request processing method of the embodiment of the disclosure, unlike the conventional technology in which only one gateway cluster is set, the service gateway comprises a plurality of different gateway clusters, and a routing rule is preconfigured to set a mapping relationship between a message capacity of an access request and a routing path. Based on the method, the message capacity is determined, a target routing path corresponding to the to-be-processed access request is determined according to a pre-configured routing rule based on the message capacity, and the to-be-processed access request is further distributed to the target gateway cluster according to the target routing path. In this way, the processing of the large message request and the small message request with different capacities in the respective independent gateway clusters is realized according to the self-adaptive matching of the message sizes to the different service gateway clusters, the processing is completed in the respective independent gateway clusters, the physical isolation is realized, the risk that the large message request and the small message request are coupled together is reduced, the risk that the small message request is influenced by the large message is reduced, and the technical problem that the processing of the small message gateway is influenced due to the resources such as a CPU (central processing unit) and a memory of a robbing gateway node when the large message gateway is suddenly increased in concurrency is solved, and the risk of failure in request processing exists; the method improves the efficiency of message processing, improves the resource utilization rate of different message gateways, reduces the risk of message processing failure, and improves the stability of a message processing system.
According to an embodiment of the present disclosure, in particular, for size packet differentiation processing, the service gateway cluster includes a first gateway cluster and a second gateway cluster. The first gateway cluster can be used for intensively processing the messages with larger capacity, and the second gateway cluster is used for intensively processing the messages with smaller capacity.
The routing rules pre-configured by the monitoring configuration center are used for representing the mapping relation between the message capacity of the access request and the routing path of the access request. The routing rules comprise a first routing rule and a second routing rule, the first routing rule corresponds to a first routing path, and the first routing path is used for indicating to distribute the access request to be processed to the first gateway cluster; the second routing rule corresponds to a second routing path for indicating to distribute the pending access request to the second gateway cluster.
Specifically, the first routing rule is: and under the condition that the message capacity of the access request is in a first preset numerical range, determining a target routing path corresponding to the access request to be processed as a first routing path.
The second routing rule is: and under the condition that the message capacity of the access request is in a second preset numerical range, determining a target routing path corresponding to the access request to be processed as a second routing path.
Wherein the first preset value range and the second preset value range are different. For example:
the first routing rule is: and under the condition that the message capacity of the access request is smaller than 200k, determining a target routing path corresponding to the access request to be processed as a first routing path, and distributing the access request to be processed to a first gateway cluster.
The second routing rule is: and under the condition that the message capacity of the access request is greater than or equal to 200k, determining a target routing path corresponding to the access request to be processed as a second routing path, and distributing the access request to be processed to a second gateway cluster.
The monitoring configuration center can increase the processing rule of the request message on the soft load balancing system through the online interface, and provides specific rule information for forwarding the subsequent request. If the routing rule of the soft load balancing system is added with a corresponding routing path forwarding rule, after the soft load balancing system receives a request, the request can be forwarded to a corresponding large message gateway cluster or small message gateway cluster for processing based on the rule, so that physical isolation of large and small messages on different gateway clusters is realized.
According to an embodiment of the present disclosure, the target gateway cluster comprises at least one sub-cluster.
Fig. 4 schematically illustrates a flow chart of a request processing method according to another embodiment of the present disclosure. The request processing method of this embodiment includes operations S401 to S402 as shown in fig. 4, in addition to operations S201 to S204 described above.
In operation S401, a target sub-cluster is determined from at least one sub-cluster according to a pre-configured forwarding rule based on a target application service invoked by the pending access request, wherein the forwarding rule is used to characterize: the mapping relation between the application service called by the access request and the subset group for forwarding the access request;
in operation S402, the pending access request is forwarded to the target application service through the target sub-cluster.
According to an embodiment of the present disclosure, the monitoring configuration center is preconfigured with a forwarding rule in addition to a routing rule. The forwarding rule is used for representing the mapping relation between the application service called by the access request and the gateway sub-cluster for forwarding the access request. Based on this, on the basis of determining which service gateway cluster to send the request message to based on the routing rule, it may be determined which subset group of the service gateway clusters to send the request message to in order to forward the pending access request to the corresponding target application service through the subset group further based on the forwarding rule.
For example, when the target application service called by the pending access request is service 1, forwarding the pending access request to service 1 through sub-cluster a; and when the target application service called by the pending access request is the service 2, forwarding the pending access request to the service 2 through the sub-cluster B. And when the target application service called by the pending access request is the service 3, forwarding the pending access request to the service 3 through the sub-cluster C.
According to an embodiment of the present disclosure, further, the resource configuration of each of at least one sub-cluster in the target gateway cluster is different, where the resource configuration may specifically include the number of gateway nodes, and may further include configuration of computer performance indexes such as processing speed and memory capacity of the node CPU.
According to the embodiment of the disclosure, considering that the busyness of business processing of different application services is different, for example, application A is a transfer transaction type service, the request amount of the service in each period is relatively large, application B is a query type service of specific data, and the request amount of the service in most periods is relatively small. In order to match the request processing capacity of different application services, the gateway cluster is further subdivided into a plurality of sub-clusters with different resource allocation levels, and the sub-clusters are respectively used for forwarding the requests corresponding to the different application services.
According to the embodiment of the disclosure, the monitoring configuration center may also be used for monitoring resource utilization data of each gateway node in the service gateway, such as usage conditions of a CPU, a memory, a hard disk, etc., so as to dynamically adjust the number of nodes in the service gateway according to the monitoring data.
Based on this, the above request processing method further includes:
acquiring resource utilization data of gateway nodes in a target gateway cluster from a monitoring configuration center;
and adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data.
Specifically, the resource utilization data includes a CPU utilization of each gateway node, and adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data includes: and under the condition that the CPU utilization rate is larger than a preset utilization rate threshold value, increasing the number of gateway nodes of the target gateway cluster. And under the condition that the CPU utilization rate is smaller than or equal to a preset utilization rate threshold value, reducing the number of gateway nodes of the target gateway cluster.
According to the embodiment of the disclosure, the dynamic capacity expansion and contraction mechanism is realized based on the CPU index by the method, the dynamic adjustment of the gateway node can be realized according to the resource utilization condition of the gateway node, the resource utilization rate of the gateway can be improved, and the requirement of full utilization of resources is met.
According to an embodiment of the present disclosure, further, the adjusting the number of gateway nodes of the target gateway cluster may specifically be:
the CPU utilization rate of the gateway nodes is monitored regularly according to fixed time intervals, and the number of gateway nodes of the target gateway cluster is increased under the condition that the CPU utilization rate of the predetermined number of gateway nodes is larger than a preset utilization rate threshold value; the method can be that a stepwise increasing mode is adopted, and a fixed number of nodes are added each time until the gateway nodes with the CPU utilization rate larger than the preset utilization rate threshold value are smaller than the preset number.
And under the condition that the CPU utilization rate of the gateway nodes is smaller than or equal to a preset utilization rate threshold value, reducing the number of the gateway nodes of the target gateway cluster, and similarly, adopting a gradually decreasing mode, and reducing the number of the nodes by a fixed number each time until the number of the gateway nodes of which the CPU utilization rate is larger than the preset utilization rate threshold value is larger than zero and smaller than the preset number.
For example, monitoring CPU resources of node containers in the gateway cluster, checking whether the CPU exceeds a set threshold (such as 90%) at fixed time intervals (1 minute, 5 minutes and the like), if so, executing online capacity expansion, adding one container each time, and reducing container CPU consumption until a condition is met; when the CPU is below a set threshold (e.g., 30%), then the scaling action is performed until the condition is met, but the minimum container deployment requirement needs to be met.
According to the embodiment of the disclosure, although the above-mentioned manner of gradually adjusting the number of nodes can meet the requirement of dynamic adjustment, in some situations, the adjustment period is longer, and the condition can be met by multiple adjustment methods. Based on the above, the number of the gateway nodes of the target gateway cluster can be adjusted by combining the historical processing information to determine the number of the target nodes which can be adapted to the adjusted gateway cluster, and further dynamically adjusting the gateway cluster in place.
Specifically, increasing the number of gateway nodes of the target gateway cluster includes:
first, history processing information of a plurality of history access requests for a predetermined history period is read from a log center. The history processing information includes, for example: the number of historical access requests, the message capacity, the number of gateway nodes within the cluster that handle the historical access requests, the historical CPU utilization of the gateway nodes, and the like.
And then, determining the number of target nodes which can be adapted to the target gateway cluster according to the historical processing information.
Then, the number of gateway nodes of the target gateway cluster is increased to the number of target nodes.
Specifically, determining the number of target nodes to which the target gateway cluster is adaptable according to the historical processing information may include:
under the condition that the historical CPU utilization rate of the gateway node meets the preset condition, calculating the historical basic capacity of the historical access request based on the number of the historical access requests and the message capacity; calculating the current basic capacity based on the request quantity and the message capacity of the current target gateway cluster;
Then, calculating the ratio of the basic capacity of the historical access request to the number of gateway nodes in the cluster, and taking the ratio as a basic reference ratio;
then, based on the current basic capacity and the basic reference ratio, the number of target nodes which can be adapted to the target gateway cluster is calculated.
According to the embodiment of the disclosure, the number of the target nodes which can be adapted to the adjusted gateway cluster is determined by combining the historical processing information through the method, so that the number of the gateway nodes can be adjusted to meet the current use requirement in a shorter time, and the adjustment response speed is improved.
Based on the request processing method, the disclosure further provides a request processing device. The device will be described in detail below in connection with fig. 5.
Fig. 5 schematically shows a block diagram of a request processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the request processing apparatus 500 of this embodiment includes a receiving module 501, a first determining module 502, a second determining module 503, and a distributing module 504.
Wherein, the receiving module 501 is configured to receive a pending access request;
a first determining module 502, configured to determine a message capacity of an access request to be processed;
a second determining module 503, configured to determine, according to a pre-configured routing rule, a target routing path corresponding to the pending access request based on the message capacity, where the routing rule is used to characterize: the mapping relation between the message capacity of the access request and the routing path of the access request;
A distributing module 504, configured to distribute the pending access request to the target gateway cluster based on the target routing path.
According to an embodiment of the present disclosure, a service gateway includes a plurality of different gateway clusters, and a mapping relationship between a message capacity of an access request and a routing path is set by pre-configuring a routing rule. Based on this, the first determining module 502 determines the message capacity, the second determining module 503 determines a target routing path corresponding to the pending access request according to a pre-configured routing rule based on the message capacity, and the distributing module 504 further distributes the pending access request to the target gateway cluster according to the target routing path. In this way, the processing of the large message request and the small message request with different capacities in the respective independent gateway clusters is realized according to the self-adaptive matching of the message sizes to the different service gateway clusters, the processing is completed in the respective independent gateway clusters, the physical isolation is realized, the risk that the large message request and the small message request are coupled together is reduced, the risk that the small message request is influenced by the large message is reduced, and the technical problem that the processing of the small message gateway is influenced due to the resources such as a CPU (central processing unit) and a memory of a robbing gateway node when the large message gateway is suddenly increased in concurrency is solved, and the risk of failure in request processing exists; the method improves the efficiency of message processing, improves the resource utilization rate of different message gateways, reduces the risk of message processing failure, and improves the stability of a message processing system.
According to the embodiment of the disclosure, the target gateway cluster comprises at least one sub-cluster, and the device further comprises a third determining module and a forwarding module.
The third determining module is configured to determine a target sub-cluster from at least one sub-cluster according to a pre-configured forwarding rule based on a target application service called by the pending access request, where the forwarding rule is used to characterize: the mapping relation between the application service called by the access request and the subset group for forwarding the access request;
and the forwarding module is used for forwarding the pending access request to the target application service through the target sub-cluster.
According to an embodiment of the present disclosure, the target gateway cluster is a first gateway cluster or a second gateway cluster, the target routing path is a first routing path or a second routing path, and the second determining module 503 includes a first determining unit and a second determining unit.
The first determining unit is configured to determine, when the message capacity of the to-be-processed access request is in a first preset numerical range, that a target routing path corresponding to the to-be-processed access request is a first routing path, where the first routing path is used to instruct to distribute the to-be-processed access request to the first gateway cluster;
The second determining unit is configured to determine, when the message capacity of the to-be-processed access request is in a second preset numerical range, that the target routing path corresponding to the to-be-processed access request is a second routing path, where the second routing path is used to instruct to distribute the to-be-processed access request to the second gateway cluster, and the first preset numerical range and the second preset numerical range are different.
According to the embodiment of the disclosure, the device further comprises an acquisition module and an adjustment module.
The acquisition module is used for acquiring the resource utilization data of the gateway nodes in the target gateway cluster from the monitoring configuration center;
and the adjusting module is used for adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data.
According to an embodiment of the disclosure, the resource utilization data includes a CPU utilization, and the adjustment module includes an increasing unit configured to increase the number of gateway nodes of the target gateway cluster if the CPU utilization is greater than a preset utilization threshold.
According to an embodiment of the present disclosure, the adding unit includes a reading subunit, a determining subunit, and an adding subunit.
The reading subunit is used for reading the history processing information of the plurality of history access requests in the preset history time period from the log center;
A determining subunit, configured to determine, according to the historical processing information, the number of target nodes that can be adapted to the target gateway cluster;
and the adding subunit is used for adding the number of gateway nodes of the target gateway cluster to the number of target nodes.
Any of the plurality of modules of the receiving module 501, the first determining module 502, the second determining module 503, and the distributing module 504 may be combined in one module to be implemented, or any of the plurality of modules may be split into a plurality of modules according to an embodiment of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the receiving module 501, the first determining module 502, the second determining module 503, the distributing module 504 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable way of integrating or packaging the circuits, or in any one of or a suitable combination of three of software, hardware and firmware. Alternatively, at least one of the receiving module 501, the first determining module 502, the second determining module 503, the distributing module 504 may be at least partly implemented as a computer program module, which when run may perform the respective functions.
Fig. 6 schematically illustrates a block diagram of an electronic device adapted to implement a request processing method according to an embodiment of the disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. The processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 601 may also include on-board memory for caching purposes. The processor 601 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or the RAM 603. Note that the program may be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 600 may also include an input/output (I/O) interface 605, the input/output (I/O) interface 605 also being connected to the bus 604. The electronic device 600 may also include one or more of the following components connected to a 6 input/output (I/O) interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to a 6 input/output (I/O) interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 602 and/or RAM 603 and/or one or more memories other than ROM 602 and RAM 603 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to implement the request processing method provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and/or installed from the removable medium 611. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 601. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (10)

1. A request processing method, comprising:
receiving an access request to be processed;
determining the message capacity of the access request to be processed;
Based on the message capacity, determining a target routing path corresponding to the to-be-processed access request according to a pre-configured routing rule, wherein the routing rule is used for representing: the mapping relation between the message capacity of the access request and the routing path of the access request;
and distributing the pending access request to a target gateway cluster based on the target routing path.
2. The method of claim 1, wherein the target gateway cluster comprises at least one sub-cluster, the method further comprising:
determining a target sub-cluster from the at least one sub-cluster according to a pre-configured forwarding rule based on the target application service called by the pending access request, wherein the forwarding rule is used for representing: the mapping relation between the application service called by the access request and the subset group for forwarding the access request;
and forwarding the pending access request to the target application service through the target sub-cluster.
3. The method of claim 1, wherein the target gateway cluster is a first gateway cluster or a second gateway cluster, the target routing path is a first routing path or a second routing path, and determining the target routing path corresponding to the pending access request comprises:
Under the condition that the message capacity of the to-be-processed access request is in a first preset numerical range, determining a target routing path corresponding to the to-be-processed access request as a first routing path, wherein the first routing path is used for indicating the to-be-processed access request to be distributed to a first gateway cluster;
and under the condition that the message capacity of the to-be-processed access request is in a second preset numerical range, determining a target routing path corresponding to the to-be-processed access request as a second routing path, wherein the second routing path is used for indicating to distribute the to-be-processed access request to a second gateway cluster, and the first preset numerical range and the second preset numerical range are different.
4. A method according to any one of claims 1-3, further comprising:
acquiring resource utilization data of gateway nodes in the target gateway cluster from a monitoring configuration center;
and adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data.
5. The method of claim 4, wherein the resource utilization data comprises CPU utilization, and adjusting the number of gateway nodes of the target gateway cluster according to the resource utilization data comprises:
And under the condition that the CPU utilization rate is larger than a preset utilization rate threshold value, increasing the number of gateway nodes of the target gateway cluster.
6. The method of claim 5, wherein increasing the number of gateway nodes of the target gateway cluster comprises:
reading history processing information of a plurality of history access requests within a predetermined history period from a log center;
determining the number of target nodes which can be adapted to the target gateway cluster according to the historical processing information;
and increasing the number of gateway nodes of the target gateway cluster to the number of target nodes.
7. A request processing apparatus comprising:
the receiving module is used for receiving the access request to be processed;
the first determining module is used for determining the message capacity of the access request to be processed;
the second determining module is configured to determine, based on the message capacity, a target routing path corresponding to the to-be-processed access request according to a pre-configured routing rule, where the routing rule is used to characterize: the mapping relation between the message capacity of the access request and the routing path of the access request;
and the distribution module is used for distributing the pending access request to a target gateway cluster based on the target routing path.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
CN202310684733.0A 2023-06-09 2023-06-09 Request processing method and device, electronic equipment and computer readable storage medium Pending CN116886774A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310684733.0A CN116886774A (en) 2023-06-09 2023-06-09 Request processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310684733.0A CN116886774A (en) 2023-06-09 2023-06-09 Request processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116886774A true CN116886774A (en) 2023-10-13

Family

ID=88253759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310684733.0A Pending CN116886774A (en) 2023-06-09 2023-06-09 Request processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116886774A (en)

Similar Documents

Publication Publication Date Title
CN109218355B (en) Load balancing engine, client, distributed computing system and load balancing method
Chaczko et al. Availability and load balancing in cloud computing
US10659371B1 (en) Managing throttling limits in a distributed system
US20100223383A1 (en) System for trigger-based "gated" dynamic virtual and physical system provisioning
US20040064548A1 (en) Autonomic provisioning of netowrk-accessible service behaviors within a federted grid infrastructure
US10205773B2 (en) Service platform architecture
US9591018B1 (en) Aggregation of network traffic source behavior data across network-based endpoints
CN114172966B (en) Service calling method, service processing method and device under unitized architecture
CN112445857A (en) Resource quota management method and device based on database
CN111600957A (en) File transmission method, device and system and electronic equipment
CN113381944A (en) System current limiting method, apparatus, electronic device, medium, and program product
CN112600761A (en) Resource allocation method, device and storage medium
US8032636B2 (en) Dynamically provisioning clusters of middleware appliances
JP4834622B2 (en) Business process operation management system, method, process operation management apparatus and program thereof
CN114036031B (en) Scheduling system and method for resource service application in enterprise digital middleboxes
CN112882895B (en) Health check method, device, computer system and readable storage medium
CN113765964A (en) Method and device for distributing services of distributed system
CN112561301A (en) Work order distribution method, device, equipment and computer readable medium
US20230283695A1 (en) Communication Protocol for Knative Eventing's Kafka components
US11595471B1 (en) Method and system for electing a master in a cloud based distributed system using a serverless framework
CN116886774A (en) Request processing method and device, electronic equipment and computer readable storage medium
CN115250276A (en) Distributed system and data processing method and device
CN114363339B (en) Traffic switching method, device, system, apparatus, medium and program product
Shishira et al. A comprehensive survey on federated cloud computing and its future research directions
US11720507B2 (en) Event-level granular control in an event bus using event-level policies

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination