A funnel-type timeout control method and device suitable for service orchestration

By dynamically updating and adjusting the timeout in service orchestration, the problem of inability to achieve fine timeout control in transactions across multiple systems is solved, the efficiency of timeout control is improved, and resource waste and performance impact are avoided.

CN114244729BActive Publication Date: 2024-08-23中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111458899.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2024-08-23
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

Existing technology cannot achieve fine timeout control at transaction granularity in transaction scenarios across multiple systems, resulting in too long timeout settings, affecting system performance and resource utilization efficiency.

Method used

The funnel-type timeout control method is adopted to receive the client's service request message, obtain the request start time, analyze the preset processing time in the message, and perform timeout detection every time the atomic service is remotely called, and update the consumed time information. If the timeout exceeds the preset time, an exception will be thrown to terminate the service orchestration, and the timeout can be dynamically adjusted to achieve fine control.

Benefits of technology

It achieves fine timeout control in complex transaction scenarios, improves timeout control efficiency, and avoids resource waste and performance impact caused by too long timeout settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114244729B
    Figure CN114244729B
Patent Text Reader

Abstract

The present invention discloses a funnel-type timeout control method and device suitable for service orchestration. The invention comprises: receiving a service request message sent by a client, obtaining the request start time of the service request message; analyzing the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time; detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; in the case where the consumed time is greater than or equal to the preset processing time, throwing an exception message and terminating the execution of the service orchestration according to the exception message. Through the present invention, the problem that fine timeout control on the transaction granularity cannot be achieved in the complex scenario of transactions across multiple systems in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of remote call service timeout control, and in particular to a funnel-type timeout control method and device suitable for service orchestration. Background Art

[0002] In the related technologies, whether it is a remote call of HTTP or TCP protocol, timeout control is a technical point of concern. Timeout control means that when the requester does not get a response within a reasonable time range, it will receive a timeout exception and fail quickly and release the connection resources. Without timeout control, resources such as HTTP connections and TCP connections will be consumed in large quantities until they are exhausted.

[0003] The existing timeout control method based on TCP connection can only control the calls between the client and the server. If a transaction needs to cross multiple servers, such as A remotely calls B and then A remotely calls C, the agreed timeout between A and B is 3 seconds, and the agreed timeout between A and C is 2 seconds, then this timeout control method can achieve fixed timeout control between A and B and A and C, but cannot achieve fine timeout control at the transaction level. For example, if the transaction timeout is agreed to be 5 seconds, and A has consumed 2 seconds to call B, it is most appropriate to set the timeout for A to call C to 3 seconds, which cannot be achieved using a fixed timeout setting.

[0004] If the traditional timeout control method is used, the transaction timeout often needs to be set as the sum of the timeouts of each atomic service in the service orchestration. In order to avoid the occasional slow response time of the service provider due to uncontrollable reasons such as network jitter, HTTP connection pool resource shortage, and service garbage collection, the atomic service call timeout set by the composite service needs to have a large margin, which often leads to a very long timeout for the entire transaction, and even to an unreasonable length. The transaction processing result is obtained from the composite service within a limited time. However, the current timeout control method generally focuses on a single remote call between the client and the server. In complex remote call scenarios, such as transactions across multiple systems, it is impossible to achieve fine timeout control at the transaction granularity.

[0005] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention

[0006] The main purpose of the present invention is to provide a funnel-type timeout control method and device suitable for service orchestration, so as to solve the problem in the related art that fine timeout control on the transaction granularity cannot be achieved in complex scenarios of transactions across multiple systems.

[0007] In order to achieve the above-mentioned purpose, according to one aspect of the present invention, a funnel-type timeout control method suitable for service orchestration is provided. The invention includes: receiving a service request message sent by a client, obtaining the request start time of the service request message; analyzing the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time the atomic service is remotely called once, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; in the case where the consumed time is greater than or equal to the preset processing time, throwing an exception message and terminating the execution of the service orchestration according to the exception message.

[0008] Furthermore, before receiving the service request message sent by the client and obtaining the request start time of the service request message, the method also includes: obtaining control information and setting the control information in the message header of the service request message, wherein the control information includes at least the following information: the source of the service request, the service orchestration corresponding to the service request, the preset processing time corresponding to the service orchestration, and the consumed time corresponding to the service orchestration; obtaining business information and setting the business information in the message body of the service request message.

