CN114760361A - Service request distribution method, system, device and storage medium - Google Patents

Service request distribution method, system, device and storage medium Download PDF

Info

Publication number
CN114760361A
CN114760361A CN202210438693.7A CN202210438693A CN114760361A CN 114760361 A CN114760361 A CN 114760361A CN 202210438693 A CN202210438693 A CN 202210438693A CN 114760361 A CN114760361 A CN 114760361A
Authority
CN
China
Prior art keywords
server
service request
application server
target
reference parameter
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.)
Granted
Application number
CN202210438693.7A
Other languages
Chinese (zh)
Other versions
CN114760361B (en
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202210438693.7A priority Critical patent/CN114760361B/en
Publication of CN114760361A publication Critical patent/CN114760361A/en
Application granted granted Critical
Publication of CN114760361B publication Critical patent/CN114760361B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1012Server selection for load balancing based on compliance of requirements or conditions with available server resources

Abstract

The invention relates to artificial intelligence, and provides a service request distribution method, a system, equipment and a storage medium, wherein the method comprises the following steps: when a service request is obtained, sending a heartbeat packet carrying a test task to an application server; acquiring a first reference parameter of an application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs; acquiring a second reference parameter of the application server, wherein the second reference parameter represents available data processing capacity of the application server under the condition of executing the test task; determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server; and determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server.

Description

Service request distribution method, system, device and storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a method, a system, a device, and a storage medium for service request allocation.
Background
With the continuous development of internet technology, the number of service requests to be processed is continuously increased, and the requirements on the call response of a system interface are more and more stringent. At present, the system distributes and suspends service requests through a message queue to relieve the pressure of a server, but the interface supply of the system cannot meet the processing requirements of high concurrency quantity and large data volume, and the condition of response timeout easily occurs when massive service requests are distributed, so that the use experience of a user is influenced.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
Embodiments of the present invention provide a method, a system, a device, and a storage medium for allocating service requests, which can automatically allocate service requests according to the processing capability of a server, improve the efficiency of processing service requests, reduce the occurrence of response timeout, and improve the user experience.
In a first aspect, an embodiment of the present invention provides a method for allocating service requests, where the method includes:
when a service request is obtained, sending a heartbeat packet carrying a test task to an application server;
acquiring a first reference parameter of the application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs;
acquiring a second reference parameter of the application server, wherein the second reference parameter represents available data processing capacity of the application server under the condition of executing the test task;
determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server;
and determining a target resource demand according to the service request, determining the application server as a target server when the performance index meets the target resource demand, and executing the service request through the target server.
The service request distribution method provided by the embodiment of the invention at least has the following beneficial effects: under the condition of receiving a service request, acquiring a reference parameter of an application server in real time by sending a heartbeat packet with a test function, dynamically calculating according to the received reference parameter to obtain a performance index, and determining a target resource requirement through the service request, so that the service request is distributed to a target server of which the performance index meets the target resource requirement, the service request can be automatically distributed to the application server according to the performance index of the application server, the pressure of server processing is reduced, the efficiency of service request processing is improved, the condition that the response is overtime due to busy application server is avoided, and the use experience of a user is improved.
According to some embodiments of the present invention, in the service request allocating method, the determining a performance index of the application server according to the first reference parameter and the second reference parameter includes:
obtaining a third reference parameter according to the difference between the first reference parameter and the second reference parameter;
and obtaining the performance index of the application server according to the quotient of the third reference parameter and the first reference parameter.
And calculating the data processing capacity of the application server under the condition that no task runs and the data processing capacity of the application server under the condition that the application server executes the test task to obtain the data processing capacity occupied by the application server under the condition that the application server executes the service task. The performance index of the application server is dynamically calculated by combining the real-time data processing capacity of the application server under different conditions, so that the real-time performance index of the application server is obtained, and the service request is conveniently distributed.
According to some embodiments of the present invention, in the service request allocating method, a plurality of the application servers are provided, and the performance indicators correspond to the application servers one to one;
the determining a target resource requirement according to the service request, determining that the application server is a target server when the performance index meets the target resource requirement, and executing the service request through the target server, includes:
acquiring response information of the target server according to a preset reference time length;
and when the response information contains a blocking signal, determining an execution server from the rest application servers, and executing the service request through the execution server, wherein the blocking signal indicates that the target server cannot respond to the service request within preset response time.
And after the service request is distributed, timing detection is carried out on the target server, and if the target server is blocked, the service request is not returned within the specified response time. Therefore, the execution server is selected from the rest application servers, the service request is executed again, and the condition that the response is overtime is avoided.
According to some embodiments of the present invention, in the service request allocating method, when the response information includes a blocking signal, determining an execution server from the remaining application servers, and executing the service request by the execution server, includes:
when the response information contains the blocking signal, determining the residual application servers of which the performance indexes meet the target resource requirements as alternative servers;
when at least one alternative server exists, determining an execution server from the alternative servers according to the performance index, and executing the service request through the execution server.
And reselecting the application server with the performance index meeting the target resource requirement as an alternative server, if at least one alternative server exists, determining an execution server from the alternative servers according to the performance index, and re-executing the service request through the execution server, thereby improving the processing efficiency of the service request.
According to some embodiments of the present invention, in the service request allocating method, when at least one of the candidate servers exists, determining an execution server from the candidate servers according to the performance index, and executing the service request through the execution server, includes:
when at least one alternative server exists, sequencing all the alternative servers from high to low according to the performance index to obtain alternative sequencing information;
and determining an execution server from the alternative servers according to the alternative sequencing information, transferring the service request from the target server to the execution server, and executing the service request through the execution server.
And under the condition that at least one alternative server exists, sequencing all the alternative servers from high to low according to the performance indexes to obtain alternative sequencing information of the alternative servers. And selecting the alternative server with the high ranking of the alternative ranking information as an execution server, migrating the service request to the execution server, and shortening the processing time of the service request.
According to some embodiments of the present invention, in the service request allocating method, a plurality of application servers are provided, and the application servers correspond to the performance indicators one to one;
when the performance index meets the target resource requirement, determining that the application server is a target server, and executing the service request through the target server includes:
when a plurality of performance indexes meet the target resource requirement, sequencing the application servers from high to low according to the performance indexes to obtain target sequencing information;
and determining a target server from the plurality of application servers according to the target sequencing information, and executing the service request through the target server.
And under the condition that the performance indexes of a plurality of application servers meet the target resource requirement, sequencing the application servers meeting the target resource requirement from high to low according to the performance indexes to obtain target sequencing information. Therefore, according to the target sorting information, the application server with high ranking is selected as the target server, the condition that the service request response is overtime is reduced, and the processing efficiency of the service request is improved.
According to some embodiments of the present invention, in the service request allocating method, when the performance index meets the target resource requirement, determining that the application server is a target server, and executing the service request through the target server includes:
acquiring first processing time of the application server, wherein the first processing time represents processing time for the application server to execute the service request;
acquiring second processing time of a database server, wherein the second processing time represents the processing time of the database server responding to the service request;
acquiring network transmission time of the application server, wherein the network transmission time represents transmission duration of the application server for receiving the service request and returning a response request;
acquiring a first processing quantity of the application server, wherein the first processing quantity represents the quantity of services being processed by the application server at the same time;
obtaining average processing time according to the first processing time, the second processing time and the network transmission time;
obtaining throughput according to the quotient of the first processing quantity and the average processing time;
and when the throughput and the performance index both meet the target resource requirement, determining that the application server is a target server, and executing the service request through the target server.
The throughput of the application server, namely the number of service requests which can be executed by the application server in one processing period, is calculated through the first processing time, the second processing time, the network transmission time and the first processing number, so that whether the application server meets the target resource requirement or not is judged through the throughput of the application server, and the condition that the service request response is overtime due to insufficient processing capacity of the allocated application server is reduced.
In a second aspect, an embodiment of the present invention provides a service request distribution system, including:
the server testing module is used for sending a heartbeat packet carrying a testing task to the application server when the service request is obtained;
the parameter acquisition module is used for acquiring a first reference parameter of the application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs;
the parameter obtaining module is further configured to obtain a second reference parameter of the application server, where the second reference parameter represents an available data processing capability of the application server in the case of executing the test task;
the performance calculation module is used for determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server;
and the service allocation module is used for determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the service request allocating method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the service request distribution method according to the first aspect is implemented.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a system architecture diagram of a service processing system for executing a service request distribution method according to an embodiment of the present invention;
fig. 2 is a flowchart of a service request distribution method provided in an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a specific implementation process of step S400 in FIG. 2;
FIG. 4 is a schematic diagram of a specific implementation process after step S500 in FIG. 2;
FIG. 5 is a schematic diagram of a specific implementation process of step S620 in FIG. 4;
FIG. 6 is a schematic diagram of a specific implementation process of step S622 in FIG. 5;
fig. 7 is a schematic diagram of a specific implementation process of step S500 in fig. 2;
FIG. 8 is a schematic diagram of a specific implementation process of step S500 in FIG. 2;
fig. 9 is a schematic structural diagram of a service request distribution system provided in an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that although functional block partitions are illustrated in block diagrams and logical sequences are illustrated in flowcharts, in some cases, steps shown or described may be performed in a different block partition or sequence in flowcharts. The terms first, second and the like in the description and in the claims, as well as in the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
As a main carrier for satisfying the user's usage requirements, the application generally needs to be supported by a remote server in response to improve the service efficiency and the service scope. When the data in different servers are called, because the database interfaces in different servers are different, the data between the two servers need to be conducted by using a third-party interface, so that the risk of data skew caused by direct interconnection of the databases of different servers can be prevented, the load of the servers can be reduced, the capacity expansion of the databases of the servers can be realized, new services can be expanded, and the use stability of server resources can be improved.
With the continuous development of internet technology, users have more and more strict requirements on applications, and the applications are required to process a large amount of data in a short time, while in the related art, under the condition of high concurrency, the processing is performed by adopting a message queue distribution and suspension mode, but the pressure of a server can only be relieved. When the current third-party interface faces a large amount of data, uneven distribution is easy to occur, so that a large amount of service data is distributed to the same server for processing, the server is blocked, the condition of response timeout occurs, and the use experience of a user is influenced.
The embodiment of the invention can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The invention relates to artificial intelligence, and provides a service request distribution method, when a service request is obtained, a heartbeat packet carrying a test task is sent to an application server; acquiring a first reference parameter of an application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs; acquiring a second reference parameter of the application server, wherein the second reference parameter represents available data processing capacity of the application server under the condition of executing the test task; determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server; and determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server. According to the embodiment provided by the invention, under the condition of receiving the service request, the heartbeat packet with the test function is sent, the reference parameter of the application server is obtained in real time, the performance index is obtained by dynamic calculation according to the received reference parameter, and the target resource requirement is determined through the service request, so that the service request is distributed to the target server of which the performance index meets the target resource requirement.
For convenience of understanding, an application scenario of the network slice self-optimization method provided in the embodiment of the present invention is described below with reference to the accompanying drawings.
Fig. 1 shows a service processing system 100 for executing a service request distribution method, the service processing system 100 comprising: the control center 110, the client 120 and the application server 130, the client 120 sends a service request to the control center 110 when receiving a command of a user, the control center 110 distributes the service request to the application server 130, and the service request of the user is executed through the application server 130. In order to uniformly distribute service requests and avoid the occurrence of a blocking situation of the application server 130, the control center 110 sends a heartbeat packet with a test function to the application server 130 when receiving a service request of a user, so that data of a test task can be returned to the control center 110 by the application server 130 to obtain a real-time reference parameter of the application server 130. The control center 110 can obtain the performance index of the application server 130 in real time by calculating a plurality of reference parameters of the application server 130. The control center 110 can obtain a corresponding target resource requirement through the service request, and when the performance index of the application server 130 meets the target resource requirement, it can be considered that the current application server 130 meets the response condition of the service request, so that the control center 110 allocates the service request to the corresponding application server 130, and the application server 130 executes the service request, thereby avoiding that the service request is allocated to a server which cannot execute the service request, which results in that the service request response is overtime, and the user experience is affected.
It should be noted that there may be a plurality of application servers 130, and the plurality of application servers 130 form a server cluster. When a portion of the application servers 130 cannot meet the target resource requirement of the service request, the control center 110 may select the remaining application servers 130 that can meet the target resource requirement to execute the service request. In addition, in the process of executing the service request by the application server 130, when the application server 130 is blocked, which may cause response timeout, the control center 110 may redistribute the service request to the remaining application servers 130, so as to avoid the service request response timeout.
The service processing system 100 for executing the service request allocation method described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not form a limitation on the technical solution provided in the embodiment of the present invention, and as the service processing system 100 evolves and a new application scenario appears, the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems.
Those skilled in the art will appreciate that the configuration of business processing system 100 shown in FIG. 1 is not intended to limit embodiments of the present invention and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
Based on the structure of the service processing system 100, various embodiments of the service request allocation method of the present invention are proposed.
In a first aspect, referring to fig. 2, fig. 2 shows a flowchart of a service request allocation method provided in an embodiment of the present invention, where the service request allocation method includes, but is not limited to, the following steps:
step S100, when a service request is obtained, sending a heartbeat packet carrying a test task to an application server;
step S200, acquiring a first reference parameter of the application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs;
step S300, acquiring a second reference parameter of the application server, wherein the second reference parameter represents available data processing capacity of the application server under the condition of executing the test task;
step S400, determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server;
step S500, determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server.
It will be appreciated that the service request from the user is received by sending a heartbeat packet with the test task to the application server. After receiving the heartbeat packet with the test task, the application server executes the test task and returns the reference parameters of the application server in each state to the control center, wherein the reference parameters in each state comprise the data processing capacity of the application server under the condition that the application server does not run the task and the data processing capacity of the application server during the test task execution, and for example, before the application server is started, the data processing capacity of a central processing unit of the application server is obtained by interruption and is used as a first reference parameter. For another example, in the running process of the application server, the data processing capability of the central processing unit of the application server in the idle task state is acquired as the second reference parameter. Therefore, the control center can obtain the real-time first reference parameter and the real-time second reference parameter of the application server to realize dynamic calculation of the performance index of the application server, and the real-time resource occupancy rate of the application server is obtained. The resource occupancy rate can reflect the current data processing capacity of the application server, so that the control center can judge whether the current application server can complete the execution of the service request within the specified time and return the service request by dynamically calculating the performance index of the application server. The control center can obtain the target resource requirement required by the execution of the service request through the service request, and when the unoccupied resource of the application server is greater than or equal to the target resource requirement, the performance index of the application server can be considered to meet the target resource requirement, and the application server can execute the corresponding service request within the specified time and return the corresponding service request. Therefore, the control center determines the application server as a target server, and distributes the service request to the target server, and the service request is executed through the target server. When the resource occupancy rate of the application server cannot meet the execution condition required by the execution of the service request, it can be considered that the condition of response timeout occurs when the application server executes the corresponding service request, so that the control center can allocate the service request to the application server of which the performance index meets the target resource requirement. Therefore, the service request method provided by the embodiment of the invention can realize automatic allocation of the service request to the application server according to the performance index of the application server, reduce the processing pressure of the server, improve the processing efficiency of the service request, avoid the condition of response overtime caused by busy application server, and improve the use experience of users.
Referring to fig. 3, step S400 in the embodiment shown in fig. 2 includes, but is not limited to, the following steps:
step S410, obtaining a third reference parameter according to the difference between the first reference parameter and the second reference parameter;
step S420, obtaining the performance index of the application server according to the quotient of the third reference parameter and the first reference parameter.
It can be understood that a third reference parameter is obtained by a difference between the first reference parameter and the second reference parameter, and the third reference parameter represents the data processing capacity occupied by the application server under the condition that the application server currently executes the service task. And obtaining the performance index of the application server, namely the resource occupancy rate of the application server, through the quotient of the third reference parameter and the first reference parameter. The second reference parameter may be obtained periodically when the service request is received, for example, the second reference parameter is obtained every second, so that the performance index of the application server can be calculated dynamically in real time according to the real-time reference parameter of the application server. Because the application server needs to process a large number of service requests in a short time, the performance index of the application server is dynamically calculated by combining the real-time data processing capacity of the application server under different conditions, the real-time performance index of the application server is obtained, the accuracy and the reliability of data are improved, the service requests are conveniently distributed, and the condition of response overtime is reduced.
Referring to fig. 4, step S500 in the embodiment shown in fig. 2 includes, but is not limited to, the following steps:
step S610, acquiring response information of the target server according to a preset reference time length;
step S620, when the response information contains a blocking signal, determining an execution server from the remaining application servers, and executing the service request through the execution server, wherein the blocking signal indicates that the target server cannot respond to the service request within a preset response time.
It is understood that after the service request is distributed to the target server, in order to avoid the blocking of the target server and the response timeout, whether the target server is blocked or not can be judged by acquiring the response information of the target server. Therefore, after the service request is distributed to the target server, the processing time length is calculated, when the processing time length reaches the preset reference time length, the response information is obtained from the target server, and whether the response information contains the blocking signal or not is judged. When the response information contains a blocking signal, it can be considered that the target server has a blocking condition, and the service request cannot be returned within the preset response time, so the control center can determine an execution server with a performance index meeting the target resource requirement from the remaining application servers, reallocate the service request to the execution server, and execute the service request by the execution server. In addition, the preset reference duration may be the same as the time interval for acquiring the reference parameter of the application server, that is, the control center acquires the response information while acquiring the first reference parameter and the second reference parameter of the application server, so that the number of operations of the application server can be reduced, and the processing efficiency of the application server can be improved. Therefore, the target server can respond to the service request within the preset response time through timing judgment, and the service request is redistributed under the condition that the target server cannot respond, so that the condition that the service request is overtime and invalid is avoided, and the use experience of a user is improved.
Referring to fig. 5, step S620 in the embodiment shown in fig. 4 includes, but is not limited to, the following steps:
step S621, when the response message contains a blocking signal, determining the remaining application servers with the performance indexes meeting the target resource requirements as alternative servers;
step S622, when at least one candidate server exists, determining an execution server from the candidate servers according to the performance index, and executing the service request through the execution server.
It can be understood that, when the response information obtained from the target server contains the blocking signal, the target server may be considered as unable to respond to the service request within the preset response time, and therefore, the control center needs to reselect the execution server from the remaining application servers, and the execution server re-executes the service request. In order to avoid response timeout, the control center needs to select the server with the best performance index to execute the service request. And the control center selects the application servers with the performance indexes meeting the target resource requirements from the rest application servers, and determines the part of application servers as alternative servers, namely the alternative servers can execute the service request within the preset response time and return the service request. Therefore, when at least one alternative server exists, namely, at least one application server exists in the remaining application servers, the performance index of the application server meets the target resource requirement, the application server with the optimal performance index is determined from the alternative servers as an execution server according to the performance index, and the execution server executes the service request again. When only one alternative server exists, the control center takes the alternative server as an execution server. When two or more alternative servers exist, the application server with the optimal performance index can be selected from the alternative servers as the execution server, and the condition that the service request response is overtime is avoided.
Referring to fig. 6, step S622 in the embodiment shown in fig. 5 includes, but is not limited to, the following steps:
step S623, when at least one alternative server exists, sequencing all the alternative servers from high to low according to the performance index to obtain alternative sequencing information;
step S624, according to the alternative sorting information, determining an execution server from the alternative servers, migrating the service request from the target server to the execution server, and executing the service request through the execution server.
It will be appreciated that when there is only one alternative server, the control center will have that alternative server as the executive server. When two or more alternative servers exist, the performance indexes of the alternative servers are sorted from high to low, and the alternative servers are sorted from high to low according to the performance indexes, so that alternative sorting information of the alternative servers is obtained. The higher the ranking, the stronger the data processing capacity of the alternative server at present, the service request can be responded quickly, and the occurrence of overtime response is reduced. Therefore, through the candidate sorting information, the candidate server with high ranking can be selected as the execution server, the service request of the target server is migrated to the execution server, and the execution server executes the service request, so that the processing efficiency of the service request is improved.
Referring to fig. 7, step S500 in the embodiment shown in fig. 2 includes, but is not limited to, the following steps:
step S510, when the performance indexes meet the target resource requirement, sequencing the application servers from high to low according to the performance indexes to obtain target sequencing information;
step S520, according to the target sorting information, determining a target server from the plurality of application servers, and executing the service request through the target server.
It can be understood that, when receiving a service request, the control center may send a heartbeat packet with a test task to the multiple application processors at the same time, and obtain the reference parameters of each application server at the same time, and calculate the performance index of each application server in real time. When the performance indexes corresponding to the plurality of application servers all meet the target resource requirement, the application servers with the performance indexes meeting the target resource requirement can be sorted from high to low according to the performance indexes to obtain target sorting information. The higher the ranking is, the higher the performance index corresponding to the application server is, that is, the lower the resource occupancy rate is, the stronger the current data processing capability of the application server is. Therefore, according to the target sorting information, the application server with high ranking is selected from the plurality of application servers as the target server, the service request is distributed to the target server, the target server executes the service request, the situation that the application service cannot process the service request due to insufficient data processing capacity and response timeout occurs is reduced, and the processing efficiency of the service request is improved.
Referring to fig. 8, step S500 in the embodiment shown in fig. 2 includes, but is not limited to, the following steps:
step S530, acquiring first processing time of the application server, wherein the first processing time represents processing time for the application server to execute the service request;
step S540, acquiring second processing time of the database server, wherein the second processing time represents the processing time of the database server responding to the service request;
step S550, acquiring network transmission time of the application server, wherein the network transmission time represents transmission time for the application server to receive the service request and return a response request;
step S560, acquiring a first processing quantity of the application server, wherein the first processing quantity represents the quantity of services being processed by the application server at the same time;
step S570, obtaining an average processing time according to the first processing time, the second processing time, and the network transmission time;
step S580, obtaining throughput according to the quotient of the first processing amount and the average processing time;
step S590, when both the throughput and the performance index meet the target resource requirement, determining that the application server is the target server, and executing the service request through the target server.
It is understood that, in case of receiving the service request, in addition to acquiring the first reference parameter and the second reference parameter of the application server, the control center may acquire the first processing time, the network transmission time, and the first processing amount of the application server, and the second processing time of the database server. The first processing time represents the processing time of the application server for executing the service request, the second processing time represents the processing time of the database server for responding to the service request, the network transmission time represents the transmission time of the application server for receiving the service request and returning the response request, and the first processing amount represents the amount of the services being processed by the application server at the same time. And calculating the average processing time, namely the average consumed time of the application server for processing a service request, according to the first processing time, the second processing time and the network transmission time. The throughput of the application server, i.e. the number of completed service requests processed by the application server in a fixed time, is obtained by the quotient of the first processing time and the average processing time. When both the throughput and the performance index meet the target resource requirement, the application server can be considered to meet the execution condition of the service request, the application server is determined as the target server, and the service request is executed through the target server. Therefore, whether the application server has the capacity of processing the service request or not is judged through the double thresholds of the throughput and the performance index, the processing efficiency of the service request is improved, and the use experience of a user is improved.
In a second aspect, referring to fig. 9, fig. 9 illustrates a structural schematic diagram of a service request distribution system 900 provided by an embodiment of the present invention.
The server testing module 910 is configured to send a heartbeat packet carrying a testing task to the application server when the service request is obtained;
a parameter obtaining module 920, configured to obtain a first reference parameter of the application server, where the first reference parameter represents a data processing capability of the application server when no task runs;
the parameter obtaining module 920 is further configured to obtain a second reference parameter of the application server, where the second reference parameter represents an available data processing capability of the application server in the case of executing the test task;
a performance calculating module 930, configured to determine a performance index of the application server according to the first reference parameter and the second reference parameter, where the performance index represents a resource occupancy rate of the application server;
and a service allocation module 940, configured to determine a target resource requirement according to the service request, determine that the application server is the target server when the performance index meets the target resource requirement, and execute the service request through the target server.
The performance calculating module 930 is further configured to obtain a third reference parameter according to a difference between the first reference parameter and the second reference parameter; and obtaining the performance index of the application server according to the quotient of the third reference parameter and the first reference parameter.
In addition, the service request distribution system 900 further includes a response detection module 950; the response detection module 950 is configured to obtain response information of the target server according to a preset reference time length. In the case where the response message includes the blocking signal, the response detection module 950 determines an execution server from the remaining application servers, and executes the service request through the execution server.
The traffic assignment module 940 includes an alternative assignment module 941. The alternative allocating module 941 is configured to determine, when the response information includes a blocking signal, a remaining application server whose performance index meets a target resource requirement as an alternative server. The alternative allocating module 941 is further configured to determine an execution server from the alternative servers according to the performance index when at least one alternative server exists, and execute the service request through the execution server.
The alternative allocating module 941 includes an alternative sorting module 942, and the alternative sorting module 942 is configured to, when at least one alternative server exists, sort the alternative servers from high to low according to the performance index to obtain alternative sorting information. In addition, the alternative sorting module 942 is further configured to determine an execution server from the alternative servers according to the alternative sorting information, migrate the service request from the target server to the execution server, and execute the service request through the execution server.
The service allocation module 940 further includes a server sorting module 943, where the server sorting module 943 is configured to, when the multiple performance indicators meet the target resource requirement, sort the application servers from high to low according to the performance indicators to obtain target sorting information. In addition, the server ranking module 943 is further configured to determine a target server from the plurality of application servers according to the target ranking information, and execute the service request through the target server.
The parameter obtaining module 920 is further configured to obtain a first processing time of the application server, a second processing time of the database server, a network transmission time of the application server, and a first processing number of the application server. The first processing time represents the processing time of the application server for executing the service request, the second processing time represents the processing time of the database server for responding to the service request, the network transmission time represents the transmission time of the application server for receiving the service request and returning the response request, and the first processing quantity represents the quantity of the services being processed by the application server at the same moment.
The performance calculating module 930 is further configured to obtain an average processing time according to the first processing time, the second processing time, and the network transmission time; moreover, the performance calculating module 930 is further configured to obtain throughput according to a quotient of the first processing amount and the average processing time, determine that the application server is a target server when both the throughput and the performance index meet the target resource requirement, and execute the service request through the target server.
In a third aspect, referring to fig. 10, fig. 10 illustrates an electronic device 1000 according to an embodiment of the present invention. The electronic device 1000 includes a memory 1010, a processor 1020, and a computer program stored on the memory 1010 and executable on the processor 1020, wherein the processor 1020 implements the service request allocation method in the above embodiment when executing the computer program.
The memory 1010 is used as a non-transitory computer readable storage medium for storing non-transitory software programs and non-transitory computer executable programs, such as the service request distribution method in the above embodiment of the present invention. The processor 1020 implements the service request allocation method in the above-described embodiment of the present invention by executing the non-transitory software program and instructions stored in the memory 1010.
The memory 1010 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data and the like required to perform the service request allocation method in the above-described embodiment. Further, the memory 1010 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. It is noted that the memory 1010 may alternatively comprise memory located remotely from the processor 1020, and that such remote memory may be coupled to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the service request allocation method in the above-described embodiments are stored in a memory, and when executed by one or more processors, perform the service request allocation method in the above-described embodiments, for example, perform method steps S100 to S500 in fig. 2, method steps S410 to S420 in fig. 3, method steps S610 to S620 in fig. 4, method steps S621 to S622 in fig. 5, method steps S623 to S624 in fig. 6, method steps S510 to S520 in fig. 7, and method steps S530 to S590 in fig. 8, which are described above.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores computer-executable instructions for causing a computer to execute the service request allocating method in the above-described embodiment, for example, to execute the above-described method steps S100 to S500 in fig. 2, method steps S410 to S420 in fig. 3, method steps S610 to S620 in fig. 4, method steps S621 to S622 in fig. 5, method steps S623 to S624 in fig. 6, method steps S510 to S520 in fig. 7, and method steps S530 to S590 in fig. 8.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
It should be noted that the server may be an independent server, or may be a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, Content Delivery Network (CDN), big data, and an artificial intelligence platform.
It is noted that all or some of the steps of the above-disclosed methods may be used in many general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (10)

1. A method for service request distribution, the method comprising:
when a service request is obtained, sending a heartbeat packet carrying a test task to an application server;
acquiring a first reference parameter of the application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs;
acquiring a second reference parameter of the application server, wherein the second reference parameter represents available data processing capacity of the application server under the condition of executing the test task;
determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server;
and determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server.
2. The method according to claim 1, wherein the determining the performance index of the application server according to the first reference parameter and the second reference parameter comprises:
obtaining a third reference parameter according to the difference between the first reference parameter and the second reference parameter;
and obtaining the performance index of the application server according to the quotient of the third reference parameter and the first reference parameter.
3. The method according to claim 1, wherein a plurality of application servers are provided, and the performance indicators are in one-to-one correspondence with the application servers;
the determining a target resource requirement according to the service request, determining that the application server is a target server when the performance index meets the target resource requirement, and executing the service request through the target server, includes:
acquiring response information of the target server according to a preset reference time length;
and when the response information contains a blocking signal, determining an execution server from the rest application servers, and executing the service request through the execution server, wherein the blocking signal indicates that the target server cannot respond to the service request within preset response time.
4. The method according to claim 3, wherein when the response message contains a blocking signal, determining an execution server from the remaining application servers, and executing the service request through the execution server, comprises:
when the response information contains the blocking signal, determining the rest application servers of which the performance indexes meet the target resource requirement as alternative servers;
and when at least one alternative server exists, determining an execution server from the alternative servers according to the performance index, and executing the service request through the execution server.
5. The method according to claim 4, wherein when at least one of the candidate servers exists, determining an execution server from the candidate servers according to the performance index, and executing the service request through the execution server, comprises:
when at least one alternative server exists, sequencing all the alternative servers from high to low according to the performance index to obtain alternative sequencing information;
and determining an execution server from the alternative servers according to the alternative sequencing information, transferring the service request from the target server to the execution server, and executing the service request through the execution server.
6. The method according to claim 1, wherein a plurality of application servers are provided, and the application servers are in one-to-one correspondence with the performance indicators;
when the performance index meets the target resource requirement, determining that the application server is a target server, and executing the service request through the target server includes:
when a plurality of performance indexes meet the target resource requirement, sequencing the application servers from high to low according to the performance indexes to obtain target sequencing information;
and determining a target server from the plurality of application servers according to the target sequencing information, and executing the service request through the target server.
7. The method according to claim 1, wherein when the performance indicator satisfies the target resource requirement, determining that the application server is a target server, and executing the service request through the target server comprises:
acquiring first processing time of the application server, wherein the first processing time represents processing time for the application server to execute the service request;
acquiring second processing time of a database server, wherein the second processing time represents the processing time of the database server responding to the service request;
acquiring network transmission time of the application server, wherein the network transmission time represents transmission duration of the application server for receiving the service request and returning a response request;
acquiring a first processing quantity of the application server, wherein the first processing quantity represents the quantity of services being processed by the application server at the same time;
obtaining average processing time according to the first processing time, the second processing time and the network transmission time;
obtaining throughput according to the quotient of the first processing quantity and the average processing time;
and when the throughput and the performance index both meet the target resource requirement, determining the application server as a target server, and executing the service request through the target server.
8. A service request distribution system, comprising:
the server testing module is used for sending a heartbeat packet carrying a testing task to the application server when the service request is obtained;
the parameter acquisition module is used for acquiring a first reference parameter of the application server, wherein the first reference parameter represents the data processing capacity of the application server under the condition that no task runs;
the parameter obtaining module is further configured to obtain a second reference parameter of the application server, where the second reference parameter represents an available data processing capability of the application server in the case of executing the test task;
the performance calculation module is used for determining a performance index of the application server according to the first reference parameter and the second reference parameter, wherein the performance index represents the resource occupancy rate of the application server;
and the service allocation module is used for determining a target resource requirement according to the service request, determining the application server as a target server when the performance index meets the target resource requirement, and executing the service request through the target server.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the service request allocation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a service request distribution method according to any one of claims 1 to 7.
CN202210438693.7A 2022-04-25 2022-04-25 Service request distribution method, system, equipment and storage medium Active CN114760361B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210438693.7A CN114760361B (en) 2022-04-25 2022-04-25 Service request distribution method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210438693.7A CN114760361B (en) 2022-04-25 2022-04-25 Service request distribution method, system, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114760361A true CN114760361A (en) 2022-07-15
CN114760361B CN114760361B (en) 2023-09-15

Family

ID=82332953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210438693.7A Active CN114760361B (en) 2022-04-25 2022-04-25 Service request distribution method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114760361B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050102398A1 (en) * 2003-11-12 2005-05-12 Alex Zhang System and method for allocating server resources
CN109246229A (en) * 2018-09-28 2019-01-18 网宿科技股份有限公司 A kind of method and apparatus of distribution resource acquisition request
CN109729131A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of processing method of application request, device and router
CN110399213A (en) * 2019-05-21 2019-11-01 腾讯科技(深圳)有限公司 Determine method, apparatus, electronic equipment and the medium of the resource requirement of application program
CN111800501A (en) * 2020-06-30 2020-10-20 平安普惠企业管理有限公司 Method and device for processing service request, storage medium and electronic equipment
CN113157418A (en) * 2021-04-25 2021-07-23 腾讯科技(深圳)有限公司 Server resource allocation method and device, storage medium and electronic equipment
CN113765964A (en) * 2020-08-10 2021-12-07 北京沃东天骏信息技术有限公司 Method and device for distributing services of distributed system
CN113791961A (en) * 2021-09-18 2021-12-14 中国平安人寿保险股份有限公司 Data acquisition method, device and equipment based on microservice and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050102398A1 (en) * 2003-11-12 2005-05-12 Alex Zhang System and method for allocating server resources
CN109729131A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of processing method of application request, device and router
CN109246229A (en) * 2018-09-28 2019-01-18 网宿科技股份有限公司 A kind of method and apparatus of distribution resource acquisition request
CN110399213A (en) * 2019-05-21 2019-11-01 腾讯科技(深圳)有限公司 Determine method, apparatus, electronic equipment and the medium of the resource requirement of application program
CN111800501A (en) * 2020-06-30 2020-10-20 平安普惠企业管理有限公司 Method and device for processing service request, storage medium and electronic equipment
CN113765964A (en) * 2020-08-10 2021-12-07 北京沃东天骏信息技术有限公司 Method and device for distributing services of distributed system
CN113157418A (en) * 2021-04-25 2021-07-23 腾讯科技(深圳)有限公司 Server resource allocation method and device, storage medium and electronic equipment
CN113791961A (en) * 2021-09-18 2021-12-14 中国平安人寿保险股份有限公司 Data acquisition method, device and equipment based on microservice and storage medium

Also Published As

Publication number Publication date
CN114760361B (en) 2023-09-15

Similar Documents

Publication Publication Date Title
US11429449B2 (en) Method for fast scheduling for balanced resource allocation in distributed and collaborative container platform environment
CN108205541B (en) Method and device for scheduling distributed web crawler tasks
CN109246229A (en) A kind of method and apparatus of distribution resource acquisition request
CN112269641B (en) Scheduling method, scheduling device, electronic equipment and storage medium
CN108196788B (en) QoS index monitoring method, device and storage medium
CN109412874B (en) Equipment resource configuration method, device, server and storage medium
CN107453929B (en) Cluster system self-construction method and device and cluster system
US20020129127A1 (en) Apparatus and method for routing a transaction to a partitioned server
CN101577927A (en) Load measuring method, evolution base station and load measuring system
CN107302580B (en) Load balancing method and device, load balancer and storage medium
CN104994156A (en) Load balancing method and system for cluster
CN110442610A (en) The method, apparatus of load balancing calculates equipment and medium
KR102260547B1 (en) Scheduling method for selecting the optimal cluster within the cluster of distributed collaboration type
CN108881379B (en) Method and device for data synchronization between server clusters
CN102480502B (en) I/O load equilibrium method and I/O server
CN114389955B (en) Method for managing heterogeneous resource pool of embedded platform
CN108694083B (en) Data processing method and device for server
CN114760361B (en) Service request distribution method, system, equipment and storage medium
CN115378962B (en) High-availability communication method and system for storage cluster based on iSCSI protocol
CN111522664A (en) Service resource management and control method and device based on distributed service
CN112822062A (en) Management method for desktop cloud service platform
CN113596146B (en) Resource scheduling method and device based on big data
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN111459651B (en) Load balancing method, device, storage medium and scheduling system
CN114489978A (en) Resource scheduling method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant