Request processing method and system, electronic equipment, storage medium and program product
By determining the remaining time before the timeout in the distributed system and sending the call request before the timeout, the problem of increased burden on subsequent calls caused by slow application processing is solved, and the request processing efficiency is improved.
Patent Information
- Application Number
- CN202410371452.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-09-30
AI Technical Summary
In a distributed system, although application processing slows down, it still returns normal results, which increases the burden on subsequent calls and reduces request processing efficiency.
When an application request is received, the remaining time before the timeout is determined, and a call request is sent to the next application before the timeout to avoid redundant calls.
By sensing the remaining timeout time across the entire link, redundant calls can be avoided and request processing efficiency can be improved.
Smart Images

Figure CN120729950A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a request processing method, system, electronic device, storage medium, and program product. Background Art
[0002] In a distributed system, user requests are processed by calling applications layer by layer, generating responses and returning them to the user. For example, after a user request is forwarded to application A, application A calls application B based on the user request to complete a certain operation. Then, based on the user request and / or the operation results returned by application B, application A calls application C to complete another operation. This continues, until application A generates a response based on the operation results returned by application B, application C, and so on, and returns it to the user. Therefore, from the perspective of a distributed system, the processing of user requests forms a call chain, and the time consumed by a distributed system for a single request is the call time of the entire call chain.
[0003] Currently, distributed systems detect timeouts based on the timeout period set in user requests. When the timing reaches the timeout period due to slow processing of an application on the call link, a timeout notification is returned to the user.
[0004] However, in actual usage scenarios, although the application processing slows down, it still returns normal operation results. Therefore, the application that receives the user request will make subsequent calls on the call chain after receiving the operation results of the slowed application. However, this subsequent call is actually a redundant call, which not only increases the processing burden on the subsequent calling application, but also reduces the request processing efficiency. Summary of the Invention
[0005] The purpose of this application is to propose a request processing method, system, electronic device, storage medium and program product to address the deficiencies of the above-mentioned existing technologies, and this purpose is achieved through the following technical solutions.
[0006] A first aspect of the present application provides a request processing method, the method comprising:
[0007] Receive an application request; the remaining time after timeout is the remaining time before the application request times out;
[0008] Determining, for a call of any application in an application call chain corresponding to the application request, a current remaining timeout of the application request; the application call chain is the sequence of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time until the application request times out;
[0009] If it is determined based on the remaining timeout period that the processing of the application request has not timed out, a call request is sent to any application.
[0010] A second aspect of the present application provides a request processing system, the system comprising a user terminal and a distributed system, the distributed system comprising multiple applications, each application being configured to provide a different service:
[0011] The user terminal is used to send a service request to the distributed system;
[0012] The distributed system is used to forward the service request to the target application called by the service request, and the target application determines the current remaining timeout of the service request for calling any application in the application call chain corresponding to the service request, and sends a call request to the any application if it is determined based on the remaining timeout that the processing of the service request has not timed out; wherein the application call chain is the order of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time before the application request times out.
[0013] The third aspect of the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect above.
[0014] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method described in the first aspect above.
[0015] An embodiment of the fifth aspect of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the method described in the first aspect above.
[0016] Based on the request processing method described in the first aspect above, this application has at least the following beneficial effects or advantages:
[0017] Upon receiving an application request, the system determines the remaining timeout for any application in the corresponding application call chain. Based on this remaining timeout, the system determines in advance whether the application request has timed out. Only if it determines it has not timed out will the system send the call request to any application. This allows the system to fully perceive the remaining timeout for any application in the application call chain. Only if it has not timed out will the system initiate a call to the next application. Otherwise, the system will not initiate a call to the next application. This avoids the added processing burden of executing redundant calls after a timeout, thereby improving request processing efficiency.
[0018] The above description is only an overview of the technical solution of this application. In order to more clearly understand the technical means of this application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of this application more obvious and easy to understand, the specific implementation methods of this application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 FIG1 is a schematic diagram showing a processing of a user request according to an exemplary embodiment;
[0021] Figure 2 A schematic diagram of an application call scenario requested by a user in the prior art;
[0022] Figure 3 is a flow chart of an embodiment of a request processing method according to an exemplary embodiment;
[0023] Figure 4 FIG4 is a schematic diagram of a request processing for returning a normal response according to an exemplary embodiment;
[0024] Figure 5 This is a schematic diagram showing a request processing method for returning an error notification according to an exemplary embodiment;
[0025] Figure 6 The figure is a schematic diagram of request processing of a multi-layer call according to an exemplary embodiment;
[0026] Figure 7 1 is a schematic diagram showing a request processing for predicting timeout according to an exemplary embodiment;
[0027] Figure 8 1 is a schematic structural diagram of a request processing device according to an exemplary embodiment;
[0028] Figure 9 FIG1 is a schematic diagram showing a hardware structure of an electronic device according to an exemplary embodiment;
[0029] Figure 10 The figure is a schematic structural diagram of a storage medium according to an exemplary embodiment. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of systems and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0031] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0032] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0033] As mentioned above, a user's call actually results in multiple calls in the distributed system, such as Figure 1 As shown in the figure, when a user calls the interface of application A, the distributed system first forwards the request to application A. Since application A depends on applications B, C, and D, and application C depends on application E, application A will call the interface of application B to complete a certain operation. Then application A will call the interface of application C to complete a certain operation. Application C must call application E to complete the operation. Finally, application A calls application D and obtains the final processing result, which is returned to the user.
[0034] From this perspective, from the perspective of application A, the call chain formed by application A completing request processing is application B-application C-application D, while from the perspective of the distributed system, the call chain formed by completing request processing is application A-application B-application C-application E-application D. Therefore, the call chain can be understood as the order of application calls that need to be completed to process the received request.
[0035] From the above Figure 1 It can be seen that the time it takes for a distributed system to perceive a request is the time it takes to complete the calls to the five applications: Application A, Application B, Application C, Application E, and Application D.
[0036] The timeout perception principle of distributed systems is as follows Figure 2 As shown in the figure, when a user calls Application A, they set a timeout of 800 milliseconds in the request. Upon receiving the user's request, the distributed system begins detecting timeouts based on this timeout. Application A takes 20 milliseconds to complete its call to Application B. When Application A calls Application C, Application C in turn calls Application E. When Application E slows down, Application C takes 1000 milliseconds to complete its call to Application E. Adding to the time consumed by Application C itself, Application A takes 1020 milliseconds to complete its call to Application C. While Application A is completing its call to Application C, the distributed system detects the 800 millisecond timeout and returns a timeout notification to the user. After Application C returns a normal result to Application A, Application A continues to call Application D and returns the result to the user, even though the result returned by Application A is no longer important to the user. This shows that Application A's call to Application D is redundant.
[0037] In order to solve the above technical problems, this application proposes a request processing method. For any application in a distributed system, when an application request is received, the current timeout remaining time of the application request will be determined for any application call in the application call link corresponding to the application request, and based on the determined timeout remaining time, it will be judged in advance whether the processing of the application request has timed out. Only when it is determined that it has not timed out will a call request be sent to any application. In this way, any application call on the application call link can fully perceive the current timeout remaining time of the application request, and will continue to initiate a call to the next application only if it has not timed out. Otherwise, it will not continue to initiate a call to the next application, avoiding the increase of processing burden by continuing to execute redundant calls after timeout, thereby improving the request processing efficiency.
[0038] The following describes in detail the technical solution of this application and how it solves the aforementioned technical problems using specific embodiments. The several specific embodiments listed can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The following describes the embodiments of this application in detail with reference to the accompanying drawings.
[0039] Example 1
[0040] Figure 3 FIG. 1 is a flow chart of an embodiment of a request processing method according to an exemplary embodiment. This embodiment uses any application in a distributed system as an execution subject to illustrate the request processing method. Figure 3 As shown, the process includes the following steps 301 to 306:
[0041] Step 301: Receive an application request.
[0042] Step 302: For any application call in the application call chain corresponding to the application request, determine the current remaining timeout of the application request; wherein the application call chain is the order of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time before the application request times out.
[0043] Step 303: If it is determined based on the determined remaining timeout period that the processing of the application request has not timed out, a call request is sent to the any application.
[0044] In the embodiments of the present application, the received application request can be understood as a call sent by an upper-layer application or a call sent by a user terminal. Furthermore, a call request sent to any application can be understood as a call sent to a lower-layer application. Therefore, the "application request" and "call request" involved in the embodiments of the present application both refer to calls to an application, and the two descriptions are used only to distinguish between received calls and sent calls.
[0045] The application call link represents the application call sequence that needs to be completed to process the application request. Figure 1 As shown, taking application A receiving an application request as an example, in application A, the application call link corresponding to the application request is application B→application C→application D; taking application C receiving an application request as an example, in application C, the application call link corresponding to the application request is application E.
[0046] The remaining time before the application request times out is the time remaining. This time is determined for each application request during the corresponding application call chain. This means that the remaining time before the application request times out changes dynamically along the application call chain.
[0047] Any application refers to the application that needs to be called currently. If the processing of the application request is determined not to have timed out based on the determined remaining timeout, it means that the call of subsequent applications in the application call chain can still be completed, so a call request can be sent to any application.
[0048] For example, in Figure 1In the application A shown, application A receives an application request, and the application call link is application B → application C → application D. First, application A determines the current remaining timeout of the application request for the call to application B, and based on the determined remaining timeout, determines that the processing of the application request has not timed out, and sends a call request to application B; then, application A determines the current remaining timeout of the application request for the call to application C, and based on the determined remaining timeout, determines that the processing of the application request has not timed out, and sends a call request to application C; finally, application A determines the current remaining timeout of the application request for the call to application D, and based on the determined remaining timeout, determines that the processing of the application request has not timed out, and sends a call request to application D, thereby completing the processing of the application request.
[0049] At this point, the above is completed Figure 3 The request processing flow shown in the figure shows that for any application in a distributed system, upon receiving an application request, the system will determine the current remaining timeout for any application in the application call chain corresponding to that application request. Based on this remaining timeout, the system will determine in advance whether the application request has timed out. Only if it is determined that it has not timed out will the system send a call request to any application. This allows the entire chain to perceive the current remaining timeout for any application in the application call chain. If it has not timed out, the system will not initiate a call to the next application. This avoids the added processing burden of executing redundant calls after a timeout, thereby improving request processing efficiency.
[0050] In some embodiments of the present application, the process of determining the current remaining timeout of the application request in the above step 302 includes: when any application is the first application in the application call chain, using the time transfer field in the application request to determine the current remaining timeout of the application request; when any application is not the first application in the application call chain, obtaining the call consumption generated when calling the previous application of any application, using the call consumption to adjust the remaining timeout determined when calling the previous application, and using the adjusted remaining timeout as the current remaining timeout of the application request.
[0051] The time transfer field indicates the field for transferring the remaining time of the timeout when the sender of the application request sends the application request, and can be understood as a field added by the sender of the application request in the application request.
[0052] The previous application of any application can be understood as the application that is located before any application in the application call link, that is, the application that completed the call last time.
[0053] The call duration is the time it takes for an application to initiate a call and receive a response.
[0054] Obtain the call duration incurred when calling the previous application of any application by obtaining the send time of the call request sent to the previous application and the receive time of the response returned by the previous application, and then use the difference between the receive time and the send time as the call duration of the previous application. The response is the response to the call request.
[0055] In this embodiment, when any application is the first application in the application call link, it means that the call to the application on the application call link has not yet been initiated. Therefore, the current timeout remaining time is determined by using the time transfer field in the application request. When any application is not the first application in the application call link, it means that the call to the application before any application in the application call link has been completed. Therefore, the timeout remaining time determined when calling the previous application is adjusted by using the call time of the previous application of any application to obtain the current timeout remaining time, so that the current timeout remaining time can be perceived by the entire link for any application call on the application call link.
[0056] Optionally, the call duration is used to adjust the remaining timeout determined when calling the previous application, specifically by subtracting the call duration from the remaining timeout determined when calling the previous application to obtain the adjusted remaining timeout.
[0057] That is to say, each time an application call in the application call link is completed, the call duration of this application call will be used to deduct the remaining timeout time, thereby achieving full-link awareness of the current remaining timeout time.
[0058] For example, Figure 4As shown, taking application A receiving an application request as an example, the application call chain corresponding to the application request is application B → application C → application D. Therefore, application A completes the processing of the application request according to this application call chain. For the call of application B in the application call chain, application A uses the time transfer field in the application request to determine the timeout remaining time _system_timetolive = 800 milliseconds. When application A completes the call of application B, the obtained call time of application B is 20 milliseconds; for the call of application C in the application call chain, application A subtracts the call time of application B 20 milliseconds from the timeout remaining time _system_timetolive to determine the current timeout remaining time _ system_timetolive = 780 milliseconds. When application A completes the call to application C, the obtained call time of application C is 110 milliseconds. For the call to application D in the application call link, application A subtracts the call time of application C (110 milliseconds) from the timeout remaining time _system_timetolive, and determines that the current timeout remaining time _system_timetolive = 670 milliseconds. When application A completes the call to application D, the obtained call time of application D is 50 milliseconds. The timeout remaining time _system_timetolive is subtracted by 50 milliseconds, and _system_timetolive = 620 milliseconds.
[0059] Taking application C receiving an application request as an example, the application call link corresponding to the application request is application E. Therefore, application C uses the time transfer field in the application request to determine the remaining timeout _system_timetolive = 780 milliseconds for the call to application E. After application C completes the call to application E, the call time of application E is obtained to be 90 milliseconds. The remaining timeout _system_timetolive is subtracted by 90 milliseconds, and _system_timetolive = 690 milliseconds.
[0060] In an optional embodiment, the time transfer field in the application request is used to determine the current remaining timeout of the application request, specifically including: when the application request carries the time transfer field, using the field value corresponding to the time transfer field in the application request as the current remaining timeout of the application request; when the application request does not carry the time transfer field, obtaining the timeout setting time for the application request, and using the obtained timeout setting time as the current remaining timeout of the application request.
[0061] In this embodiment, the time transfer field is used to indicate the remaining time of the timeout passed by the sender when sending the application request. Therefore, when the application request is received, the field value of the time transfer field in the application request can be directly used as the current remaining time of the timeout of the application request.
[0062] In specific implementations, distributed link tracing technology can be employed. Distributed link tracing generates a unique identifier for a user request upon entering a distributed system. This identifier, as an extended field, permeates each application call involved in the request, facilitating the tracing of the request's path and status between applications. Therefore, relying on distributed link tracing, a time-passing field can be added to application requests as an extended field to communicate the remaining timeout to the calling application.
[0063] For example, in an HTTP (Hypertext Transfer Protocol) request, a time-to-live field is added to the request header using a key-value structure, with the key being the key and the value being the value. For example, if the time-to-live field is defined as _system_timetolive, then _system_timetolive is the key and the number indicating the remaining timeout is the value.
[0064] Furthermore, in order to solve the problem that the sender does not pass the time transfer field, if the application request does not carry the time transfer field, the timeout setting time for the application request is obtained, and the obtained timeout setting time is used as the remaining timeout time to play a fault tolerance role.
[0065] In a distributed system, each call between applications has a configured timeout. Therefore, the timeout setting is the maximum waiting time set by the sender of the application request. In other words, the maximum waiting time the sender of the application request will wait for the application request. For example, if application A calls application B, and the call from application A to application B exceeds the pre-configured timeout, application A will no longer wait for application B to return a response. Therefore, the timeout setting represents the maximum waiting time for a call between the two applications, while the remaining timeout is the remaining timeout for the user terminal.
[0066] With the above Figure 1 For example, when application C receives an application request from application A, if the application request carries a time transfer field, the corresponding field value is 800 milliseconds - 20 milliseconds = 780 milliseconds. In this case, the remaining timeout determined by application C is 780 milliseconds. Assume that the timeout setting time configured by application A calling application C is 100 milliseconds. If the application request received by application C does not carry the time transfer field, the remaining timeout determined by application C is 100 milliseconds.
[0067] In some embodiments of the present application, the process of sending a call request to any application in the above step 303 specifically includes: sending a call request containing the current timeout remaining time requested by the application to any application, so that the current timeout remaining time is passed downward each time the call is made, so as to achieve timeout awareness of the entire link.
[0068] For example, Figure 4 As shown, taking application A as an example, the application call link corresponding to the application request is application B → application C → application D. Then the call request sent by application A to application B contains a timeout remaining time _system_timetolive = 800 milliseconds, the call request sent by application A to application C contains a timeout remaining time _system_timetolive = 780 milliseconds, and the call request sent by application A to application D contains a timeout remaining time _system_timetolive = 670 milliseconds.
[0069] In specific implementation, a time transfer field can be added to the call request in the form of an extended field to pass the current remaining time of the timeout to the application to be called, such as adding a time transfer field in a key-value structure, with the time transfer field as the key and the remaining time of the timeout as the field value.
[0070] In some embodiments of the present application, with respect to the process of determining whether the processing of the application request has not timed out based on the current remaining timeout in step 303, if the remaining timeout is greater than 0, then it is determined that the processing of the application request has not timed out. Further, if the remaining timeout is less than or equal to 0, then it is determined that the processing of the application request has timed out.
[0071] In one example, Figure 4As shown, taking application A receiving an application request as an example, application A determines that the current remaining timeout of the application request, _system_timetolive, is 800 milliseconds, which is greater than 0. Application A sends a call request to application B. After application A completes the call to application B, it determines that the current remaining timeout of the application request, _system_timetolive, is 800 milliseconds - 20 milliseconds = 780 milliseconds. Since _system_timetolive = 780 milliseconds > 0, application A continues to call application C. After application A completes the call to application C, it determines that the current remaining timeout of the application request, _system_timetolive, is 780 milliseconds - 110 milliseconds = 670 milliseconds. Since _system_timetolive = 670 milliseconds > 0, application A continues to call application D. After application A completes the call to application D, it determines that the current remaining timeout of the application request, _system_timetolive, is 670 milliseconds - 50 milliseconds = 620 milliseconds. Since _system_timetolive = 620 milliseconds > 0, application A returns a normal response to the user.
[0072] In another example, Figure 5 As shown, application A determines that the current remaining timeout of the application request _system_timetolive = 800 milliseconds > 0, and application A sends a call request to application B. After application A completes the call to application B, it determines that the current remaining timeout of the application request _system_timetolive = 800 milliseconds - 20 milliseconds = 780 milliseconds. Since _system_timetolive = 780 milliseconds > 0, application A continues to call application C. After application A completes the call to application C, it determines that the current remaining timeout of the application request _system_timetolive = 780 milliseconds - 1020 milliseconds = -240 milliseconds. Since _system_timetolive = -240 milliseconds < 0, application A cancels the call to application D and returns an error notification to the user.
[0073] In other embodiments of the present application, the above-mentioned request processing method also includes: when it is determined that the processing of the application request has timed out based on the current remaining timeout time, returning an error notification to the sender of the application request, and ending the call to the application in the application call link, thereby ending subsequent redundant calls in advance and further improving the request processing efficiency.
[0074] The error notification is used to notify when a timeout error occurs.
[0075] Since the calls and result returns between applications in a distributed system are passed layer by layer, Figure 1For example, application E first returns the result to application C, and application C then returns the result to application A. Based on this, the sender of the application request may be the user terminal or the upper-layer application.
[0076] In other embodiments of the present application, after sending a call request to any application in the above step 303, upon receiving an error notification returned by any application, the error notification can be returned to the sender of the application request, and the call to the application in the application call link can be terminated.
[0077] As mentioned above, if an application returns an error notification, it means that the application has timed out after calling its lower-level application. Therefore, based on the error notification returned by the application, subsequent calls on the application call link can be terminated, and error notifications can continue to be returned to the sender of the application request, thereby realizing timeout determination of the entire link, terminating the call in advance, and saving unnecessary time.
[0078] For example, Figure 6 As shown, taking application A receiving an application request as an example, application A determines that the current remaining timeout of the application request, _system_timetolive = 800 milliseconds, is greater than 0. Application A sends a call request to application B. After application A completes the call to application B, it determines that the current remaining timeout of the application request, _system_timetolive = 800 milliseconds - 20 milliseconds = 780 milliseconds. Since _system_timetolive = 780 milliseconds is greater than 0, application A continues to call application C and passes _system_timetolive = 780 milliseconds to application C along with the call request. In application C, after application C completes the call to application E, the remaining timeout time _system_timetolive is deducted by 200 milliseconds. Since _system_timetolive = 580 milliseconds > 0, application C continues to call application F. After application C completes the call to application F, the remaining timeout time _system_timetolive is deducted by 600 milliseconds. Since _system_timetolive = -20 milliseconds < 0, application C cancels the call to application G and returns an error notification to the upper-level application A. Application A cancels the call to application D and returns an error notification to the user.
[0079] In other embodiments of the present application, with respect to the process of determining that the processing of the application request has not timed out based on the determined remaining timeout in step 303, it is also possible to obtain the historical average time consumption of any application and determine that the processing of the application request has not timed out if the historical average time consumption is less than the determined remaining timeout.
[0080] That is to say, each time before sending a call request to any application in the application call chain, the historical average time consumption of any application is used to predict whether the remaining time of the timeout is sufficient to complete the call. This can end calls that are likely to time out in advance, thereby reducing calls to slow-down applications, reducing the load on slow-down applications, and helping to recover slow-down applications.
[0081] In this embodiment, the historical average time consumption of any application is obtained based on the time consumption of each call to any application within the first preset time closest to the current system time. Therefore, it can represent the time consumption of the current call to any application, and the first preset time represents the statistical range of the historical average time consumption.
[0082] For example, Figure 7 As shown, in application A, the timeout remaining time _system_timetolive determined by application A is 800 milliseconds. Before calling application B, application A obtains the historical average time of application B, which is 20 milliseconds. Since the predicted timeout remaining time _system_timetolive = 800 milliseconds > 20 milliseconds, application A sends a call request to application B. After application A completes the call to application B, the determined timeout remaining time _system_timetolive = 800 milliseconds - 20 milliseconds = 780 milliseconds. Application A obtains the historical average time of application C, which is 1000 milliseconds. Since the predicted timeout remaining time _system_timetolive = 780 milliseconds < 1000 milliseconds, application A cancels the call to application C and application D in advance and returns an error notification to the user.
[0083] In other embodiments of the present application, after obtaining the historical average time of any application based on the time consumed for each call to any application within the first preset time closest to the current system time, timing is started. If a call request from any application is detected before the timing time reaches a second preset time, timing is restarted. If no call request from any application is detected after the timing time reaches the second preset time, the historical average time is deleted. Until it is needed, the historical average time is obtained based on the time consumed for each call to any application within the first preset time closest to the current system time. This ensures the timeliness of the historical average time.
[0084] The second preset time represents the time range of the historical average time effectiveness, and the second preset time is smaller than the first preset time. For example, the second preset time may be one third of the first preset time.
[0085] In other embodiments of the present application, since each call between applications in a distributed system is configured with a timeout setting, after obtaining the historical average time consumption of any application based on the time consumption of each call to the application within the first preset time closest to the current system time, the historical average time consumption can be compared with the timeout setting time configured for the application. If the historical average time consumption is greater than the timeout setting time, the call to the application can be stopped for a certain period of time. In this way, any call to the application is rejected for a period of time, which is conducive to the recovery of the application.
[0086] Example 2
[0087] Based on the above embodiments, the present application also provides an embodiment of a request processing system, which includes a user terminal and a distributed system. The distributed system includes multiple applications, each application is used to provide different services. The application can be regarded as a service module deployed in the distributed system, which can be an application, service, instance, software-based functional module, virtual machine (VM), container or cloud server, etc., or a hardware device with data processing function (such as a server or terminal device) or hardware chip (such as CPU, GPU, FPGA, NPU, AI accelerator card or DPU), etc.
[0088] Wherein, the user terminal is used to send a service request to the distributed system;
[0089] A distributed system is used to forward a received service request to a target application called by the service request, and the target application determines the current remaining timeout of the service request for the call of any application in the application call chain corresponding to the service request, and sends a call request to any application based on the remaining timeout when determining that the processing of the service request has not timed out, wherein the application call chain is the sequence of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time before the application request times out.
[0090] In the embodiment of the present application, the user terminal refers to a device on the user side, which needs to call a service in the distributed system according to actual usage needs, thereby triggering the call of the application corresponding to the service and generating a service request.
[0091] In some embodiments of the present application, since the user terminal will set the timeout setting time for this request in the service request, when the distributed system forwards the received service request to the target application called by the service request, it can add a time transfer field in the service request according to the timeout setting time in the service request, and then forward the service request with the added field to the target application, thereby passing the timeout setting time to the target application along with the service request.
[0092] In this embodiment, the timeout setting time is the maximum waiting time set by the user terminal in the service request. The time transfer field indicates the remaining time before the service request times out.
[0093] In specific implementations, distributed link tracing technology can be employed. Distributed link tracing generates a unique identifier for a user request upon entering a distributed system. This identifier, as an extended field, permeates each application call involved in the request, facilitating the tracing of the request's path and status between applications. Therefore, relying on distributed link tracing, a time-passing field can be added to the service request as an extended field to communicate the remaining timeout to the calling application.
[0094] For example, in an HTTP request, a time-to-live field is added to the request header using a key-value structure, where the key is the time-to-live field and the value is the value. For example, if the time-to-live field is defined as _system_timetolive, then _system_timetolive is the key and the number indicating the remaining timeout is the value.
[0095] Furthermore, in the process of determining the current remaining timeout of the service request for the above-mentioned target application, when any application to be called is the first application in the application call chain, the time transfer field carried by the service request can be obtained. When the time transfer field is obtained, the field value corresponding to the time transfer field in the service request is used as the current remaining timeout of the service request; and when any application to be called is not the first application in the application call chain, the call time consumed when calling the previous application of any application is obtained, and the call time consumed is used to adjust the remaining timeout determined when calling the previous application, and the adjusted remaining timeout is used as the current remaining timeout of the service request.
[0096] As mentioned above Figure 1For example, a user terminal calls application A in a distributed system, and the timeout setting time set by the user terminal in the service request is 800 milliseconds. Then, after application A receives the service request, for application B to be called first in the application call link, the field value 800 milliseconds corresponding to the time transfer field in the service request is obtained as the current timeout remaining time of the service request; for application C to be called in the application call link, the call consumption generated when calling application B is obtained, and the call consumption is used to adjust the timeout remaining time determined when calling application B, and the adjusted timeout remaining time is used as the current timeout remaining time of the service request; for application D to be called in the application call link, the call consumption generated when calling application C is obtained, and the call consumption is used to adjust the timeout remaining time determined when calling application C, and the adjusted timeout remaining time is used as the current timeout remaining time of the service request.
[0097] Furthermore, in order to solve the problem of the distributed system not passing the time transfer field, the target application can obtain the timeout setting time for the service request when it fails to obtain the time transfer field, and then use the obtained timeout setting time as the current timeout remaining time of the service request to play a fault tolerance role.
[0098] The timeout setting is the maximum waiting time for a user terminal to call. Each call between applications in a distributed system has a timeout setting. For example, if application A calls application B, after the pre-configured timeout setting, application A will no longer wait for application B to return a result. Therefore, the timeout setting represents the maximum waiting time for a call between two applications, while the remaining timeout is the remaining timeout for the user terminal.
[0099] In some embodiments of the present application, the process of sending a call request from the target application to any application specifically includes: sending a call request containing the current remaining timeout of the service request to the any application, so that the current remaining timeout is passed downward each time the call is made to achieve timeout awareness of the entire link.
[0100] For example, Figure 4 As shown, the distributed system sends the service request of the user terminal to application A. In application A, the application call link corresponding to the service request is application B → application C → application D. Then the call request sent by application A to application B contains the timeout remaining time _system_timetolive = 800 milliseconds, the call request sent by application A to application C contains the timeout remaining time _system_timetolive = 780 milliseconds, and the call request sent by application A to application D contains the timeout remaining time _system_timetolive = 670 milliseconds.
[0101] In specific implementation, when the target application sends a call request, it can add a time transfer field in the service request in the form of an extended field to pass the current remaining time of the timeout to the application to be called, such as adding a time transfer field in a key-value structure, with the time transfer field as the key and the remaining time of the timeout as the field value.
[0102] In some embodiments of the present application, in a process in which the target application determines that the processing of the service request has not timed out based on the current remaining timeout, if the remaining timeout is greater than 0, then the processing of the service request is determined to have not timed out. Further, if the remaining timeout is less than or equal to 0, then the processing of the service request is determined to have timed out.
[0103] like Figure 5 As shown, the user terminal calls application A. In application A, application A determines that the current timeout remaining time of the application request _system_timetolive = 800 milliseconds > 0. Application A sends a call request to application B. After application A completes the call to application B, it determines that the current timeout remaining time of the application request = 800 milliseconds - 20 milliseconds = 780 milliseconds. Since _system_timetolive = 780 milliseconds > 0, application A continues to call application C. After application A completes the call to application C, it determines that the current timeout remaining time of the application request _system_timetolive = 780 milliseconds - 1020 milliseconds = -240 milliseconds. Since _system_timetolive = -240 milliseconds < 0, application A cancels the call to application D and returns an error notification to the user.
[0104] In other embodiments of the present application, when the target application determines that the processing of the service request has timed out based on the current remaining timeout time, it returns an error notification to the user terminal and ends the call to the application in the application call link, thereby ending subsequent redundant calls in advance and further improving the request processing efficiency.
[0105] The error notification is used to notify when a timeout error occurs.
[0106] In other embodiments of the present application, after the target application sends a call request to any application, it can return the error notification to the user terminal when receiving an error notification returned by any application, and end the call to the application in the application call link.
[0107] As mentioned above, if an application returns an error notification, it means that the application has timed out after calling its lower-level application. Therefore, based on the error notification returned by the application, the target application can end subsequent calls and return an error notification to the user terminal, thereby realizing full-link timeout determination, ending the call in advance, and saving unnecessary time.
[0108] like Figure 6 As shown, the user terminal calls application A, and application A determines that the current timeout remaining time of the service request _system_timetolive = 800 milliseconds is greater than 0. Application A sends a call request to application B. After application A completes the call to application B, it determines that the current timeout remaining time of the application request _system_timetolive = 800 milliseconds - 20 milliseconds = 780 milliseconds. Since _system_timetolive = 780 milliseconds is greater than 0, application A continues to call application C and passes _system_timetolive = 780 milliseconds to application C along with the call request. In the example, after application C completes the call to application E, the remaining timeout time _system_timetolive is deducted by 200 milliseconds. Since _system_timetolive = 580 milliseconds > 0, application C continues to call application F. After application C completes the call to application F, the remaining timeout time _system_timetolive is deducted by 600 milliseconds. Since _system_timetolive = -20 milliseconds < 0, application C cancels the call to application G and returns an error notification to the upper-level application A. Application A cancels the call to application D and returns an error notification to the user terminal.
[0109] In other embodiments of the present application, the target application determines that the processing of the service request has not timed out based on the determined remaining timeout time, and can also determine that the processing of the service request has not timed out by obtaining the historical average time consumption of any application and when the historical average time consumption is less than the determined remaining timeout time.
[0110] That is to say, each time before sending a call request to any application in the application call chain, the historical average time consumption of any application is used to predict whether the remaining time of the timeout is sufficient to complete the call, so as to avoid timeout before the call. Calls that are likely to time out can be ended in advance, thereby reducing calls to slow-down applications, reducing the load on slow-down applications, and helping to recover slow-down applications.
[0111] In this embodiment, the historical average time consumption of any application is obtained based on the time consumption of each call to the application within the first preset time closest to the current system time. Therefore, it can represent the time consumption of the current call to the application. The first preset time represents the statistical range of the historical average time consumption.
[0112] As mentioned above Figure 7 As shown, the user terminal calls application A. When application A receives the service request, the determined timeout remaining time _system_timetolive = 800 milliseconds. Before calling application B, application A obtains the historical average time of application B, which is 20 milliseconds. Since the predicted timeout remaining time _system_timetolive = 800 milliseconds > 20 milliseconds, application A sends a call request to application B. After application A completes the call to application B, the determined timeout remaining time _system_timetolive = 800 milliseconds - 20 milliseconds = 780 milliseconds. Application A obtains the historical average time of application C, which is 1000 milliseconds. Since the predicted timeout remaining time _system_timetolive = 780 milliseconds < 1000 milliseconds, application A cancels the call to application C and application D in advance and returns an error notification to the user.
[0113] In other embodiments of the present application, after obtaining the historical average time of any application based on the time consumed for each call to any application within the first preset time closest to the current system time, timing is started. If a call request from any application is detected before the timing time reaches a second preset time, timing is restarted. If no call request from any application is detected after the timing time reaches the second preset time, the historical average time is deleted. Until it is needed, the historical average time is obtained based on the time consumed for each call to any application within the first preset time closest to the current system time. This ensures the timeliness of the historical average time.
[0114] The second preset time represents the time range of the historical average time effectiveness, and the second preset time is smaller than the first preset time. For example, the second preset time may be one third of the first preset time.
[0115] In other embodiments of the present application, since each call between applications in a distributed system is configured with a timeout setting, after obtaining the historical average time consumption of any application based on the time consumption of each call to the application within the first preset time closest to the current system time, the historical average time consumption can be compared with the timeout setting time configured for the application. If the historical average time consumption is greater than the timeout setting time, the call to the application can be stopped for a certain period of time. In this way, any call to the application is rejected for a period of time, which is conducive to the recovery of the application.
[0116] Based on the above-mentioned embodiment 2, the distributed system forwards the service request of the user terminal to the corresponding target application. During the process of calling any application in the call link corresponding to the service request, the target application will determine the current timeout remaining time of the service request each time. Before sending the call request to the application that needs to be called currently, it will determine whether the processing of the service request has timed out based on the current timeout remaining time. Only when it is determined that it has not timed out will it send the call request to any application. In this way, any application call on the application call link can fully perceive the current timeout remaining time of the application request. If it has not timed out, it will continue to initiate a call to the next application. Otherwise, it will not continue to initiate a call to the next application, avoiding the increase of processing burden by continuing to execute redundant calls after timeout, thereby improving the request processing efficiency.
[0117] To determine whether the processing of a service request has timed out based on the current remaining timeout, we obtain the historical average duration of the application to be called and use this to predict whether the current remaining timeout is sufficient to complete the call. This allows us to terminate calls that are likely to time out in advance, thereby reducing calls to slow-processing applications, reducing the load on slow-processing applications, and helping to recover slow-processing applications.
[0118] Furthermore, upon receiving the error notification returned by the calling application, the target application may also terminate the subsequent call in advance and return the error notification to the user terminal, so that the user terminal can also end waiting for the result of the service request processing.
[0119] It can be seen that the above solution realizes timeout awareness of the entire call link in the process of processing the service request of the user terminal.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0121] Corresponding to the aforementioned embodiment of the request processing method, the present application also provides an embodiment of a request processing device.
[0122] Figure 8 FIG. 1 is a schematic diagram showing a structure of a request processing device according to an exemplary embodiment, wherein the device is used to execute the request processing method provided in any of the above embodiments, such as Figure 8 As shown, the request processing device includes:
[0123] The receiving module 810 is configured to receive an application request; the remaining time after the timeout is the remaining time before the application request times out;
[0124] The time determination module 820 is configured to determine the current remaining timeout of the application request for any application call in the application call chain corresponding to the application request; the application call chain is the sequence of application calls required to process the application request, and the remaining timeout is the remaining time until the application request times out.
[0125] The advance determination module 830 is configured to send a call request to any application if it is determined based on the remaining timeout period that the processing of the application request has not timed out.
[0126] In an optional implementation, the time determination module 820 is specifically used to, in the process of determining the current remaining timeout time of the application request, use the time transfer field in the application request to determine the current remaining timeout time of the application request when any application is the first application in the application call link; the time transfer field indicates the field for transmitting the remaining timeout time when the sender of the application request sends the application request; when any application is not the first application in the application call link, obtain the call time consumed when calling the previous application of any application, use the call time consumed to adjust the remaining timeout time determined when calling the previous application, and use the adjusted remaining timeout time as the current remaining timeout time of the application request.
[0127] In an optional implementation, the time determination module 820 is specifically used to determine the current remaining timeout time of the application request by using the time transfer field in the application request, including: when the application request carries the time transfer field, using the field value corresponding to the time transfer field in the application request as the current remaining timeout time of the application request; when the application request does not carry the time transfer field, obtaining the timeout setting time for the application request, and using the timeout setting time as the remaining timeout time; the timeout setting time is the maximum waiting time set by the sender of the application request in the application request.
[0128] In an optional implementation, the time determination module 820 is specifically used to subtract the call time from the timeout remaining time determined when calling the previous application in the process of adjusting the timeout remaining time determined when calling the previous application using the call time to obtain the adjusted timeout remaining time.
[0129] In an optional implementation, the device further includes ( Figure 8 Not shown):
[0130] The first error handling module is configured to return an error notification to the sender of the application request and terminate the call to the application in the application call link when determining that the processing of the application request has timed out based on the remaining timeout period.
[0131] In an optional implementation, the device further includes ( Figure 8 Not shown):
[0132] The second error handling module is used to, after sending a call request to any of the applications, return the error notification to the sender of the application request upon receiving an error notification returned by any of the applications, and end the call to the application in the application call link.
[0133] In an optional implementation, the advance determination module 830 is specifically used to obtain the historical average time consumed by any application in the process of determining that the processing of the application request has not timed out based on the remaining timeout time; the historical average time consumed is obtained based on the time consumed by each call to any application within the first preset time closest to the current system time; when the historical average time consumed is less than the remaining timeout time, it is determined that the processing of the application request has not timed out.
[0134] In an optional implementation, the device further includes ( Figure 8 Not shown):
[0135] A statistical failure module is used to start timing after obtaining the historical average time consumed by any application based on the time consumed for each call to any application within a first preset time closest to the current system time; restart timing if a call request from any application is detected before the timing time reaches a second preset time; and delete the historical average time if no call request from any application is detected after the timing time reaches the second preset time; wherein, the first preset time is greater than the second preset time.
[0136] In an optional implementation, the advance determination module 830 is specifically configured to determine that the processing of the application request has not timed out when the remaining timeout time is greater than 0, during the process of determining that the processing of the application request has not timed out based on the remaining timeout time.
[0137] In an optional implementation, the advance determination module 830 is specifically configured to send a call request including the remaining timeout period to any application during the process of sending the call request to any application.
[0138] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0139] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0140] The embodiment of the present application further provides an electronic device corresponding to the request processing method provided in the aforementioned embodiment, so as to execute the aforementioned request processing method.
[0141] Figure 9 This is a hardware structure diagram of an electronic device according to an exemplary embodiment. The electronic device includes: a communication interface 601, a processor 602, a memory 603, and a bus 604. The communication interface 601, the processor 602, and the memory 603 communicate with each other via the bus 604. The processor 602 executes the request processing method described above by reading and executing machine-executable instructions corresponding to the control logic of the request processing method in the memory 603. The details of the method are described in the above embodiments and are not repeated here.
[0142] The memory 603 mentioned in this application can be any electronic, magnetic, optical or other physical storage system, and can contain stored information, such as executable instructions, data, etc. Specifically, the memory 603 can be RAM (Random Access Memory), flash memory, a storage drive (such as a hard disk drive), any type of storage disk (such as an optical disk, DVD, etc.), or a similar storage medium, or a combination thereof. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 601 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0143] The bus 604 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 603 is used to store programs, and the processor 602 executes the programs after receiving an execution instruction.
[0144] The processor 602 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 602 or an instruction in the form of software. The above-mentioned processor 602 can be a general-purpose processor, including a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or can be completed by a combination of hardware and software modules in the decoding processor.
[0145] The electronic device provided in the embodiment of the present application and the request processing method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented by them.
[0146] The present application also provides a computer-readable storage medium corresponding to the request processing method provided in the above embodiment. Figure 10 As shown, the computer-readable storage medium is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, the request processing method provided by any of the aforementioned embodiments is executed.
[0147] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0148] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the request processing method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0149] An embodiment of the present application further provides a computer program product corresponding to the request processing method provided in the aforementioned embodiment. The computer program product includes a computer program, which is executed by a processor to implement the request processing method provided in the aforementioned embodiment.
[0150] The computer program product provided by the above-mentioned embodiments of the present application and the request processing method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0151] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0152] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0153] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A request processing method, characterized in that: The method comprises: Receive application requests; Determining, for a call of any application in an application call chain corresponding to the application request, a current remaining timeout of the application request; the application call chain is the sequence of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time until the application request times out; If it is determined based on the remaining timeout period that the processing of the application request has not timed out, a call request is sent to any application.
2. The method according to claim 1, characterized in that The determining the current remaining timeout time of the application request includes: In a case where any of the applications is the first application in the application call chain, determining the current remaining timeout of the application request by using a time transfer field in the application request; the time transfer field indicates a field used by the sender of the application request to transfer the remaining timeout when sending the application request; In the case where any of the applications is not the first application in the application call chain, the call consumption generated when calling the previous application of any of the applications is obtained, and the call consumption is used to adjust the timeout remaining time determined when calling the previous application, and the adjusted timeout remaining time is used as the current timeout remaining time of the application request.
3. The method according to claim 2, characterized in that The determining the current remaining timeout time of the application request by using the time transfer field in the application request includes: In the case where the application request carries the time transfer field, using the field value corresponding to the time transfer field in the application request as the current timeout remaining time of the application request; In the case that the application request does not carry the time transfer field, the timeout setting time for the application request is obtained, and the timeout setting time is used as the timeout remaining time; the timeout setting time is the maximum waiting time set by the sender of the application request in the application request.
4. The method according to claim 2, characterized in that The adjusting the remaining time of the timeout determined when calling the previous application by using the calling time consumption includes: The timeout remaining time determined when calling the previous application is subtracted from the calling time to obtain an adjusted timeout remaining time.
5. The method according to claim 1, wherein The method further comprises: When it is determined based on the remaining timeout period that the processing of the application request has timed out, an error notification is returned to the sender of the application request, and the call to the application in the application call link is terminated.
6. The method according to claim 1, characterized in that After sending the call request to any one of the applications, the method further includes: In the case of receiving an error notification returned by any of the applications, the error notification is returned to the sender of the application request, and the call to the application in the application call link is terminated.
7. The method according to claim 1, characterized in that The determining, based on the remaining timeout period, that the processing of the application request has not timed out includes: Obtaining a historical average time consumption of any one of the applications; the historical average time consumption is obtained based on the time consumption of each call to the any one of the applications within a first preset time period closest to the current system time; When the historical average time consumption is less than the remaining time of the timeout, it is determined that the processing of the application request has not timed out.
8. The method according to claim 7, characterized in that The method further comprises: After obtaining a historical average duration of the application based on the duration of each call of the application within a first preset time closest to the current system time, start timing; If a call request from any of the applications is detected before the timing reaches the second preset time, restarting the timing; When no call request of any application is detected after the timing time reaches a second preset time, deleting the historical average time consumption; The first preset time is greater than the second preset time.
9. The method according to claim 1, characterized in that The determining, based on the remaining timeout period, that the processing of the application request has not timed out includes: If the remaining timeout period is greater than 0, it is determined that the processing of the application request has not timed out.
10. The method according to any one of claims 1 to 9, characterized in that The sending a call request to any one of the applications includes: Send a call request including the remaining time of the timeout to any of the applications.
11. A request processing system, characterized in that: The system includes a user terminal and a distributed system. The distributed system includes multiple applications, each of which is used to provide different services: The user terminal is used to send a service request to the distributed system; The distributed system is used to forward the service request to the target application called by the service request, and the target application determines the current remaining timeout of the service request for calling any application in the application call chain corresponding to the service request, and sends a call request to the any application if it is determined based on the remaining timeout that the processing of the service request has not timed out; wherein the application call chain is the order of application calls that need to be completed to process the application request, and the remaining timeout is the remaining time before the application request times out.
12. The system according to claim 11, wherein: The distributed system is specifically used to use the timeout setting time of the service request to add a time transfer field in the service request during the process of forwarding the service request to the target application called by the service request, and forward the service request with the added field to the target application; the timeout setting time is the maximum waiting time set by the user terminal in the service request.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the program to implement the method according to any one of claims 1 to 10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 10.
15. A computer program product comprising a computer program, characterized in that The computer program is executed by a processor to implement the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Service calling method and device, electronic equipment and storage medium
CN115495256A
Timeout time information configuration method and device, storage medium and computer equipment
CN115700483A
Service timeout control method and device, micro-service system and storage medium
CN116170519A
Using distributed services to continue or fail requests based on determining allotted time and processing time
US11665110B1