[0009] Furthermore, a service request message sent by the client is received, and a request start time of the service request message is obtained, including: performing a pre-processing operation on the service request message to record the request start time corresponding to the service request message, and storing the request start time in a preset access area, wherein the preset access area is accessible during the execution of service orchestration.

[0010] Furthermore, in the process of service orchestration, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, including: recording the current time each time the call of the atomic service is detected; reading the request start time corresponding to the service request message from the preset access area; subtracting the request start time from the current time to obtain the consumed time corresponding to the execution of the service orchestration; replacing the consumed time set in the service request message with the calculated consumed time.

[0011] Furthermore, in the process of service orchestration, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message according to the consumed time, the method also includes: reading the consumed time corresponding to the service orchestration in the message header and the preset processing time; calculating the time difference between the preset processing time and the consumed time, and determining the time difference as the remaining time corresponding to the service orchestration; and setting the remaining time in the TCP connection used to read the atomic service.

[0012] Furthermore, after detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time, the method also includes: when the consumed time is less than the preset processing time, calculating the difference between the preset processing time and the consumed time and determining the difference as the remaining processing time, and detecting whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; when the return result is not read within the time corresponding to the remaining processing time, controlling the PCS to throw a timeout exception, and terminating the execution of the service orchestration according to the timeout exception.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a funnel-type timeout control device suitable for service orchestration is provided. The device includes: a first acquisition unit, which is used to receive a service request message sent by a client and obtain the request start time of the service request message; a determination unit, which is used to analyze the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; an update unit, which is used to perform a timeout detection every time an atomic service is remotely called once during the service orchestration process to determine the consumed time corresponding to the execution of the service orchestration, and update the consumed time information in the service request message according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; a detection unit, which is used to detect whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; a first termination unit, which is used to throw an exception message and terminate the execution of the service orchestration according to the exception message when the consumed time is greater than or equal to the preset processing time.

[0014] Further, the device includes: a first setting unit, used to obtain control information before receiving a service request message sent by a client and obtaining the request start time of the service request message, and set the control information in a message header of the service request message, wherein the control information includes at least the following information: the source of the service request, the service orchestration corresponding to the service request, the preset processing time corresponding to the service orchestration, and the consumed time corresponding to the service orchestration; a second setting unit, used to obtain business information, and set the business information in the message body of the service request message.

[0015] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is provided, the computer-readable storage medium comprising a stored program, wherein the program executes any one of the above-mentioned funnel-type timeout control methods applicable to service orchestration.

[0016] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a processor is provided, and the processor is used to run a program, wherein the program executes any one of the above-mentioned funnel-type timeout control methods applicable to service orchestration.

[0017] Through the present invention, the following steps are adopted: receiving a service request message sent by a client, and obtaining a request start time of the service request message; analyzing the service request message to determine a preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; in the case where the consumed time is greater than or equal to the preset processing time, throwing an exception message and terminating the execution of the service orchestration according to the exception message, thereby solving the problem in the related art that in complex scenarios of transactions across multiple systems, fine timeout control on the transaction granularity cannot be achieved, thereby achieving the technical effect of improving the timeout control efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0019] Figure 1 is a flow chart of a funnel-type timeout control method applicable to service orchestration provided according to an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram corresponding to a funnel-type timeout control method applicable to service orchestration provided in accordance with an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of a funnel-type timeout control device suitable for service orchestration provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] For the convenience of description, some nouns or terms involved in the embodiments of the present invention are explained below:

[0026] HTTP: HyperText Transfer Protocol, which defines how a Web client requests a Web page from a Web server and how the server transmits the Web page to the client.

[0027] TCP: Transmission Control Protocol is a transmission protocol designed to provide reliable end-to-end byte streams on unreliable Internet networks.

[0028] RPC: Remote Procedure Call, which can be simply understood as one node requesting a service provided by another node.

[0029] Atomic service: A service used to implement a specific business logic and can be deployed independently.

[0030] Service orchestration: Arrange and combine one or more atomic services in a certain order to form a coarser-grained service.

