Service timeout control method, device, equipment and storage medium

By obtaining the service return time statistics of upstream service instances, determining the target service instance and adjusting the timeout time, the problem of timeout degradation in the existing technology is solved, and high availability and business adaptability are achieved.

CN114048010BActive Publication Date: 2025-05-13BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111257530.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2025-05-13
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

In the prior art, the timeout time of the service instance needs to be set manually, and it will degrade over time, making it impossible to adapt to real business scenarios and reduce the availability of the timeout time.

Method used

By obtaining time statistics related to the service return time of each upstream service instance, the target service instance is determined, and the timeout time is adjusted based on the time statistics and importance information.

Benefits of technology

It realizes dynamic adjustment of the timeout time of the service instance, so that it can continue to maintain high availability, adapt to real business scenarios, and reduces the risk of failure due to unreasonable timeout time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048010B_ABST
    Figure CN114048010B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, equipment and storage medium for controlling a service timeout. The present disclosure relates to the field of artificial intelligence technology, specifically to the field of cloud computing technology, and can be applied to scenarios such as the management of service timeouts. The specific implementation scheme is: obtaining time statistical information related to the service return time of each upstream service instance, wherein the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance; based on the time statistical information corresponding to each upstream service instance, determining a target service instance from a plurality of upstream service instances; based on the time statistical information and / or importance information corresponding to each target service instance, adjusting the timeout for at least one target service instance. Based on the above process, the timeout of the service instance is dynamically adjusted, so that the timeout can continuously maintain a high level of availability and effectively adapt to real business scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to the field of cloud computing technology, and can be applied to scenarios such as management of service timeouts. Background Art

[0002] In some scenarios where information services are provided through service instances, a user's request may need to flow through multiple service instances. The connections between these service instances form a complete service chain for a user request.

[0003] When a service instance requests the service result of the corresponding downstream service instance, it is necessary to set the timeout of the service instance to ensure that the exception can be handled when the downstream service instance fails to return the service result within the timeout period. In the related art, the timeout is set manually, which will degenerate over time and cannot adapt to the real business scenario, reducing the availability of the timeout. Summary of the invention

[0004] The present disclosure provides a method, apparatus, device and storage medium for controlling a service timeout.

[0005] According to a first aspect of the present disclosure, a method for controlling a service timeout is provided, comprising:

[0006] Obtain time statistics related to the service return time of each upstream service instance, where the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance;

[0007] Determine a target service instance from multiple upstream service instances based on time statistics information corresponding to each upstream service instance;

[0008] Based on the time statistics information and / or importance information corresponding to each target service instance, a timeout period is adjusted for at least one target service instance.

[0009] According to a second aspect of the present disclosure, a device for controlling a service timeout is provided, comprising:

[0010] An information acquisition module is used to obtain time statistics information related to the service return time of each upstream service instance, wherein the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance;

[0011] A target determination module, used to determine a target service instance from multiple upstream service instances based on time statistics information corresponding to each upstream service instance;

[0012] The timeout adjustment module is used to adjust the timeout period for at least one target service instance based on the time statistics information and / or importance information corresponding to each target service instance.

[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0014] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned service timeout control method.

[0015] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned service timeout control method.

[0016] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned service timeout control method when executed by a processor.

[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description.

[0018] The beneficial effects of the technical solution provided by the present disclosure are:

[0019] In the technical solution disclosed in the present invention, the target service instance whose timeout period needs to be extended can be automatically determined based on the time statistics information related to the service return time of the service instance, and the required extension time of the timeout period of each target service instance can be calculated, and the corresponding timeout period can be adjusted based on the extension time of the target service instance. Based on the above process, the timeout period of the service instance can be dynamically adjusted, so that the timeout period can continuously maintain a high availability, effectively adapt to real business scenarios, and reduce the risk of failure of the service system due to unreasonable timeout period. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0021] Figure 1 An exemplary service link diagram for a user request provided by an embodiment of the present disclosure is shown;

[0022] Figure 2 A schematic diagram showing a flow chart of a method for controlling a service timeout period provided by an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram showing a flow chart of another method for controlling a service timeout provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram showing a device for controlling a service timeout period provided by an embodiment of the present disclosure is shown;

[0025] Figure 5 A schematic block diagram of an example electronic device that can be used to implement the method for controlling a service timeout period provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0027] In some scenarios where information services are provided through service instances, a user's request may need to flow through multiple service instances. The connections between these service instances form a complete service chain for a user request.

