A service request method and device, a server and a storage medium
Patent Information
- Application Number
- CN202611209409.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]固定超时机制无法适应银行系统在不同时段、不同业务量下的动态变化需求,特别是在业务高峰期容易出现大量超时误判,导致业务请求失败率上升
[0017] Fifthly, this application provides a computer program product including computer instructions that, when executed on a computer, cause the computer to perform the business request method as provided in the first aspect.
Smart Images

Figure CN122933754A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a business request method, apparatus, server and storage medium. Background Technology
[0002] Existing banking systems generally use synchronous call mode to process business requests, but when interfacing with the People's Bank of China system, asynchronous message reception and processing are usually adopted.
[0003] To address the difference between asynchronous and synchronous approaches, traditional solutions primarily rely on a pre-defined fixed timeout mechanism. After initiating a synchronous request, a fixed waiting time is set, and if no response is received within that time, it is considered a timeout.
[0004] Fixed timeout mechanisms cannot adapt to the dynamic changes in the banking system's needs at different times and with different business volumes. In particular, during peak business periods, a large number of timeout errors are likely to occur, leading to an increase in the failure rate of business requests. Summary of the Invention
[0005] This invention provides a service request method, apparatus, server, and storage medium, which realizes timeout judgment for service requests based on accurately predicted service response time, and reduces the service request failure rate by extending the timeout period.
[0006] In a first aspect, embodiments of the present invention provide a service request method, including: The server sends a business request to the business system through the central server. The predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The timeout time corresponding to the service request is determined based on the predicted response time. If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
[0007] The technical solution of this invention provides a service request method, comprising: a server sending a service request to a service system through a central server; determining a predicted response time for the service request based on the server's status information, the request type of the service request, and the average response time of the service system to all service requests sent by the server through the central server; determining a timeout time corresponding to the service request based on the predicted response time; and extending the timeout time until the service response is received if no service response corresponding to the service request is received within the timeout time after the service request is sent. The above technical solution involves the server sending a business request to the business system through the central server. Based on the server's status information, the request type, and the average response time of the business system to all business requests sent by the server, the response time of the business request is predicted. This allows for accurate prediction of the business request's response time. A reasonable timeout is then set for the business request based on the predicted response time, reducing incorrect timeout judgments and thus decreasing the number of business requests that need to be resent to the business system, thereby improving processing efficiency. If no business response is received within the timeout period after sending the business request, extending the timeout further reduces the number of business requests that need to be resent to the business system, further improving processing efficiency.
[0008] Further, the predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server, including: The status information, the request type, and the average response time are input into the response time prediction model so that the response time prediction model determines the predicted response time of the business request based on the status information, the request type, and the average response time. The model parameters of the response time prediction model are sent from the central server to the server.
[0009] Furthermore, the process by which the central server determines the model parameters of the response time prediction model includes: Determine the access volume of each server under the central server to the business system through the central server, and determine the parameter weight of each server based on the access volume of each server; The local model parameters of the corresponding local prediction model of each server are weighted and summed based on the parameter weights of each server to determine the model parameters of the response time prediction model.
[0010] Furthermore, the training process of the local prediction model corresponding to the server includes: Obtain historical status information when the server sends historical service requests, the request type of each historical service request, and the average response time of the service system to all service requests sent by the server through the central server; The acquired data is divided into a training set and a validation set. A random forest regression model is constructed based on the training set, and the hyperparameters of the random forest regression are optimized based on the validation set to obtain the local prediction model.
[0011] Further, determining the timeout time corresponding to the service request based on the predicted response time includes: The sum of the predicted response time and the pre-set buffer time is determined as the timeout period.
[0012] Furthermore, the status information includes processor utilization and network latency. Accordingly, before determining the sum of the predicted response time and the preset buffer time as the timeout time, the following steps are also included: When it is determined that the processor utilization of the server has decreased, the buffer time is shortened; When the network latency of the server is determined to increase, the buffer time is extended.
[0013] Furthermore, after extending the timeout period, it also includes: If no service response is received within the extended timeout period after the service request is sent, the service request is resent to the service system through the central server. The extended timeout period is determined based on a preset extension rule.
[0014] Secondly, embodiments of the present invention also provide a service request apparatus, the apparatus comprising: The sending module is used by the server to send business requests to the business system through the central server, and to determine the predicted response time of the business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The determination module is used to determine the timeout time corresponding to the service request based on the predicted response time; An execution module is configured to extend the timeout period until the service response is received if no service response corresponding to the service request is received within the timeout period after the service request has been sent.
[0015] Thirdly, embodiments of the present invention also provide a server, the server comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform a service request method as described in any of the first aspects.
[0016] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, characterized in that the computer-executable instructions, when executed by a computer processor, are used to perform the business request method as described in any of the first aspects.
[0017] Fifthly, this application provides a computer program product including computer instructions that, when executed on a computer, cause the computer to perform the business request method as provided in the first aspect.
[0018] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on a computer-readable storage medium. This computer-readable storage medium may be packaged together with the processor of the service requesting device, or it may be packaged separately from the processor of the service requesting device; this application does not impose any limitations on this.
[0019] The descriptions of the second, third, fourth, and fifth aspects in this application can be referred to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second, third, fourth, and fifth aspects can be referred to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0020] In this application, the name of the aforementioned service request device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this application, it falls within the scope of the claims of this application and its equivalents.
[0021] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart of a business request method provided in an embodiment of the present invention; Figure 2 A flowchart of another business request method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a service request device provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Detailed Implementation
[0024] The present invention will now be described in further detail 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 not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0025] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0026] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0027] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0028] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc. Moreover, embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0029] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0030] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0031] Figure 1 This is a flowchart of a service request method provided in an embodiment of the present invention. This embodiment is applicable to situations where it is necessary to reduce the service request failure rate. The method can be executed by a service request device, such as... Figure 1 As shown, the specific steps include the following: Step 110: The server sends a business request to the business system through the central server. Based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server, the predicted response time of the business request is determined.
[0032] The business system can be an external system, and the server status information can include processor utilization, network latency, and concurrent requests. The processor utilization range is 0-100%, the network latency range is 0-500ms, and the concurrent requests range is 0-10000.
[0033] To ensure that the server can receive the business system's response to the business request, a reasonable timeout needs to be set for the business request. The timeout can be determined based on the predicted response time of the business request.
[0034] Specifically, after the server sends a business request to the business system through the central server, the server's status information can be determined. Specifically, this includes obtaining the server's processor utilization, network latency, and concurrent request count. The request type can also be determined; for example, if the business request is a tax payment request, the request type can be understood as the tax payment type. The average response time of the business system to all business requests sent by the server can also be determined. Specifically, this involves obtaining the server's business log data and determining the average response time based on the response time in each business log entry. Then, based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server, the predicted response time of the business request can be determined. Specifically, the status information, request type, and average response time can be input into a pre-trained response time prediction model, which can then output the predicted response time of the business request.
[0035] In this embodiment of the invention, after the server sends a business request to the business system through the central server, it predicts the response time of the business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server. This enables the accurate prediction of the business request's response time and provides a basis for setting an appropriate timeout for the business request.
[0036] Step 120: Determine the timeout time corresponding to the service request based on the predicted response time.
[0037] Specifically, after determining the predicted response time of a business request, a reasonable timeout can be set for the business request based on the predicted response time. To ensure the server receives the business response, the timeout should not be less than the predicted response time; for example, the predicted response time can be increased by 2 seconds as the timeout period.
[0038] In this embodiment of the invention, a reasonable timeout time is set for a business request based on the predicted response time of the business request, thereby reducing the number of business requests that need to be resent to the business system and improving the processing efficiency of business requests.
[0039] Step 130: If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
[0040] Specifically, if no business response corresponding to the business request is received within the timeout period after the business request is sent, the timeout period can be appropriately extended in order to ensure that the business response is received smoothly.
[0041] In practical applications, after extending the timeout period, if the server still does not receive a business response within the extended timeout period, the business request can be resent to the business system.
[0042] In this embodiment of the invention, if no business response corresponding to the business request is received within the timeout period after the business request is sent, the number of business requests that need to be resent to the business system is further reduced by extending the timeout period, thereby improving the processing efficiency of business requests.
[0043] The service request method provided in this embodiment of the invention includes: a server sending a service request to a service system through a central server; determining a predicted response time for the service request based on the server's status information, the request type of the service request, and the average response time of the service system to all service requests sent by the server through the central server; determining a timeout time corresponding to the service request based on the predicted response time; and extending the timeout time until the service response is received if no service response corresponding to the service request is received within the timeout time after the service request is sent. The above technical solution involves the server sending a business request to the business system through the central server. Based on the server's status information, the request type, and the average response time of the business system to all business requests sent by the server, the response time of the business request is predicted. This allows for accurate prediction of the business request's response time. A reasonable timeout is then set for the business request based on the predicted response time, reducing incorrect timeout judgments and thus decreasing the number of business requests that need to be resent to the business system, thereby improving processing efficiency. If no business response is received within the timeout period after sending the business request, extending the timeout further reduces the number of business requests that need to be resent to the business system, further improving processing efficiency.
[0044] Figure 2 This is a flowchart of another business request method provided by an embodiment of the present invention. This embodiment is a specific modification based on the above embodiments. Figure 2 As shown, in this embodiment, the method may further include: Step 210: The server sends a business request to the business system through the central server.
[0045] Among them, the central server can be the bank's main server, the server can be the local server of each branch of the bank, and the business system can be an external system. For example, when the current business is tax payment, the business system can be the Bank of China system, and the business request can be a tax payment request.
[0046] Specifically, the server can send business requests to the business system through the central server. The server is a bank server, and the business requests are sent from the server to the business system through the central server. The central server can forward the business requests sent by the server to the business system.
[0047] In this embodiment of the invention, the server sends a business request to the business system through the central server, and the business can be processed once the server receives the business response corresponding to the business request.
[0048] Step 220: Determine the predicted response time of the business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server.
[0049] When the business request is a tax payment request, the request type of the tax payment request can be understood as the type of tax payment, which can be normal tax declaration and payment, prepayment of tax, withholding / collection and payment on behalf of others, tax payment due to tax audit, tax refund-type reverse transactions, real estate / land stock transactions, vehicle-specific transactions, social security contributions, non-tax payments, etc.
[0050] In one implementation, step 220 may specifically include: The status information, the request type, and the average response time are input into the response time prediction model so that the response time prediction model determines the predicted response time of the business request based on the status information, the request type, and the average response time. The model parameters of the response time prediction model are sent from the central server to the server.
[0051] The number of accesses from the server to the business system through the central server can be understood as the amount of data in the business requests sent by the server to the business system through the central server.
[0052] Specifically, after the server sends a business request to the business system through the central server, the server's status information can be determined. Specifically, this includes obtaining the server's processor utilization, network latency, and concurrent request count. The request type can also be determined; for example, if the business request is a tax payment request, the request type can be understood as the tax payment type, such as normal tax declaration and payment, prepayment of taxes, withholding / collection on behalf of others, tax audit and payment, tax refund reverse transactions, real estate / land stock transactions, vehicle-specific transactions, social security contributions, or non-tax payments. The average response time of the business system to all business requests sent by the server can also be determined. Specifically, this involves obtaining the server's tax detail query transaction data and determining the average response time based on the response time of each tax detail query transaction. Then, the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server can be input into a pre-trained response time prediction model. The response time prediction model can then output the predicted response time of the business request.
[0053] The response time prediction model is used to accurately predict the response time of a business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server.
[0054] Furthermore, the process by which the central server determines the model parameters of the response time prediction model includes: The access volume of each server under the central server to the business system through the central server is determined, and the parameter weight of each server is determined according to the access volume of each server; the local model parameters of the local prediction model corresponding to each server are weighted and summed based on the parameter weight of each server to determine the model parameters of the response time prediction model.
[0055] Furthermore, the training process of the local prediction model corresponding to the server includes: The system obtains historical state information when the server sends historical business requests, the request type of each historical business request, and the average response time of the business system to all business requests sent by the server through the central server. The obtained data is divided into a training set and a validation set. A random forest regression model is constructed based on the training set, and the hyperparameters of the random forest regression are optimized based on the validation set to obtain the local prediction model.
[0056] For each server, a local prediction model can be trained based on its historical data. This local prediction model determines the time it takes for the server to respond to a business request. Historical data can include the server's historical state information when it sent historical business requests, the request type of each historical request, and the average response time of the business system to all business requests sent by the server through the central server. The process involves acquiring the server's historical state information when it sent historical business requests, the request type of each historical request, and the average response time of the business system to all business requests sent by the server through the central server. The acquired data is divided into a training set and a validation set. A random forest regression model is constructed based on the training set, and hyperparameter optimization is performed on the random forest regression model based on the validation set to obtain the local prediction model.
[0057] Of course, after each server determines its local prediction model, it can encrypt and upload the model parameters of its local prediction model to the central server via HTTPS protocol to ensure the security of the model parameters during transmission. Furthermore, model parameters can be uploaded at preset intervals, with a preset amount of data uploaded each time, and transmitted to the central server after security authentication. To further ensure the security of the model parameters, even if the model parameters are maliciously attacked, and the attacker cannot accurately reconstruct the original data from the model parameters, noise can be added to the model parameters, and the noise intensity can be dynamically adjusted according to the data sensitivity. For example, Gaussian noise can be added to the model parameters. When the model parameters are [0.1, 0.2, 0.3], adding noise with a standard deviation of 0.05 will result in noisy model parameters [0.12, 0.18, 0.35].
[0058] The central server can determine the access volume of each server to the business system through the central server, that is, the amount of data of business requests sent by the server to the business system through the central server. Based on the access volume of each server, the parameter weight of each server is determined. Specifically, the total access volume can be determined based on the access volume of each server, and then the ratio of the access volume of each server to the total access volume can be determined as the parameter weight of each server.
[0059] After determining the parameter weights of each server, the local model parameters of the corresponding local prediction model of each server can be weighted and summed based on the parameter weights of each server to determine the model parameters of the response time prediction model.
[0060] After the central server determines the model parameters of the response time prediction model, it can distribute the model parameters of the response time prediction model to all servers, so that the response time prediction model can simultaneously reflect the business characteristics of different regions.
[0061] The central server and its subordinate servers can adopt a distributed federated learning architecture. Each server is responsible for storing and processing local real raw data and training local prediction models through local computing power, ensuring that the raw data does not leave the local environment. The central server is responsible for model initialization, parameter aggregation, and determination and distribution of model parameters for the response time prediction model. It does not access the raw data of each server. By adding appropriate noise to the model parameters of the corresponding local prediction models on each server, it prevents the original data from being deduced from the model parameters of the local prediction models. This ensures both the accuracy and generalization ability of model training and strictly protects data security, achieving the privacy protection goal of data being usable but invisible.
[0062] In this embodiment of the invention, the response time prediction model predicts the response time of a business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. This enables the accurate prediction of the response time of the business request and provides a basis for setting an appropriate timeout for the business request.
[0063] Step 230: The sum of the predicted response time and the pre-set buffer time is determined as the timeout time corresponding to the business request.
[0064] Specifically, after determining the predicted response time of a business request, a reasonable timeout can be set for the business request based on the predicted response time. In other words, to ensure the server receives the business response to the business request, the timeout must not be less than the predicted response time. Therefore, the timeout can be determined based on the predicted response time and a pre-set buffer time; that is, the sum of the predicted response time and the buffer time can be used as the timeout.
[0065] In practical applications, the buffer time can be any time greater than zero. The value of the buffer time can be set according to actual needs, and no specific limitation is made here.
[0066] In one implementation, the status information includes processor utilization and network latency. Accordingly, when it is determined that the processor utilization of the server decreases, the buffer time is shortened; when it is determined that the network latency of the server increases, the buffer time is extended.
[0067] Specifically, during server operation, status information can be monitored in real time. When it is determined that the server's processor utilization is decreasing, it indicates that the server's efficiency in processing business requests is improving. At this time, the buffering time can be shortened, thereby shortening the timeout time. When it is determined that the server's network latency is increasing, the time required to send business requests is increasing. Therefore, the buffering time can be extended, thereby extending the timeout time.
[0068] By using a dynamic timeout mechanism that dynamically determines the timeout based on the predicted response time and buffer time, the server can flexibly adjust the timeout based on real-time business load and network conditions. The timeout can adapt to the dynamic changes in server requirements at different times and with different business volumes, effectively preventing normal business requests from being misjudged as timeouts due to server overload, and fundamentally solving the state hanging problem.
[0069] Furthermore, by extending the buffer time when the server is overloaded and shortening the buffer time when the server is idle, extending the buffer time when network latency increases and shortening the buffer time when network latency decreases, and combining the timeout time with the accurate predicted response time, we ensure that the timeout time setting is neither too conservative, which would degrade the user experience, nor too aggressive, which would affect the success rate of business requests.
[0070] In this embodiment of the invention, a reasonable timeout time is set for a business request based on the predicted response time. The timeout time setting has a high degree of adaptability and business scenario adaptability. By setting differentiated timeout times for business requests, the transformation from passive response to proactive prediction is realized, reducing the timeout error judgment of business requests, thereby reducing the number of business requests that need to be resent to the business system and improving the processing efficiency of business requests.
[0071] Step 240: If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
[0072] Specifically, if a business response corresponding to the business request is received within the timeout period after the business request is sent, the business request is considered successful. If no business response corresponding to the business request is received within the timeout period after the business request is sent, the timeout period can be appropriately extended in order to ensure that the business response is received smoothly.
[0073] In practical applications, the timeout period can be extended based on a preset extension rule. The preset extension rule can be 2 seconds, and the specific extension time can be set according to actual needs. No specific limit is set here.
[0074] In this embodiment of the invention, if no business response corresponding to the business request is received within the timeout period after the business request is sent, the number of business requests that need to be resent to the business system is further reduced by extending the timeout period, thereby improving the processing efficiency of business requests. Furthermore, by reducing unnecessary timeout waiting and retries, the business processing flow is optimized, while avoiding server response delays caused by frequent retries, providing a smoother and more reliable business service experience.
[0075] Step 250: If no service response is received within the extended timeout period after the service request is sent, the service request is resent to the service system through the central server.
[0076] Specifically, if a business response corresponding to the business request is received within the extended timeout period after the business request is sent, the business request is considered successful. If no business response corresponding to the business request is received within the extended timeout period after the business request is sent, the business request is resent to the business system in order to receive the business response smoothly, so that the business system can respond to the business request again.
[0077] In this embodiment of the invention, if no business response corresponding to the business request is received within the extended timeout period after the business request is sent, the business request is resent to the business system through the central server. This further ensures the success of the business request, improves the success rate of the business request, and effectively guarantees data consistency, providing more stable and reliable service support. Ultimately, this achieves multiple benefits, including enhanced business continuity, reduced operating costs, and optimized service quality.
[0078] The service request method provided in this embodiment of the invention includes: a server sending a service request to a service system through a central server; determining a predicted response time for the service request based on the server's status information, the request type of the service request, and the average response time of the service system to all service requests sent by the server through the central server; determining the sum of the predicted response time and a pre-set buffer time as the timeout time corresponding to the service request; extending the timeout time until the service response is received if no service response is received within the timeout time after sending the service request; and resending the service request to the service system through the central server if no service response is received within the extended timeout time after sending the service request. The above technical solution involves a response time prediction model that, after the server sends a business request to the business system through a central server, predicts the response time of the business request based on the server's status information, the request type, and the average response time of the business system to all business requests sent by the server through the central server. This allows for the accurate prediction of the business request's response time. The predicted response time and a pre-set buffer time are then combined to determine the corresponding timeout for the business request. This enables the setting of a reasonable timeout for the business request based on its predicted response time. The timeout setting is highly adaptive and adaptable to various business scenarios. By setting differentiated timeouts for business requests, a shift from passive response to proactive prediction is achieved, reducing incorrect timeout judgments and thus reducing the number of business requests that need to be resent to the business system, thereby improving business efficiency. To improve processing efficiency, if no response is received within the timeout period after a business request is sent, the timeout period is extended to further reduce the number of business requests that need to be resent to the business system, thus improving processing efficiency. By reducing unnecessary timeouts and retries, the business processing flow is optimized, and server response delays caused by frequent retries are avoided, providing a smoother and more reliable business service experience. If no response is received within the extended timeout period after a business request is sent, the business request is resent to the business system through the central server to further ensure successful requests, improve the success rate, and effectively guarantee data consistency, providing more stable and reliable service support. Ultimately, this achieves multiple benefits, including enhanced business continuity, reduced operating costs, and optimized service quality. Intelligent adjustment of the timeout period avoids server overload or resource idleness, establishing a dynamic resource allocation mechanism to ensure reasonable load handling during peak business periods and full utilization of server resources during off-peak periods, ultimately achieving stable improvement in overall server performance and effective control of operating costs.
[0079] Figure 3 This is a schematic diagram of a service request device provided in an embodiment of the present invention. This device is applicable to situations requiring a reduction in service request failure rate and an improvement in service request success rate. The device can be implemented through software and / or hardware and is generally integrated into a server.
[0080] like Figure 3 As shown, the device includes: The sending module 310 is used for the server to send a business request to the business system through the central server, and to determine the predicted response time of the business request based on the status information of the server, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The determining module 320 is used to determine the timeout time corresponding to the service request based on the predicted response time; The execution module 330 is configured to extend the timeout period until the service response is received when no service response corresponding to the service request is received within the timeout period after the service request is sent.
[0081] The service request device provided in this embodiment involves a server sending a service request to a service system through a central server. The predicted response time of the service request is determined based on the server's status information, the request type of the service request, and the average response time of the service system to all service requests sent by the server through the central server. A timeout period corresponding to the service request is determined based on the predicted response time. If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received. The above technical solution involves the server sending a business request to the business system through the central server. Based on the server's status information, the request type, and the average response time of the business system to all business requests sent by the server, the response time of the business request is predicted. This allows for accurate prediction of the business request's response time. A reasonable timeout is then set for the business request based on the predicted response time, reducing incorrect timeout judgments and thus decreasing the number of business requests that need to be resent to the business system, thereby improving processing efficiency. If no business response is received within the timeout period after sending the business request, extending the timeout further reduces the number of business requests that need to be resent to the business system, further improving processing efficiency.
[0082] Based on the above embodiments, the sending module 310 is specifically used for: After the server sends a business request to the business system through the central server, it inputs the status information, the request type, and the average response time into the response time prediction model, so that the response time prediction model determines the predicted response time of the business request based on the status information, the request type, and the average response time. The model parameters of the response time prediction model are sent from the central server to the server.
[0083] In one implementation, the process by which the central server determines the model parameters of the response time prediction model includes: The access volume of each server under the central server to the business system through the central server is determined, and the parameter weight of each server is determined according to the access volume of each server; the local model parameters of the local prediction model corresponding to each server are weighted and summed based on the parameter weight of each server to determine the model parameters of the response time prediction model.
[0084] Furthermore, the training process of the local prediction model corresponding to the server includes: The system obtains historical state information when the server sends historical business requests, the request type of each historical business request, and the average response time of the business system to all business requests sent by the server through the central server. The obtained data is divided into a training set and a validation set. A random forest regression model is constructed based on the training set, and the hyperparameters of the random forest regression are optimized based on the validation set to obtain the local prediction model.
[0085] Based on the above embodiments, module 320 is specifically used for: The sum of the predicted response time and the pre-set buffer time is determined as the timeout period.
[0086] Based on the above embodiments, the status information includes processor utilization and network latency. Accordingly, before determining the predicted response time and the preset buffer time as the timeout time, the determining module 320 is further configured to: When it is determined that the processor utilization of the server is decreasing, the buffer time is shortened; when it is determined that the network latency of the server is increasing, the buffer time is extended.
[0087] Based on the above embodiments, the device further includes: The retransmission module is used to resend the service request to the service system through the central server if no service response is received within the extended timeout period after the service request has been sent, after the timeout period has been extended. The extended timeout period is determined based on a preset extension rule.
[0088] The service request apparatus provided in this embodiment of the invention can execute the service request method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the service request method.
[0089] It is worth noting that in the embodiments of the above-mentioned service request device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0090] Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Figure 4 A block diagram of an exemplary server 4 suitable for implementing embodiments of the present invention is shown. Figure 4 The server 4 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0091] like Figure 4 As shown, server 4 is represented in the form of a general-purpose computing electronic device. The components of server 4 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0092] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0093] Server 4 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by Server 4, including volatile and non-volatile media, and removable and non-removable media.
[0094] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Server 4 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 As not shown, disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0095] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0096] Server 4 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable users to interact with server 4, and / or with any device that enables server 4 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, server 4 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 4 As shown, network adapter 20 communicates with other modules of server 4 via bus 18. It should be understood that, although... Figure 4 As not shown in the diagram, it can be combined with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0097] Processing unit 16 executes various functional applications and page displays by running programs stored in system memory 28, such as implementing the business request method provided in this embodiment of the invention, which includes: The server sends a business request to the business system through the central server. The predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The timeout time corresponding to the service request is determined based on the predicted response time. If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
[0098] Of course, those skilled in the art will understand that the processor can also implement the technical solutions of the service request method provided in any embodiment of the present invention.
[0099] This invention provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements, for example, the service request method provided in this invention, which includes: The server sends a business request to the business system through the central server. The predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The timeout time corresponding to the service request is determined based on the predicted response time. If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
[0100] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0101] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0102] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0103] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0104] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0105] Furthermore, the acquisition, storage, use, and processing of data in the technical solution of this invention all comply with relevant laws and regulations.
[0106] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A business request method, characterized in that, include: The server sends a business request to the business system through the central server. The predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The timeout time corresponding to the service request is determined based on the predicted response time. If no service response corresponding to the service request is received within the timeout period after the service request is sent, the timeout period is extended until the service response is received.
2. The service request method according to claim 1, characterized in that, The predicted response time of the business request is determined based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server, including: The status information, the request type, and the average response time are input into the response time prediction model so that the response time prediction model determines the predicted response time of the business request based on the status information, the request type, and the average response time. The model parameters of the response time prediction model are sent from the central server to the server.
3. The service request method according to claim 2, characterized in that, The process by which the central server determines the model parameters of the response time prediction model includes: Determine the access volume of each server under the central server to the business system through the central server, and determine the parameter weight of each server based on the access volume of each server; The local model parameters of the corresponding local prediction model of each server are weighted and summed based on the parameter weights of each server to determine the model parameters of the response time prediction model.
4. The service request method according to claim 3, characterized in that, The training process for the local prediction model corresponding to the server includes: Obtain historical status information when the server sends historical service requests, the request type of each historical service request, and the average response time of the service system to all service requests sent by the server through the central server; The acquired data is divided into a training set and a validation set. A random forest regression model is constructed based on the training set, and the hyperparameters of the random forest regression are optimized based on the validation set to obtain the local prediction model.
5. The service request method according to claim 5, characterized in that, Determining the timeout time corresponding to the service request based on the predicted response time includes: The sum of the predicted response time and the pre-set buffer time is determined as the timeout period.
6. The service request method according to claim 1, characterized in that, The status information includes processor utilization and network latency. Accordingly, before determining the sum of the predicted response time and the preset buffer time as the timeout time, the following steps are also included: When it is determined that the processor utilization of the server has decreased, the buffer time is shortened; When the network latency of the server is determined to increase, the buffer time is extended.
7. The service request method according to claim 1, characterized in that, After extending the timeout period, it also includes: If no service response is received within the extended timeout period after the service request is sent, the service request is resent to the service system through the central server. The extended timeout period is determined based on a preset extension rule.
8. A service request device, characterized in that, The device includes: The sending module is used by the server to send business requests to the business system through the central server, and to determine the predicted response time of the business request based on the server's status information, the request type of the business request, and the average response time of the business system to all business requests sent by the server through the central server. The determination module is used to determine the timeout time corresponding to the service request based on the predicted response time; An execution module is configured to extend the timeout period until the service response is received if no service response corresponding to the service request is received within the timeout period after the service request has been sent.
9. A server, characterized in that, The server includes: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the service request method as described in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the service request method as described in any one of claims 1-7.