[0031] Composite service: Add common pre-processing logic and common post-processing logic based on service orchestration, which can be deployed independently.

[0032] According to an embodiment of the present invention, a funnel-type timeout control method applicable to service orchestration is provided.

[0033] Figure 1 FIG. 1 is a flow chart of a funnel-type timeout control method applicable to service orchestration according to an embodiment of the present invention. Figure 1 As shown, the invention comprises the following steps:

[0034] Step S101: receiving a service request message sent by a client, and obtaining a request start time of the service request message.

[0035] As mentioned above, under the distributed microservice architecture, a transaction request may pass through multiple services of the same system or even across multiple different systems from the time it is issued to the time it finally obtains the response result. Therefore, the service request is first routed to the composite service for processing, and the composite service then remotely calls the atomic service in sequence according to the service orchestration. This application is designed from a user-centric perspective and grasps reasonable timeout control from the granularity of the transaction.

[0036] As mentioned above, in the present application, the client requests the combined service in the form of a message, and the request start time of the service request message is the request start time when the service request message is received by the pre-processing in the combined service.

[0037] Step S102: Analyze the service request message to determine a preset processing time corresponding to the service arrangement contained in the service request message.

[0038] As mentioned above, in the present application, the preset total execution time of the service arrangement (that is, the preset processing time, that is, the maximum timeout) is set in the service request message, and the preset processing time is transmitted throughout the entire service transaction through the transmission of the service request message.

[0039] Step S103, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service.

[0040] As mentioned above, each time an atomic service is remotely called, it is necessary to determine the consumed time of the entire transaction, recalculate the remaining available time of the transaction, and use it as the timeout time for subsequent remote calls.

[0041] Step S104: Check whether the consumed time corresponding to the service arrangement is greater than or equal to the preset processing time.

[0042] Step S105: when the consumed time is greater than or equal to the preset processing time, an exception message is thrown and the execution of the service arrangement is terminated according to the exception message.

[0043] As described above, in this application, before the composite service remotely calls the atomic service, the remaining available time of the transaction is calculated, and it is used as the timeout time for subsequent remote calls. As the transaction process progresses, the timeout time gradually narrows, presenting a funnel shape, so that failure after timeout can be achieved as quickly as possible, avoiding the problem that the server still attempts to continue to execute subsequent orchestration when the caller of the composite service has reported a timeout, thereby achieving refined timeout control.

[0044] In an optional instance, before receiving a service request message from a client and obtaining a request start time of the service request message, the method further includes: obtaining control information and setting the control information in a message header of the service request message, wherein the control information includes at least the following information: a source of the service request, a service orchestration corresponding to the service request, a preset processing time corresponding to the service orchestration, and a consumed time corresponding to the service orchestration; obtaining business information and setting the business information in a message body of the service request message.

[0045] As described above, in the embodiment provided by the present application, the service request message consists of a message header and a message body. The initial consumed time in the initial service request message header is 0. The message header contains control information, and the consumed time corresponding to the service orchestration is dynamically updated with the timeout detection. At the same time, the message body contains specific business information requested by the customer.

[0046] In an optional instance, a service request message sent by a client is received, and a request start time of the service request message is obtained, including: performing a pre-processing operation on the service request message to record the request start time corresponding to the service request message, and storing the request start time in a preset access area, wherein the preset access area is accessible during the execution of service orchestration.

[0047] As mentioned above, after the composite service receives the service request message from the client, it records the service request start time in the pre-processing and puts it into the context of the preset template area. The request start time of the service request message is the arrival time of the service request message. The preset access area is in the memory of the message and is an area that can be accessed at any time during the transaction process. When the atomic service is called remotely each time, the preset access area is accessed to read the request start time in the preset access area, and the consumed time of the entire service arrangement is calculated based on the request start time.

[0048] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the elapsed time corresponding to the execution of the service orchestration, and the elapsed time information in the service request message is updated based on the elapsed time, including: recording the current time each time an atomic service call is detected; reading the request start time corresponding to the service request message from a preset access area; subtracting the request start time from the current time to obtain the elapsed time corresponding to the execution of the service orchestration; and replacing the elapsed time set in the service request message with the calculated elapsed time.