[0028] When a service instance requests the service result of the corresponding downstream service instance, it is necessary to set the timeout of the service instance to ensure that the exception can be handled when the downstream service instance fails to return the service result within the timeout period. In the related art, the timeout is set manually, which will degenerate over time and cannot adapt to the real business scenario, reducing the availability of the timeout.

[0029] The service timeout control method, device, equipment and storage medium provided in the embodiments of the present disclosure are intended to solve at least one of the above technical problems in the prior art.

[0030] Generally speaking, a user's request may need to circulate among multiple service instances, and these service instances are connected to form a complete service chain for a user request. Each service instance includes multiple service instances. In the disclosed embodiment, if a service instance in the service chain can receive the service result returned by another service instance, then the service instance can be referred to as the upstream service instance of the other service instance, and the other service instance can be referred to as the downstream service instance of the corresponding upstream service instance. Of course, an upstream service instance can also serve as a downstream service instance of other upstream service instances. Specifically, the upstream service instance can send a request to the corresponding downstream service instance and receive the service result returned by the corresponding downstream service instance.

[0031] Figure 1 An exemplary service link diagram for a user request provided by an embodiment of the present disclosure is shown. Figure 1 As shown, the service link includes 8 service instances, namely service instance A to service instance H. In a service system, each service instance includes multiple service instances. It can be understood that a service link including 8 service instances can be constructed for each user request. Service instance A can send requests to service instance B and service instance C, and receive service results returned by service instance B and service instance C. Service instance A is the upstream service instance of service instance B and service instance C. It can be understood that service instance B is the upstream service instance of service instance D and service instance E, service instance C is the upstream service instance of service instance F, service instance D is the upstream service instance of service instance G, and service instance E and service instance F are the upstream service instances of service instance H. It can be understood that in Figure 1 In the example, service instance G and service instance H are the lowest-level service instances, so they can only be used as downstream service instances, not upstream service instances.

[0032] Figure 2 A flow chart of a method for controlling a service timeout period provided by an embodiment of the present disclosure is shown. Figure 2 As shown, the method can mainly include the following steps:

[0033] S210: Obtain time statistics information related to the service return time of each upstream service instance.

[0034] Here, the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance. The time statistics information may be some information related to some statistical results of the service return time, and may characterize some specified characteristics of the service return time. Taking service instance A and service instance B as an example, service instance A is the upstream service instance of service instance B, and service instance B is the downstream service instance of service instance A. Service instance A can send a request to service instance B and receive the service result returned by service instance B. The service return time of service instance A is the time taken by service instance A to receive the service result returned by the corresponding service instance B after sending a request to service instance B.

[0035] Optionally, the time statistics information may include the timeout ratio corresponding to the service return time of each upstream service instance, and may also include time distribution characteristic information of the service return time of each upstream service instance. The timeout ratio can accurately reflect the delay of the service return time of each upstream service instance, and the time distribution characteristic information can accurately reflect the distribution of the service return time of each upstream service instance, which is conducive to accurate analysis of the service return time of the upstream service instance.

[0036] The timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceeds the corresponding timeout time to the total number of service return times of the upstream service instance. Continuing with service instance A and service instance B as an example, service instance A is the upstream service instance of service instance B, and service instance B is the downstream service instance of service instance A. Service instance A sends a total of 100 requests to service instance B. Therefore, there are 100 service return times for service instance A, of which 5 service return times exceed the corresponding timeout time. The timeout ratio is 5%.

[0037] S220: Determine a target service instance from multiple upstream service instances based on the time statistical information corresponding to each upstream service instance.

[0038] The disclosed embodiment can pre-set corresponding judgment conditions for time statistical information, and the judgment conditions are used to determine whether the timeout period of each upstream service instance needs to be extended. When the time statistical information corresponding to an upstream service instance meets the judgment condition, the upstream service instance can be determined as the target service instance. It can be understood that the target service instance refers to the service instance whose timeout period needs to be extended. For example, among service instances A to F, the time statistical information corresponding to service instance B and service instance C meets the pre-set judgment conditions, then service instance B and service instance C can be determined as the target service instance, and the timeout period of service instance B and service instance C needs to be extended in subsequent steps.

[0039] Optionally, the time statistics information may include the timeout ratio corresponding to the service return time of each upstream service instance. In step S220, the comparison result of the timeout ratio corresponding to the service return time of each upstream service instance and the standard timeout ratio can be determined; the upstream service instance whose timeout ratio corresponding to the service return time is greater than the standard timeout ratio is determined as the target service instance.

[0040] S230: Adjust a timeout period for at least one target service instance based on the time statistics information and / or importance information corresponding to each target service instance.

[0041] The time statistics information may be information related to some statistical results of the service return time, and may characterize some specified features of the service return time. The importance information of the target service instance is related to the importance of the service result returned by the downstream service instance of the target service instance. The extension time that can be allocated to each target service instance is determined by at least one of the time statistics information and the importance information, so as to adjust the timeout time of the target service instance based on the extension time.

[0042] Optionally, for each target service instance, the embodiment of the present disclosure may determine, based on the time distribution characteristic information corresponding to the target service instance, the time extension time required for the timeout of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio. Then, the total time extension time required for each target service instance may be calculated.

[0043] When it is determined that the total time is not greater than the time balance, the time balance is allocated to the timeout time of each target service instance according to the extension time required by each target service instance.

[0044] When it is determined that the total time is greater than the time balance, the target service instances are sorted in order from high to low importance based on the importance information of each target service instance; then the time balance is allocated to the timeout time of the target service instances with the highest order according to the extension time required for each target service instance.

[0045] The method for controlling the service timeout provided by the embodiment of the present disclosure can automatically determine the target service instance whose timeout needs to be extended based on the time statistics information related to the service return time of the service instance, and calculate the required extension time of the timeout of each target service instance, and adjust the corresponding timeout based on the extension time of the target service instance. Based on the above process, the timeout of the service instance is dynamically adjusted, so that the timeout can continuously maintain a high availability, effectively adapt to real business scenarios, and reduce the risk of failure of the service system due to unreasonable timeout.

[0046] Figure 3 A flow chart of another method for controlling a service timeout provided by an embodiment of the present disclosure is shown. Figure 3 As shown, the method can mainly include the following steps:

[0047] S310: Obtain the timeout ratio corresponding to the service return time of each upstream service instance.

[0048] As mentioned above, each upstream service instance includes multiple upstream service instances. In this step, for each upstream service instance, the embodiment of the present disclosure can obtain the sub-timeout ratio corresponding to the service return time of each upstream service instance in the same upstream service instance; based on multiple sub-timeout ratios, determine the timeout ratio corresponding to the service return time of each upstream service instance. Here, the sub-timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceeds the corresponding timeout time to the total number of service return times of the upstream service instance. By comprehensively considering the timeout situation of the service return time of each upstream service instance in the same upstream service instance, the overall timeout ratio of this upstream service instance can be accurately reflected.

[0049] Specifically, in the process of providing services based on user requests, the service return time of each service instance for each user request can be counted in real time, and the sub-timeout ratio corresponding to the service return time can be calculated, so that when the timeout time of a certain service instance needs to be adjusted, the sub-timeout ratio corresponding to the service return time of each service instance can be obtained in time. For the same upstream service instance, the average value of the sub-timeout ratios corresponding to the service return time of all service instances in the upstream service instance can be calculated, and the average value can be used as the timeout ratio corresponding to the service return time of the upstream service instance.

[0050] S320: Obtain time distribution characteristic information of the service return time of each upstream service instance.

[0051] As mentioned above, each upstream service instance includes multiple upstream service instances. In this step, for each upstream service instance, the embodiment of the present disclosure can obtain the time distribution characteristic sub-information of the service return time of each upstream service instance in the same upstream service instance; based on the multiple time distribution characteristic sub-information, the time distribution characteristic information of the service return time of each upstream service instance is determined. By comprehensively considering the distribution of the service return time of each upstream service instance in the same upstream service instance, the overall time distribution characteristics of this upstream service instance can be accurately reflected.

[0052] Specifically, in the process of the service system providing services based on user requests, the service return time of each service instance for each user request can be counted in real time, and the time distribution feature sub-information corresponding to the service return time can be calculated, so that when the timeout time of a certain service instance needs to be adjusted, the time distribution feature sub-information corresponding to the service return time of each service instance can be obtained in time. For the same upstream service instance, the time distribution feature sub-information corresponding to the service return time of all service instances in the upstream service instance is integrated to obtain the time distribution feature information corresponding to the service return time of the upstream service instance.