[0049] As described above, the consumed time of the transaction is set in the message header. Before each remote call to the atomic service, a timeout check is performed to update the consumed time, and the remaining available time of the transaction is recalculated based on the consumed time and the preset processing time contained in the message header, and used as the timeout time for subsequent remote calls, thereby realizing the dynamic setting of the timeout time, which is obtained by the timeout detection step of the service orchestration.

[0050] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message based on the consumed time, the method also includes: reading the consumed time corresponding to the service orchestration in the message header and the preset processing time; calculating the time difference between the preset processing time and the consumed time, and determining the time difference as the remaining time corresponding to the service orchestration; and setting the remaining time in the TCP connection used to read the atomic service.

[0051] As mentioned above, the current technology generally uses a read timeout control method based on TCP connection for remote calls, that is, after the client establishes a TCP connection with the server, if the client does not read a response from the TCP connection within a limited time, the client actively throws a timeout exception to end the client work thread blocked by the read action. The current TCP connection read timeout is generally set in a configuration manner, that is, the client and the server agree on a fixed timeout and do not dynamically modify the timeout at runtime. TCP is a transmission protocol for reliable end-to-end byte streams provided on the Internet. When calling atomic services remotely in service orchestration, the remaining available time of the transaction is calculated by subtracting the consumed time in the message header from the transaction timeout, and the TCP connection read timeout is set to the remaining available time of the transaction.

[0052] In an optional instance, after detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time, the method further includes: when the consumed time is less than the preset processing time, calculating the difference between the preset processing time and the consumed time and determining the difference as the remaining processing time, and detecting whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; when the return result is not read within the time corresponding to the remaining processing time, controlling the PCS to throw a timeout exception, and terminating the execution of the service orchestration according to the timeout exception.

[0053] As mentioned above, PCS is the physical coding sublayer, located between the coordination sublayer and the physical medium access layer sublayer. When the composite service calls the atomic service before the timeout detection, it has not timed out, but due to reasons such as slow PCS execution or network delay, the PCS does not read the return result within the remaining available time of the transaction. As the request initiator, PCS directly throws a timeout exception and the service orchestration is terminated.

[0054] The embodiment of the present invention provides a funnel-type timeout control method suitable for service orchestration, which receives a service request message sent by a client to obtain the request start time of the service request message; analyzes the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; detects whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; when the consumed time is greater than or equal to the preset processing time, throws an exception message and terminates the execution of the service orchestration according to the exception message, thereby solving the problem in the related art that in the complex scenario of transactions across multiple systems, fine timeout control on the transaction granularity cannot be achieved, thereby achieving the technical effect of improving the timeout control efficiency.

[0055] In another optional embodiment provided in the present application, Figure 2 1 is a schematic diagram corresponding to a funnel-type timeout control method applicable to service orchestration provided according to an embodiment of the present invention, including:

[0056] The composite service receives the request message and records the arrival time of the request message in pre-processing. During the service orchestration process, a timeout check is performed each time the atomic service is remotely called, and the consumed time information in the request message is updated. If the consumed time in post-processing is greater than or equal to the preset processing time, an exception is thrown and the service orchestration is terminated based on the exception information.

[0057] Set the timeout of the entire transaction at the composite service level, and appropriately increase the margin based on the normal stress test or evaluation timeout to keep the transaction timeout within a reasonable range so that the caller of the composite service does not have to wait too long. By having the composite service calculate the remaining available time of the transaction before remotely calling the atomic service, and using it as the timeout for subsequent remote calls, as the transaction progresses, the timeout gradually narrows, presenting a funnel shape, so that failure can be achieved as soon as possible after the timeout, avoiding the problem that the server still attempts to continue to execute subsequent orchestration when the caller of the composite service has reported a timeout, thereby achieving refined timeout control.

[0058] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0059] The embodiment of the present invention also provides a funnel-type timeout control device applicable to service orchestration. It should be noted that the funnel-type timeout control device applicable to service orchestration in the embodiment of the present invention can be used to execute the funnel-type timeout control method applicable to service orchestration provided in the embodiment of the present invention. The following introduces a funnel-type timeout control device applicable to service orchestration provided in the embodiment of the present invention.