[0053] It should be noted that the execution order of step S310 and step S320 is not specific. Step S310 may be executed first and then step S320; or step S320 may be executed first and then step S310; or step S310 and step S320 may be executed simultaneously.

[0054] S330: Determine a comparison result between the timeout ratio corresponding to the service return time of each upstream service instance and the standard timeout ratio.

[0055] The disclosed embodiment may configure a standard timeout ratio for each upstream service instance in advance. In this step, the timeout ratio corresponding to the service return time of each upstream service instance may be compared with the standard timeout ratio. It is understood that the comparison result may include that the timeout ratio corresponding to the service return time of the upstream service instance is greater than the standard timeout ratio, and the timeout ratio corresponding to the service return time of the upstream service instance is not greater than the standard timeout ratio.

[0056] S340: Determine the upstream service instances whose timeout ratio corresponding to the service return time is greater than the standard timeout ratio as target service instances.

[0057] As mentioned above, the target service instance refers to the service instance whose timeout period needs to be extended. It can be understood that when the timeout ratio corresponding to the service return time of a service instance is greater than the standard timeout ratio, it indicates that more service return times of this service instance exceed the corresponding timeout period. Therefore, the timeout period of this service instance needs to be extended in order to reduce the corresponding timeout ratio.

[0058] S350: For each target service instance, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio.

[0059] In the disclosed embodiment, the time distribution characteristic information includes multiple percentile values ​​of the service return time of the upstream service instance. For example, the percentile value is one of the characteristic numbers of a random variable. Divide the area enclosed by the random variable distribution curve and the X-axis into n equal parts, and obtain n-1 values ​​(X_1, X_2...X_(n-1)), which are called n percentile values. For example, a target service instance has 100 service return times, and these 100 service return times are judged in order from small to large. Then the 80th percentile value of the target service instance is the service return time ranked 80th, which can also indicate that among the 100 service return times, 80% of the service times are not greater than the 80th percentile value of the service return time of the target service instance.

[0060] In this step, the minimum quantile value that can ensure that the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio can be screened out from multiple quantile values ​​of the service return time of the upstream service instance; the time difference between the service return time corresponding to the minimum quantile value and the timeout time of the target service instance is calculated, and the time difference is determined as the extension time required for the timeout time of the target service instance.

[0061] For example, the standard timeout ratio is 90%. The standard timeout ratio of 90% means that 90% of the service return times of the expected service instances do not exceed the corresponding timeout time. If a target service instance has 100 service return times, then it is necessary to determine the 90th percentile value of the target service instance, that is, the service return time ranked at the 90th place, and determine the time difference between the 90th service return time and the timeout time of the target service instance as the time required to extend the timeout time of the target service instance. Assuming that the 90th service return time is 0.12 seconds and the timeout time is 0.1 seconds, the time required to extend the timeout time is 0.12 seconds.

[0062] S360: Calculate the total time required for extension of each target service instance.

[0063] In this step, the extension time required for each target service instance is summed up to obtain a time sum, which represents the total extension time required for the timeout time of all target service instances. When the time sum is not greater than the time balance, execute step S370; when the time sum is greater than the time balance, execute step S380. Here, the time balance is the time that can be allocated in the service system. Assuming that a service link guarantees a service return time of 1 second for the user, and the actual return time of the service system is 0.7 seconds, there will be a time balance of 0.3 seconds, which can be allocated to the timeout time of the target service instance, thereby extending the timeout time.

[0064] S370: When it is determined that the total time is not greater than the time balance, the time balance is allocated to the timeout time of each target service instance according to the extension time required by each target service instance.

[0065] In the embodiment of the present disclosure, if the total time is not greater than the time balance, it means that the time balance is sufficient to allocate the required extension time to each target service instance, thereby extending the timeout time of each target service instance.

[0066] S380: When it is determined that the total time is greater than the remaining time, the target service instances are sorted in order of importance from high to low based on the importance information of each target service instance.

[0067] S390: Allocate the remaining time to the timeout time of the target service instance with the highest ranking according to the extension time required by each target service instance.

[0068] In the disclosed embodiment, if the total time is not greater than the time balance, it means that the time balance cannot allocate the required extension time for all types of target service instances, and can only be allocated to some types of service instances preferentially. Therefore, the various target service instances can be sorted according to their importance, and the time balance can be allocated preferentially to the target service instances with high importance.

[0069] As mentioned above, the importance information of the target service instance is related to the importance of the service result returned by the downstream service instance of the target service instance. The importance of the service result can be reflected in the importance of the business to which the service result is applied and the impact of the service result on the user experience. An importance value can be quantified based on the importance and impact of these dimensions to indicate the service.

[0070] After extending the timeout period of some target service instances, the timeout period can be made effective online. In order to ensure stability during the effective period and to prevent the potential impact of unreasonable timeouts on online stability, grayscale release and other means can also be used to achieve phased and sub-data center effectiveness.

[0071] Based on the same principle as the above service timeout control method, Figure 4 A schematic diagram of a device for controlling a service timeout provided by an embodiment of the present disclosure is shown. Figure 4 As shown, the service timeout control device 400 includes an information acquisition module 410 , a target determination module 420 and a timeout adjustment module 430 .

[0072] The information acquisition module 410 is used to obtain time statistics information related to the service return time of each upstream service instance, wherein the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance.

[0073] The target determination module 420 is used to determine a target service instance from a plurality of upstream service instances based on time statistical information corresponding to each upstream service instance.

[0074] The timeout adjustment module 430 is used to adjust the timeout period for at least one target service instance based on the time statistics information and / or importance information corresponding to each target service instance.

[0075] The control device for the service timeout provided by the embodiment of the present disclosure can automatically determine the target service instance whose timeout needs to be extended based on the time statistics information related to the service return time of the service instance, and calculate the extension time required for the timeout of each target service instance, and adjust the corresponding timeout based on the extension time of the target service instance. Based on the above process, the timeout of the service instance is dynamically adjusted, so that the timeout can continuously maintain a high availability, effectively adapt to real business scenarios, and reduce the risk of failure of the service system due to unreasonable timeout.

[0076] In the embodiment of the present disclosure, when the information acquisition module 410 is used to acquire the time statistical information related to the service return time of each upstream service instance, it is specifically used to:

[0077] Obtain the timeout ratio corresponding to the service return time of each upstream service instance, and obtain the time distribution characteristic information of the service return time of each upstream service instance;

[0078] The timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceeds the corresponding timeout period to the total number of service return times of the upstream service instance.

[0079] In the embodiment of the present disclosure, each upstream service instance includes multiple upstream service instances. When the information acquisition module 410 is used to obtain the timeout ratio corresponding to the service return time of each upstream service instance, it is specifically used to:

[0080] For each upstream service instance, obtain the sub-timeout ratio corresponding to the service return time of each upstream service instance in the same upstream service instance;

[0081] Based on multiple sub-timeout ratios, determine the timeout ratio corresponding to the service return time of each upstream service instance;

[0082] The sub-timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceed the corresponding timeout period to the total number of service return times of the upstream service instance.

[0083] In the embodiment of the present disclosure, when the information acquisition module 410 is used to acquire the time distribution characteristic information of the service return time of each upstream service instance, it is specifically used to:

[0084] For each upstream service instance, obtain time distribution characteristic sub-information of the service return time of each upstream service instance in the same upstream service instance;

[0085] Based on the multiple time distribution characteristic sub-information, time distribution characteristic information of the service return time of each upstream service instance is determined.

[0086] In the embodiment of the present disclosure, when the target determination module 420 is used to determine the target service instance from multiple upstream service instances based on the time statistical information corresponding to each upstream service instance, it is specifically used to:

[0087] Determine the comparison result between the timeout ratio corresponding to the service return time of each upstream service instance and the standard timeout ratio;

[0088] The upstream service instances whose timeout ratio corresponding to the service return time is greater than the standard timeout ratio are determined as target service instances.

[0089] In the embodiment of the present disclosure, when the timeout adjustment module 430 is used to adjust the timeout time for at least one target service instance based on the time statistics information and / or importance information corresponding to each target service instance, it is specifically used to:

[0090] For each target service instance, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio;

[0091] Calculate the total time required to extend each target service instance;

[0092] When it is determined that the total time is not greater than the time balance, the time balance is allocated to the timeout time of each target service instance according to the extension time required by each target service instance.

[0093] In the embodiment of the present disclosure, when the timeout adjustment module 430 is used to adjust the timeout time for at least one target service instance based on the time statistics information and / or importance information corresponding to each target service instance, it is specifically used to:

[0094] For each target service instance, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio;

[0095] Calculate the total time required to extend each target service instance;