[0060] Figure 3 FIG. 1 is a schematic diagram of a funnel-type timeout control device suitable for service orchestration according to an embodiment of the present invention. Figure 3 As shown, the device includes: a first acquisition unit 301, which is used to receive a service request message sent by a client and obtain a request start time of the service request message; a determination unit 302, which is used to analyze the service request message to determine a preset processing time corresponding to the service orchestration contained in the service request message; an update unit 303, which is used to perform a timeout detection every time an atomic service is remotely called once during the service orchestration process to determine the consumed time corresponding to the execution of the service orchestration, and update the consumed time information in the service request message according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; a detection unit 304, which is used to detect whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; a first termination unit 305, which is used to throw an exception message and terminate the execution of the service orchestration according to the exception message when the consumed time is greater than or equal to the preset processing time.

[0061] In an optional instance, the device includes: a first setting unit, used to obtain control information before receiving a service request message sent by a client and obtaining the request start time of the service request message, and set the control information in a message header of the service request message, wherein the control information includes at least the following information: the source of the service request, the service orchestration corresponding to the service request, the preset processing time corresponding to the service orchestration, and the consumed time corresponding to the service orchestration; a second setting unit, used to obtain business information, and set the business information in the message body of the service request message.

[0062] In an optional instance, the first acquisition unit 301 includes: a first recording subunit, used to perform pre-processing operations on the service request message to record the request start time corresponding to the service request message, and store the request start time in a preset access area, wherein the preset access area is accessible during the execution of service orchestration.

[0063] In an optional instance, the update unit 303 includes: a second recording sub-unit, used to record the current time each time a call to an atomic service is detected; a reading sub-unit, used to read the request start time corresponding to the service request message from a preset access area; a calculation sub-unit, used to subtract the request start time from the current time to obtain the consumed time corresponding to the execution of the service orchestration; and a replacement sub-unit, used to replace the consumed time set in the service request message with the calculated consumed time.

[0064] In an optional instance, the device also includes: a reading unit, which is used to perform a timeout detection each time the atomic service is remotely called during the service orchestration process to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message according to the consumed time, read the consumed time corresponding to the service orchestration in the message header and the preset processing time; a first calculation unit, which is used to calculate the time difference between the preset processing time and the consumed time, and determine the time difference as the remaining time corresponding to the service orchestration; a setting unit, which is used to set the remaining time in the TCP connection used to read the atomic service.

[0065] In an optional instance, the device also includes: a second calculation unit, which is used to, after detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time, calculate the difference between the preset processing time and the consumed time and determine the difference as the remaining processing time if the consumed time is less than the preset processing time, and detect whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; a second termination unit, which is used to control the PCS to throw a timeout exception if the return result is not read within the time corresponding to the remaining processing time, and terminate the execution of the service orchestration according to the timeout exception.

[0066] The embodiment of the present invention provides a funnel-type timeout control device suitable for service orchestration. The device receives a service request message sent by a client to obtain the request start time of the service request message; analyzes the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; detects whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; when the consumed time is greater than or equal to the preset processing time, throws an exception message and terminates the execution of the service orchestration according to the exception message, thereby solving the problem in the related art that fine timeout control on the transaction granularity cannot be achieved in the complex scenario of transactions across multiple systems, thereby achieving the technical effect of improving the timeout control efficiency.

[0067] The funnel-type timeout control device suitable for service orchestration includes a processor and a memory. The first acquisition unit 301 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.

[0068] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the technical problem in related technologies that fine timeout control on transaction granularity cannot be achieved in complex scenarios of transactions across multiple systems.

[0069] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0070] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the funnel-type timeout control method applicable to service orchestration is implemented.

[0071] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the funnel-type timeout control method applicable to service orchestration when running.

[0072] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: receiving a service request message sent by a client, and obtaining a request start time of the service request message; analyzing the service request message to determine a preset processing duration corresponding to a service orchestration contained in the service request message; during the service orchestration process, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed duration corresponding to the execution of the service orchestration, and the consumed duration information in the service request message is updated according to the consumed duration, wherein the service orchestration includes multiple calls to the atomic service; detecting whether the consumed duration corresponding to the service orchestration is greater than or equal to the preset processing duration; and throwing an exception message and terminating the execution of the service orchestration according to the exception message when the consumed duration is greater than or equal to the preset processing duration.