[0096] When it is determined that the total time is greater than the remaining time, the target service instances are sorted in order of importance from high to low based on the importance information of each target service instance;

[0097] The remaining time is allocated to the timeout time of the target service instances with the highest ranking according to the extension time required by each target service instance.

[0098] In the disclosed embodiment, the time distribution characteristic information includes multiple quantile values ​​of the service return time of the upstream service instance;

[0099] The timeout adjustment module 430 is used to determine, based on the time distribution characteristic information corresponding to the target service instance, that the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio, and the time required to extend the timeout period of the target service instance, specifically to:

[0100] From multiple quantile values ​​of the service return time of the upstream service instance, a minimum quantile value that can ensure that the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio is selected;

[0101] The time difference between the service return time corresponding to the minimum quantile value and the timeout time of the target service instance is calculated, and the time difference is determined as the extension time required for the timeout time of the target service instance.

[0102] It can be understood that the above-mentioned modules of the service timeout control device in the embodiment of the present disclosure have the function of implementing the corresponding steps of the above-mentioned service timeout control method. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The above-mentioned modules can be software and / or hardware, and the above-mentioned modules can be implemented separately or integrated by multiple modules. For the functional description of each module of the above-mentioned service timeout control device, please refer to the corresponding description of the above-mentioned service timeout control method, which will not be repeated here.

[0103] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0104] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0105] Figure 5 A schematic block diagram of an example electronic device that can be used to implement a method for controlling a service timeout provided by an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0106] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0107] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0108] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a control method for a service timeout. For example, in some embodiments, the control method for a service timeout may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the control method for the service timeout described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a control method for a service timeout by any other appropriate means (e.g., by means of firmware).

[0109] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0110] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0111] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0113] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0114] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0116] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for controlling a service timeout, comprising: Obtaining time statistics information related to the service return time of each upstream service instance, wherein the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance; Based on the time statistical information corresponding to each upstream service instance, determining a target service instance from a plurality of upstream service instances; the time statistical information includes time distribution characteristic information and timeout ratio; For each of the target service instances, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio; Calculate the total time required for the extension of each target service instance; When it is determined that the total time is not greater than the time balance, the time balance is allocated to the timeout time of each target service instance according to the extension time required by each target service instance.

2. The control method according to claim 1, wherein: The time statistics information related to the service return time of each upstream service instance is obtained, including: Obtain the timeout ratio corresponding to the service return time of each upstream service instance, and obtain the time distribution characteristic information of the service return time of each upstream service instance; The timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceeds the corresponding timeout period to the total number of service return times of the upstream service instance.

3. According to the control method of claim 2, each upstream service instance includes multiple upstream service instances, and the step of obtaining the timeout ratio corresponding to the service return time of each upstream service instance includes: For each upstream service instance, obtain the sub-timeout ratio corresponding to the service return time of each upstream service instance in the same upstream service instance; Based on the multiple sub-timeout ratios, determining the timeout ratio corresponding to the service return time of each upstream service instance; The sub-timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceed the corresponding timeout period to the total number of service return times of the upstream service instance.

4. The control method according to claim 2, wherein: The obtaining of time distribution characteristic information of the service return time of each upstream service instance includes: For each upstream service instance, obtain time distribution characteristic sub-information of the service return time of each upstream service instance in the same upstream service instance; Based on the multiple time distribution characteristic sub-information, time distribution characteristic information of the service return time of each upstream service instance is determined.

5. The control method according to claim 2, wherein: The determining a target service instance from a plurality of upstream service instances based on the time statistical information corresponding to each upstream service instance includes: Determine a comparison result between a timeout ratio corresponding to a service return time of each upstream service instance and a standard timeout ratio; The upstream service instance whose timeout ratio corresponding to the service return time is greater than the standard timeout ratio is determined as the target service instance.

6. The control method according to claim 1, wherein: The method further comprises: For each of the target service instances, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio; Calculate the total time required for the extension of each target service instance; When it is determined that the total time is greater than the remaining time, the target service instances are sorted in order of importance from high to low based on the importance information of each target service instance; The time balance is allocated to the timeout time of the target service instances with the highest ranking according to the extension time required by each target service instance.

7. According to the control method of claim 6, the time distribution characteristic information includes a plurality of percentile values ​​of the service return time of the upstream service instance; When it is determined based on the time distribution characteristic information corresponding to the target service instance that the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio, the time required to extend the timeout period of the target service instance includes: From a plurality of quantile values ​​of the service return time of the upstream service instance, a minimum quantile value capable of ensuring that the timeout ratio of the target service instance is not greater than a corresponding standard timeout ratio is selected; The time difference between the service return time corresponding to the minimum quantile value and the timeout time of the target service instance is calculated, and the time difference is determined as the extension time required for the timeout time of the target service instance.

8. A device for controlling a service timeout, comprising: An information acquisition module, used to acquire time statistics information related to the service return time of each upstream service instance, wherein the service return time is the time taken by the upstream service instance to receive the service result returned by the corresponding downstream service instance; A target determination module, configured to determine a target service instance from a plurality of upstream service instances based on the time statistical information corresponding to each upstream service instance; The time statistics information includes time distribution characteristic information and timeout ratio; A timeout adjustment module is used to determine, for each target service instance, based on the time distribution characteristic information corresponding to the target service instance, the time extension time required for the timeout time of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio; calculate the total time of the extension time required for each target service instance; and when it is determined that the total time is not greater than the time balance, allocate the time balance to the timeout time of each target service instance according to the extension time required for each target service instance.

9. The control device according to claim 8, wherein: When the information acquisition module is used to acquire time statistics information related to the service return time of each upstream service instance, it is specifically used to: Obtain the timeout ratio corresponding to the service return time of each upstream service instance, and obtain the time distribution characteristic information of the service return time of each upstream service instance; The timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceeds the corresponding timeout period to the total number of service return times of the upstream service instance.

10. The control device according to claim 9, each upstream service instance comprises a plurality of upstream service instances, and the information acquisition module, when used to acquire the timeout ratio corresponding to the service return time of each upstream service instance, is specifically used to: For each upstream service instance, obtain the sub-timeout ratio corresponding to the service return time of each upstream service instance in the same upstream service instance; Based on the multiple sub-timeout ratios, determining the timeout ratio corresponding to the service return time of each upstream service instance; in, The sub-timeout ratio corresponding to each upstream service instance is the ratio of the number of service return times of the upstream service instance that exceed the corresponding timeout period to the total number of service return times of the upstream service instance.

11. The control device according to claim 9, wherein: When the information acquisition module is used to acquire the time distribution characteristic information of the service return time of each upstream service instance, it is specifically used to: For each upstream service instance, obtain time distribution characteristic sub-information of the service return time of each upstream service instance in the same upstream service instance; Based on the multiple time distribution characteristic sub-information, time distribution characteristic information of the service return time of each upstream service instance is determined.

12. The control device according to claim 9, wherein: When the target determination module is used to determine a target service instance from a plurality of upstream service instances based on the time statistical information corresponding to each upstream service instance, it is specifically used to: Determine a comparison result between a timeout ratio corresponding to a service return time of each upstream service instance and a standard timeout ratio; The upstream service instance whose timeout ratio corresponding to the service return time is greater than the standard timeout ratio is determined as the target service instance.

13. The control device according to claim 9, wherein: The timeout adjustment module is also specifically used for: For each of the target service instances, based on the time distribution characteristic information corresponding to the target service instance, determine the time required to extend the timeout period of the target service instance when the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio; Calculate the total time required for the extension of each target service instance; When it is determined that the total time is greater than the remaining time, the target service instances are sorted in order of importance from high to low based on the importance information of each target service instance; The time balance is allocated to the timeout time of the target service instances with the highest ranking according to the extension time required by each target service instance.

14. The control device according to claim 13, wherein the time distribution characteristic information comprises a plurality of percentile values ​​of the service return time of the upstream service instance; The timeout adjustment module is used to determine, based on the time distribution characteristic information corresponding to the target service instance, that the timeout ratio of the target service instance is not greater than the corresponding standard timeout ratio, and the time required to extend the timeout time of the target service instance, specifically to: From a plurality of quantile values ​​of the service return time of the upstream service instance, a minimum quantile value capable of ensuring that the timeout ratio of the target service instance is not greater than a corresponding standard timeout ratio is selected; The time difference between the service return time corresponding to the minimum quantile value and the timeout time of the target service instance is calculated, and the time difference is determined as the extension time required for the timeout time of the target service instance.

15. An electronic device, comprising: at least one processor; as well as A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Self-adaptive large-scale cluster communication system and self-adaptive large-scale cluster communication method

    CN102917068A

  • Overload protection system and method for server

    CN104182282A