[0073] In an optional instance, before receiving a service request message from a client and obtaining a request start time of the service request message, the method further includes: obtaining control information and setting the control information in a message header of the service request message, wherein the control information includes at least the following information: a source of the service request, a service orchestration corresponding to the service request, a preset processing time corresponding to the service orchestration, and a consumed time corresponding to the service orchestration; obtaining business information and setting the business information in a message body of the service request message.

[0074] In an optional instance, a service request message sent by a client is received, and a request start time of the service request message is obtained, including: performing a pre-processing operation on the service request message to record the request start time corresponding to the service request message, and storing the request start time in a preset access area, wherein the preset access area is accessible during the execution of service orchestration.

[0075] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the elapsed time corresponding to the execution of the service orchestration, and the elapsed time information in the service request message is updated based on the elapsed time, including: recording the current time each time an atomic service call is detected; reading the request start time corresponding to the service request message from a preset access area; subtracting the request start time from the current time to obtain the elapsed time corresponding to the execution of the service orchestration; and replacing the elapsed time set in the service request message with the calculated elapsed time.

[0076] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message based on the consumed time, the method also includes: reading the consumed time corresponding to the service orchestration in the message header and the preset processing time; calculating the time difference between the preset processing time and the consumed time, and determining the time difference as the remaining time corresponding to the service orchestration; and setting the remaining time in the TCP connection used to read the atomic service.

[0077] In an optional instance, after detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time, the method further includes: when the consumed time is less than the preset processing time, calculating the difference between the preset processing time and the consumed time and determining the difference as the remaining processing time, and detecting whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; when the return result is not read within the time corresponding to the remaining processing time, controlling the PCS to throw a timeout exception, and terminating the execution of the service orchestration according to the timeout exception.

[0078] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0079] The present invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: receiving a service request message sent by a client, and obtaining the request start time of the service request message; analyzing the service request message to determine the preset processing time corresponding to the service orchestration contained in the service request message; in the process of service orchestration, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time; if the consumed time is greater than or equal to the preset processing time, throwing an exception message and terminating the execution of the service orchestration according to the exception message.

[0080] In an optional instance, before receiving a service request message from a client and obtaining a request start time of the service request message, the method further includes: obtaining control information and setting the control information in a message header of the service request message, wherein the control information includes at least the following information: a source of the service request, a service orchestration corresponding to the service request, a preset processing time corresponding to the service orchestration, and a consumed time corresponding to the service orchestration; obtaining business information and setting the business information in a message body of the service request message.

[0081] In an optional instance, a service request message sent by a client is received, and a request start time of the service request message is obtained, including: performing a pre-processing operation on the service request message to record the request start time corresponding to the service request message, and storing the request start time in a preset access area, wherein the preset access area is accessible during the execution of service orchestration.

[0082] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the elapsed time corresponding to the execution of the service orchestration, and the elapsed time information in the service request message is updated based on the elapsed time, including: recording the current time each time an atomic service call is detected; reading the request start time corresponding to the service request message from a preset access area; subtracting the request start time from the current time to obtain the elapsed time corresponding to the execution of the service orchestration; and replacing the elapsed time set in the service request message with the calculated elapsed time.

[0083] In an optional instance, during the service orchestration process, each time an atomic service is remotely called, a timeout check is performed to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message based on the consumed time, the method also includes: reading the consumed time corresponding to the service orchestration in the message header and the preset processing time; calculating the time difference between the preset processing time and the consumed time, and determining the time difference as the remaining time corresponding to the service orchestration; and setting the remaining time in the TCP connection used to read the atomic service.

[0084] In an optional instance, after detecting whether the consumed time corresponding to the service orchestration is greater than or equal to the preset processing time, the method further includes: when the consumed time is less than the preset processing time, calculating the difference between the preset processing time and the consumed time and determining the difference as the remaining processing time, and detecting whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; when the return result is not read within the time corresponding to the remaining processing time, controlling the PCS to throw a timeout exception, and terminating the execution of the service orchestration according to the timeout exception.

[0085] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0086] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0089] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0090] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0091] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media 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 memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0092] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0093] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0094] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A funnel-type timeout control method suitable for service orchestration, characterized in that: include: Receive a service request message from a client, and obtain a request start time of the service request message; Analyze the service request message to determine a preset processing time corresponding to the service arrangement contained in the service request message; During the service orchestration process, each time the atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; Detecting whether the consumed time corresponding to the service arrangement is greater than or equal to the preset processing time; In a case where the consumed time is greater than or equal to the preset processing time, an exception message is thrown and the execution of the service orchestration is terminated according to the exception message.

2. The method according to claim 1, characterized in that: Before receiving the service request message sent by the client and obtaining the request start time of the service request message, the method further includes: Acquire control information, and set the control information in a message header of the service request message, wherein the control information includes at least the following information: a source of the service request, a service arrangement corresponding to the service request, a preset processing time corresponding to processing the service arrangement, and a consumed time corresponding to the service arrangement; Acquire business information, and set the business information in the message body of the service request message.

3. The method according to claim 1, characterized in that Receiving a service request message from a client and obtaining a request start time of the service request message, including: A pre-processing operation is performed on the service request message to record a request start time corresponding to the service request message, and the request start time is stored in a preset access area, wherein the preset access area is accessible during the execution of the service orchestration.

4. The method according to claim 3, characterized in that During the service orchestration process, each time an atomic service is remotely called, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and the consumed time information in the service request message is updated according to the consumed time, including: Whenever a call to the atomic service is detected, recording the current time; Reading the request start time corresponding to the service request message from the preset access area; Subtract the request start time from the current time to obtain the consumed time corresponding to the execution of the service arrangement; The consumed time set in the service request message is replaced with the calculated consumed time.

5. The method according to claim 2, characterized in that: In the process of the service orchestration, each time the atomic service is remotely called once, a timeout detection is performed to determine the consumed time corresponding to the execution of the service orchestration, and in the process of updating the consumed time information in the service request message according to the consumed time, the method further includes: Reading the consumed time and the preset processing time corresponding to the service arrangement in the message header; Calculating a duration difference between the preset processing duration and the consumed duration, and determining the duration difference as a remaining duration corresponding to the service arrangement; The remaining duration is set in the TCP connection used to read the atomic service.

6. The method according to claim 1, characterized in that After detecting whether the consumed time corresponding to the service arrangement is greater than or equal to the preset processing time, the method further includes: In the case where the consumed time is less than the preset processing time, the difference between the preset processing time and the consumed time is calculated and the difference is determined as the remaining processing time, and it is detected whether the return result of calling the atomic service is read within the time corresponding to the remaining processing time; If the returned result is not read within the time corresponding to the remaining processing time, the PCS is controlled to throw a timeout exception, and the service orchestration is terminated according to the timeout exception, wherein the PCS is a physical coding sublayer, and the PCS is located between the coordination sublayer and the physical medium access layer sublayer.

7. A funnel-type timeout control device suitable for service orchestration, characterized in that: include: A first acquisition unit, configured to receive a service request message sent by a client, and acquire a request start time of the service request message; A determination unit, configured to analyze the service request message to determine a preset processing time corresponding to the service arrangement contained in the service request message; an updating unit, configured to perform a timeout detection each time an atomic service is remotely called during the service orchestration process to determine the consumed time corresponding to the execution of the service orchestration, and update the consumed time information in the service request message according to the consumed time, wherein the service orchestration includes multiple calls to the atomic service; A detection unit, configured to detect whether the consumed time corresponding to the service arrangement is greater than or equal to the preset processing time; The first termination unit is used to throw out exception information and terminate the execution of the service arrangement according to the exception information when the consumed time is greater than or equal to the preset processing time.

8. The device according to claim 7, characterized in that The device comprises: A first setting unit is configured to obtain control information before receiving a service request message sent by a client and obtaining a request start time of the service request message, and set the control information in a message header of the service request message, wherein the control information includes at least the following information: a source of the service request, a service arrangement corresponding to the service request, a preset processing time corresponding to processing the service arrangement, and a consumed time corresponding to the service arrangement; The second setting unit is used to obtain service information and set the service information in the message body of the service request message.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute a funnel-type timeout control method applicable to service orchestration as described in any one of claims 1 to 6.