CN110784478B - Method, device, equipment and computer readable storage medium for adjusting timeout duration - Google Patents

Method, device, equipment and computer readable storage medium for adjusting timeout duration Download PDF

Info

Publication number
CN110784478B
CN110784478B CN201911057188.2A CN201911057188A CN110784478B CN 110784478 B CN110784478 B CN 110784478B CN 201911057188 A CN201911057188 A CN 201911057188A CN 110784478 B CN110784478 B CN 110784478B
Authority
CN
China
Prior art keywords
time
consuming
duration
value
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911057188.2A
Other languages
Chinese (zh)
Other versions
CN110784478A (en
Inventor
陈昭
江旻
杨杨
徐为恺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201911057188.2A priority Critical patent/CN110784478B/en
Publication of CN110784478A publication Critical patent/CN110784478A/en
Application granted granted Critical
Publication of CN110784478B publication Critical patent/CN110784478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Technology Law (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method, a device, equipment and a computer readable storage medium for adjusting timeout duration, which relate to the field of financial science and technology, and the method comprises the following steps: acquiring a segmentation interval duration in a time interval queue corresponding to a cross-system call, and calculating a time interval average value of time consumption differences in a time interval queue corresponding to the time interval statistics array; calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the time interval queue, and calculating a time-consuming average value of the corresponding transaction of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value; calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value; and adjusting the timeout duration of the next transaction across the system according to the timeout duration. The method and the device improve the accuracy of determining the transaction timeout duration corresponding to the cross-system call.

Description

Method, device, equipment and computer readable storage medium for adjusting timeout duration
Technical Field
The present invention relates to the field of data processing technologies in financial technologies (Fintech), and in particular, to a method, an apparatus, a device, and a computer readable storage medium for adjusting a timeout period.
Background
With the continuous development of financial technology, especially internet technology finance, more and more technologies (such as distributed, blockchain Blockchain, artificial intelligence, etc.) are applied in the finance field, but the finance industry also puts higher demands on technologies, such as data processing in the cross-system call process of the finance industry.
Cross-system call refers to transaction requests and responses between two different systems through a network. The timeout period is the maximum waiting period from the time when the transaction request party sends out the request transaction message to the time when the transaction response party receives the transaction response message sent by the transaction response party. The current method for setting the timeout period is that a transaction requester inquires and counts the processing period required by the normal transaction of a transaction responder, and then the processing period is set as the timeout period. However, it is considered that the processing capability of the transaction responder is not accurate enough, uncertainty exists, and many other factors influence the timeout duration, such as different resource environments operated by the transaction responder may influence the transaction processing duration, the concurrent transaction amount of the transaction responder may influence the transaction processing duration, the current network bandwidth environment of the transaction responder may influence the transmission duration of the transaction responder in sending the transaction response message to the transaction request, the terminal transaction responder adjusts the transaction processing duration on one synchronous transaction call chain, and the timeout durations on all transaction chains may be influenced, for example, a calls B, B calls C, C calls D, and if the transaction processing duration of D is adjusted, the call timeout durations of A, B and C may be changed. Therefore, the accuracy rate of the currently determined timeout duration corresponding to the cross-system call is low.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a computer readable storage medium for adjusting timeout duration, and aims to solve the technical problem that the accuracy of the timeout duration of the corresponding transaction of the existing determined cross-system call is low.
In order to achieve the above object, the present invention provides a method for adjusting a timeout period, the method for adjusting a timeout period comprising the steps of:
acquiring a segmentation interval duration in a time interval queue corresponding to a cross-system call, and calculating a time interval average value of time consumption differences in a time interval queue corresponding to the time interval statistics array;
Calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the time interval queue, and calculating a time-consuming average value of the corresponding transaction of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value;
Calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value;
and adjusting the timeout duration of the next transaction across the system according to the timeout duration.
Preferably, before the step of acquiring the interval duration of the segments in the corresponding time-consuming statistics array, the method further includes:
acquiring a current time-consuming time length corresponding to a current transaction by cross-system call, and judging whether the current time-consuming time length is greater than a preset timeout time length;
If the current time consumption is longer than the preset timeout period, determining the sum of the preset timeout period and the segmentation interval period as the transaction time consumption period of the current transaction, and storing the transaction time consumption period into a time consumption period queue of the time consumption statistics array;
If the current time-consuming duration is smaller than or equal to the preset timeout duration, determining the current time-consuming duration as the transaction time-consuming duration of the current transaction, and storing the transaction time-consuming duration into a time-consuming duration queue of the time-consuming statistics array.
Preferably, before the step of acquiring the interval duration of the segments in the corresponding time-consuming statistics array, the method further includes:
Determining timeout data corresponding to timeout transactions in each time-consuming time length queue and each occurrence time queue in the time-consuming statistics array, acquiring current occurrence time corresponding to current transactions in cross-system call, and acquiring a time period corresponding to the occurrence time queue;
determining a target time according to the time period and the current occurrence time;
Deleting the occurrence time smaller than the target time in the occurrence time queue corresponding to the current transaction, and deleting the time-consuming time corresponding to the occurrence time smaller than the target time in the time-consuming time length queue corresponding to the current transaction;
And deleting the time-consuming difference value corresponding to the occurrence time smaller than the target time in the time interval queue, and deleting the time-consuming duration queue and the overtime data in the occurrence time queue.
Preferably, before the step of calculating the time interval average value of the time consumption difference values in the time interval queue corresponding to the time consumption statistics array, the method further includes:
Calculating the time consumption difference between the time consumption duration corresponding to the current transaction of the cross-system call and the time consumption duration corresponding to the last cross-system call, and adding the time consumption difference into the time interval queue.
Preferably, the step of calculating a time-consuming trend proportion value of corresponding transactions across system calls according to the time interval queue comprises:
marking each time consumption difference value in the time interval queue as a first target difference value, and marking the next time consumption difference value corresponding to the target difference value as a second target difference value;
Subtracting the corresponding first target difference value from the second target difference value to obtain a time length difference value of the time interval queue;
and calculating the number of elements of the time-consuming difference value in the time interval queue, and calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the number of elements and the time length difference value.
Preferably, the step of calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the element number and the time length difference value comprises the following steps:
detecting whether the time length difference is greater than zero or not to obtain a detection result, and determining a mapping value corresponding to each time length difference according to the detection result;
Adding the mapping values corresponding to the time length difference values to obtain a time interval trend value of the corresponding transaction of the cross-system call;
Dividing the time interval trend value by the number of elements to obtain the time-consuming trend proportion value of the corresponding transaction of the cross-system call.
Preferably, the step of calculating a time-consuming average value of corresponding transactions across system calls according to the time-consuming statistics array and the time-consuming trend proportion value comprises:
Calculating the transaction quantity to be counted according to the time-consuming statistic array and the time-consuming trend proportion value;
And calculating a time-consuming average value of corresponding transactions of the cross-system call according to the time-consuming trend proportion value and the number of the transactions to be counted.
Preferably, the step of calculating the number of transactions to be counted according to the time-consuming statistics array and the time-consuming trend proportion value includes:
Calculating the total time consumption amount of the time-consuming time length queues in the time-consuming statistics array, and obtaining the absolute value of the time-consuming trend proportion value;
subtracting the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiplying the proportion difference value by the total time consumption to obtain the transaction quantity to be counted.
Preferably, the step of calculating the time-consuming average value of the corresponding transactions of the cross-system call according to the time-consuming trend proportion value and the number of the transactions to be counted comprises the following steps:
detecting whether the time interval trend value corresponding to the time consuming trend proportion value is larger than zero or not;
if the time interval trend value is greater than zero, starting to take time duration from the last time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
If the time interval trend value is smaller than zero, starting to take time duration from a first time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
And calculating the average value of the time-consuming time durations in the target time-consuming time duration queue to obtain the time-consuming average value of the corresponding transactions of the cross-system call.
Preferably, the step of calculating a timeout period according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value includes:
the time interval duration is marked as S, the time interval average value is marked as AI, the time consuming trend proportion value is marked as SL, the time consuming average value is marked as AT, and the timeout duration is marked as T;
calculating to obtain the timeout duration by adopting a preset timeout duration calculation formula, wherein the timeout duration calculation formula is as follows: t=at+ai+s×sl.
In addition, in order to achieve the above object, the present invention further provides an apparatus for adjusting a timeout period, where the apparatus for adjusting a timeout period includes:
The acquisition module is used for acquiring the segment interval duration in the corresponding time-consuming statistic array of cross-system call; the calculation module is used for calculating the time interval average value of the time consumption difference value in the time interval queue corresponding to the time consumption statistic array; calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the time interval queue, and calculating a time-consuming average value of the corresponding transaction of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value; calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value;
and the adjusting module is used for adjusting the timeout duration of the next transaction in a cross-system manner according to the timeout duration.
In addition, in order to achieve the above object, the present invention further provides an apparatus for adjusting a timeout period, where the apparatus for adjusting a timeout period includes a memory, a processor, and an adjustment program for the timeout period stored in the memory and capable of running on the processor, and the adjustment program for the timeout period implements the steps of the method for adjusting a timeout period as described above when executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an adjustment program for a timeout period, which when executed by a processor, implements the steps of the adjustment method for a timeout period as described above.
The method comprises the steps of obtaining a segment interval duration in a corresponding time-consuming statistics array of cross-system call, calculating a time interval average value of time-consuming difference values in a time interval queue corresponding to the time-consuming statistics array, calculating a time-consuming trend proportion value of the cross-system call according to the time interval queue, calculating a time-consuming average value of corresponding transactions of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value, calculating a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value, and adjusting the timeout duration of the next transaction of the cross-system call according to the timeout duration. The method and the device realize that the timeout duration of the next transaction of the cross-system call is adjusted according to the change trend of the corresponding time-consuming duration of the transaction in the cross-system call along with the change of the transaction processing duration of the cross-system call, and improve the accuracy of determining the timeout duration of the corresponding transaction of the cross-system call.
Drawings
FIG. 1 is a flowchart of a first embodiment of a method for adjusting a timeout period according to the present invention;
FIG. 2 is a functional schematic block diagram of a preferred embodiment of the timeout period adjustment device of the present invention;
FIG. 3 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a method for adjusting timeout duration, referring to fig. 1, fig. 1 is a flow chart of a first embodiment of the method for adjusting timeout duration of the invention.
The embodiments of the present invention provide embodiments of a method for adjusting a timeout period, and it should be noted that although a logic sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown or described herein.
The method for adjusting the timeout duration comprises the following steps:
step S10, obtaining a segment interval duration in a corresponding time-consuming statistic array of cross-system call, and calculating a time interval average value of time-consuming difference values in a time interval queue corresponding to the time-consuming statistic array.
And after the transaction requesting party and the transaction answering party which are called by the cross-system complete the current transaction, acquiring the segmentation interval duration in the time-consuming statistic array corresponding to the transaction in the cross-system calling process. The time-consuming statistics array is used for recording timeout data in the process of executing the transaction by the transaction requester and the transaction responder in a period of time, specifically, the time-consuming statistics array comprises a plurality of sub-statistics arrays, the time interval between any two adjacent sub-statistics arrays is equal to the segment interval duration, namely, the segment interval duration refers to the interval duration between each sub-statistics array in the time-consuming statistics array, and the time-consuming statistics array is divided into a plurality of sub-statistics arrays by the segment interval duration in the embodiment.
In the time-consuming statistics array, each sub-statistics array comprises a minimum time-consuming time length, a maximum time-consuming time length, a time-consuming time length queue and an occurrence time queue. Within the time period of each sub-statistics array correspondingly stored in the time period queue, the time period of corresponding transaction is called across the system; the occurrence time queue stores the occurrence time of corresponding transactions in the corresponding time period of each sub-statistics array, and the cross-system call is performed. After the time consuming statistics array is built, initializing the time consuming statistics array. In this embodiment, the duration and the segment interval duration corresponding to the time-consuming statistics array may be set according to specific needs, and the size of the duration and the segment interval duration corresponding to the time-consuming statistics array is not limited in this embodiment. It can be appreciated that the duration corresponding to each sub-statistics array can be determined according to the time-consuming statistics array and the segmentation interval duration.
Specifically, if the time-consuming statistics array is denoted as a, the length of the time-consuming statistics array, that is, the number of sub-statistics arrays corresponding to the time-consuming statistics array is denoted as N, the segment interval time is denoted as S, the minimum time-consuming time in the time-consuming time queue is denoted as MinT, the maximum time-consuming time in the time-consuming time queue is denoted as MaxT, the time-consuming time queue is denoted as QR, the occurrence time queue is denoted as QT, the initialized minimum time-consuming time is an.mint=n×s, the initialized maximum time-consuming time is an.maxt= (n+1) ×s, N is the array position of the sub-statistics array in the time-consuming statistics array, n=1, 2,3,4,5, …, N; and initializing the QR and the QT into a first-in first-out queue, namely, storing the sequence of the data stored in the QR and the QT according to the time sequence. It can be understood that the minimum time duration of the first sub-statistics array in the time-consuming statistics array is a1.mint= 1*S =s, the maximum time duration QR and qta1.maxt= (1+1) ×s=2s; the minimum time duration a4.mint= 4*S =4s, the maximum time duration a 1.maxt= (4+1) ×s=5s, and so on for the fourth sub-statistics array in the time-consuming statistics array.
After the transaction request party and the transaction response party which are called by the cross-system complete the current transaction, obtaining time difference of each time consumption in the time interval queue corresponding to the time consumption statistic array, calculating the time difference number of the time difference of each time consumption in the time interval queue, calculating the sum of the time difference of each time consumption in the time interval queue, and dividing the sum of the time difference of each time consumption by the time difference number to obtain the time interval average value of the time difference value in the time interval queue. It should be noted that, a time-consuming statistics array corresponds to a time interval queue, and the time interval queue stores time-consuming differences of time spent in corresponding transaction time-consuming durations of two times of cross-system calls. If the sum of the time differences of all the time consuming times in the time interval queue is smaller than zero, dividing the absolute value of the sum of the time differences of all the time consuming times by the number of the time differences in the process of calculating the average value of the time interval to obtain the average value of the time interval of the time difference of the time interval queue. If the time-consuming duration of the corresponding transaction of the first cross-system call is 300, the time-consuming duration of the corresponding transaction of the second cross-system call is 400, and the time-consuming duration of the corresponding transaction of the third cross-system call is 250, the time difference of the first time consuming time in the time interval queue is calculated to be 400-300=100, and the time difference of the second time consuming time in the time interval queue is calculated to be 250-400= -150.
Step S20, calculating a time consumption trend proportion value of the corresponding transaction of the cross-system call according to the time interval queue, and calculating a time consumption average value of the corresponding transaction of the cross-system call according to the time consumption statistics array and the time consumption trend proportion value.
Calculating time interval trend values in the cross-system calling process according to the time interval queues, calculating time consuming trend proportion values of corresponding transactions in the cross-system calling process according to the time interval trend values and the time interval queues, and calculating time consuming average values of corresponding transactions in the cross-system calling process according to the time consuming statistic array and the time consuming trend proportion values.
Further, the step of calculating a time-consuming trend proportion value of cross-system calls according to the time interval queue comprises the following steps:
And a step a, marking each time consumption difference value in the time interval queue as a first target difference value, and marking the next time consumption difference value corresponding to the target difference value as a second target difference value.
And b, subtracting the corresponding first target difference value from the second target difference value to obtain a time length difference value of the time interval queue.
And c, calculating the number of elements of the time-consuming difference value in the time interval queue, and calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the number of elements and the time length difference value.
Specifically, each time-consuming difference value in the time interval queue is marked as a first target difference value, the next time-consuming difference value corresponding to the target difference value is marked as a second target difference value, and the first target difference value is subtracted from the second target difference value to obtain the time length difference value of the time interval queue. If the time interval queue is { A1, A2, A3, A4, A5}, the resulting time duration difference is A2-A1, A3-A2, A4-A3, and A5-A4. After the time length difference value of the time interval queue is calculated, the number of elements of the time consumption difference value in the time interval queue is calculated, and the time consumption trend proportion value of corresponding transactions in the cross-system calling process is calculated according to the number of elements and the time length difference value. The number of elements of the time-consuming difference value in the time interval queue is the number of the time-consuming difference value in the time interval queue, for example, the number of elements of the time-consuming difference value in the time interval queue { A1, A2, A3, A4, A5} is 5.
Further, the step of calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the element number and the time length difference value comprises the following steps:
Step c1, detecting whether the time length difference is larger than zero, obtaining a detection result, and determining a mapping value corresponding to each time length difference according to the detection result.
Specifically, after the time length difference value of the time interval queue is calculated, whether the time length difference value corresponding to the time interval queue is larger than zero or not is detected, and a detection result is obtained. It will be appreciated that in this embodiment, there are three detection results, the first is that the duration difference is greater than zero, the second is that the duration difference is less than zero, and the third is that the duration difference is equal to zero. If the detection result is that the time length difference value is greater than zero, determining that a mapping value corresponding to the time length difference value greater than zero is a first numerical value; if the detection result is that the time length difference value is smaller than zero, determining that a mapping value corresponding to the time length difference value smaller than zero is a second numerical value; if the detection result is that the time length difference value is equal to zero, determining that the mapping value corresponding to the time length difference value equal to zero is 0. The first value and the second data are added to be equal to 0, the first value is a positive value, and the second value is a negative value, for example, the first value can be set to 1, the second value can be set to-1, or the first value can be set to 2, and the second value can be set to-2. In the present embodiment, the specific sizes of the first and second values are not limited.
And c2, adding the mapping values corresponding to the time length difference values to obtain a time interval trend value of the corresponding transaction of the cross-system call.
After the mapping values corresponding to the time length differences are determined, the mapping values corresponding to the time length differences are added to obtain time interval trend values corresponding to transactions in the cross-system calling process. The time interval trend value is greater than zero, which indicates that the time-consuming time length of the corresponding transaction is in an ascending state in the cross-system calling process, namely the time-consuming time length of executing the corresponding transaction is increased in the cross-system calling process; when the time interval trend value is smaller than zero, the time-consuming time length of the corresponding transaction is in a descending state in the cross-system calling process, namely, the time-consuming time length of executing the corresponding transaction is reduced in the cross-system calling process.
And c3, dividing the time interval trend value by the number of elements to obtain the time-consuming trend proportion value of the corresponding transaction of the cross-system call.
When the time interval trend value corresponding to the transaction in the cross-system calling process is calculated, dividing the time interval trend value by the number of elements to obtain the time consuming trend proportion value corresponding to the transaction in the cross-system calling process. Specifically, if the time interval queue is denoted as TS, the time interval trend value is denoted as SI, the time consumption trend proportion value is denoted as SL, the number of elements of the time consumption difference in the time interval queue is denoted as ts.size, the first value is denoted as 1, the second value is denoted as-1, sl=si/ts.size, si=sum (TSn <0.
Further, the step of calculating a time-consuming average value of corresponding transactions across system calls according to the time-consuming statistics array and the time-consuming trend proportion value comprises:
and d, calculating the number of the transactions to be counted according to the time-consuming statistic array and the time-consuming trend proportion value.
And after the time-consuming trend proportion value is calculated, calculating the transaction quantity to be counted according to the time-consuming statistics array and the time-consuming average value calculated by the time-consuming trend proportion value, namely calculating the transaction quantity corresponding to the cross-system call participating in counting.
Further, step d comprises:
And d1, calculating the total time consumption amount of the time-consuming time length queues in the time-consuming statistics array, and obtaining the absolute value of the time-consuming trend proportion value.
Specifically, the total time consumption amount of the time consumption duration in the time consumption duration queues in the time consumption statistics array is calculated, the total time consumption amount is equal to the sum of the time consumption duration amounts stored in the time consumption duration queues of each sub-statistics array, and the absolute value of the time consumption trend proportion value is obtained. If the number of time consuming durations stored in the time consuming duration queue of each sub-statistics array is 5 when there are 10 sub-statistics arrays in total, the total number of time consuming durations is 50. It is understood that the number of time-consuming durations stored by each time-consuming duration queue may or may not be equal.
And d2, subtracting the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiplying the proportion difference value by the total time consumption to obtain the transaction quantity to be counted.
Subtracting the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiplying the proportion difference value by the total time consumption to obtain the transaction quantity to be counted. Specifically, if an.qr.size is used to represent the number of time-consuming durations in the nth time-consuming duration queue, abs (SL) is used to represent the absolute value of the proportion value of the time-consuming trend, and ATN is used to represent the number of transactions to be counted, the number of transactions to be counted atn=sum (a 1.qr.size+a2.qr.size+ … +an.qr.size) ×1-abs (SL)), where 1-abs (SL) is the proportion difference.
And e, calculating a time-consuming average value of corresponding transactions in the cross-system call according to the time-consuming trend proportion value and the transaction quantity to be counted.
And after the transaction quantity to be counted is calculated, calculating a time-consuming average value of corresponding transactions in a cross-system calling process according to the time-consuming trend proportion value and the transaction quantity to be counted.
Further, the step e includes:
And e1, detecting whether the time interval trend value corresponding to the time consumption trend proportion value is larger than zero.
And e2, if the time interval trend value is greater than zero, starting to take the time-consuming time from the last time-consuming time queue in the time-consuming statistics array until the number of the time-consuming time is equal to the number of the transactions to be counted, and determining a target time-consuming time queue in which the time-consuming time is located.
After the time-consuming trend proportion value is calculated, whether the time interval trend value required by calculating the time-consuming trend proportion value is larger than zero or not is detected. If the time interval trend value is detected to be greater than zero, starting to take the time-consuming time from the last time-consuming time queue in the time-consuming statistics array until the number of the time-consuming time is equal to the number of the transactions to be counted, and determining a target time-consuming time queue in which the time-consuming time is located. If 10 time-consuming duration queues exist in the time-consuming statistics array, namely A1.QR, A2.QR, …, A10.QR and A10.QR respectively store 3 time-consuming durations, A9.QR stores 5 time-consuming durations, A8.QR stores 4 time-consuming durations, 3 time-consuming durations are selected from A10.QR when the transaction quantity is 10 to be counted, 5 time-consuming durations are selected from A9.QR, 2 time-consuming durations are selected from A8.QR, and the determined target time-consuming duration queues are A8.QR, A9.QR and A10.QR.
And e3, if the time interval trend value is smaller than zero, starting to take the time-consuming time from the first time-consuming time queue in the time-consuming statistics array until the number of the time-consuming time to be taken is equal to the number of the transactions to be counted, and determining a target time-consuming time queue in which the time-consuming time to be taken is located.
And e4, calculating an average value corresponding to the time-consuming time duration in the target time-consuming time duration queue, and obtaining a time-consuming average value corresponding to the transaction of the cross-system call.
If the time interval trend value is detected to be smaller than zero, starting to take the time consuming time from the first time consuming time queue in the time consuming statistics array until the number of the time consuming time is equal to the number of the transactions to be counted, and determining a target time consuming time queue in which the time consuming time is located. After the target time-consuming time length queue is determined, calculating an average value corresponding to the time-consuming time length in the target time-consuming time length queue, and obtaining a time-consuming average value corresponding to the transaction in the cross-system calling process. It should be noted that, in the process of calculating the average value of the time-consuming durations in the target time-consuming duration queue, the average value corresponding to all the time-consuming durations in the target time-consuming duration queue is calculated, regardless of whether the time-consuming durations in the target time-consuming duration queue are selected or not. As in the example above, the target time duration queues are a8.qr, a9.qr, and a10.qr, and even though 2 time durations in a8.qr are not selected, in the process of calculating the time duration average, the average of the total 12 time durations of a8.qr, a9.qr, and a10.qr is calculated.
If the time-consuming average value is denoted by AT, at=avg (an.qran-1.qr, …, ax.qr) when the time-interval trend value SI >0, where the size of x in sum (an.qr.size, an-1.qr.size, … Ax-1.qr.size) < ATN < sum (an.qr.size, an-1.qr.size, …, ax.qr.size; at=avg (a 1.qr, a2.qr, …, ax.qr) when the time-interval trend value SI <0, where the size of x in sum (A1.QR.size, A2.QR.size, …, ax-1.qr.size) < ATN < sum (A1.QR.size, A2.QR.size, …, ax.qr.size) is determined by the determined target time-consuming time-length queue, and may also be determined according to the number of time-consuming time-durations and the number of transactions to be counted in each time-consuming time-length queue.
And step S30, calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value.
Step S40, adjusting the timeout duration of the next transaction in a cross-system manner according to the timeout duration.
After the segment interval duration, the time interval average value, the time consumption trend proportion value and the time consumption average value are obtained, the timeout duration is calculated according to the segment interval duration, the time interval average value, the time consumption trend proportion value and the time consumption average value, and the timeout duration of the next transaction in the cross-system calling process is adjusted according to the calculated timeout duration, namely the timeout duration of the next transaction in the cross-system calling process is adjusted to the calculated timeout duration.
Further, step S30 includes:
And f, marking the time interval duration of the segmentation as S, marking the average value of the time intervals as AI, marking the proportion value of the time-consuming trend as SL, marking the average value of the time consumption as AT, and marking the time-out duration as T.
Step g, calculating to obtain the timeout length by adopting a preset timeout length calculation formula, wherein the timeout length calculation formula is as follows: t=at+ai+s×sl.
Specifically, if the segment interval duration is marked as S, the time interval average value is marked as AI, the time consuming trend proportion value is marked as SL, the time consuming average value is marked as AT, the timeout duration is marked as T, and the timeout duration is calculated by adopting a preset timeout duration calculation formula, wherein the preset timeout duration calculation formula is as follows: t=at+ai+s×sl.
The method comprises the steps of obtaining a segment interval duration in a corresponding time-consuming statistics array of cross-system call, calculating a time interval average value of time-consuming difference values in a time interval queue corresponding to the time-consuming statistics array, calculating a time-consuming trend proportion value of the cross-system call according to the time interval queue, calculating a time-consuming average value of corresponding transactions of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value, calculating a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value, and adjusting the timeout duration of the next transaction of the cross-system call according to the timeout duration. The method and the device realize that the timeout duration of the next transaction of the cross-system call is adjusted according to the change trend of the corresponding time-consuming duration of the transaction in the cross-system call along with the change of the transaction processing duration of the cross-system call, and improve the accuracy of determining the timeout duration of the corresponding transaction of the cross-system call.
Further, a second embodiment of the method for adjusting the timeout period of the present invention is provided.
The second embodiment of the timeout period adjustment method is different from the first embodiment of the timeout period adjustment method in that the timeout period adjustment method further includes:
And h, acquiring the current time-consuming time length corresponding to the current transaction by cross-system call, and judging whether the current time-consuming time length is greater than a preset timeout time length.
When the cross-system call executes the transaction, acquiring the current time-consuming time length corresponding to the current transaction of the cross-system call, and judging whether the current time-consuming time length is greater than the preset timeout time length. It will be appreciated that the preset timeout period may be set according to specific needs, and the preset timeout period is not particularly limited in this embodiment.
And i, if the current time consumption is longer than the preset time-out time length, determining the sum of the preset time-out time length and the segmentation interval time length as the transaction time consumption time length of the current transaction, and storing the transaction time consumption time length into a time consumption time length queue of the time consumption statistics array.
If the current time consumption period is determined to be longer than the preset time-out period, calculating the sum of the preset time-out period and the segment interval period, determining the sum of the preset time-out period and the segment interval period as the time consumption and time consumption of the current transaction, and storing the time consumption and time consumption of the transaction into a time consumption period queue of a time consumption statistics array corresponding to the time period.
And step k, if the current time-consuming time length is smaller than or equal to the preset timeout time length, determining the current time-consuming time length as the transaction time-consuming time length of the current transaction, and storing the transaction time-consuming time length into a time-consuming time length queue of the time-consuming statistics array.
If the current time-consuming time length is less than or equal to the preset timeout time length, the current time-consuming time length is determined to be the transaction time-consuming time length of the current transaction, and the transaction time-consuming time length is stored in a time-consuming time length queue of the time-consuming statistics array corresponding to the time period. It will be appreciated that the transaction time period is greater than the minimum time period in the time period queue and less than the maximum time period in the time period queue.
According to the method, when the current time consumption is longer than the preset timeout period, the sum of the preset timeout periods and the segmentation interval period is determined to be the transaction time consumption period of the current transaction, when the current time consumption period is smaller than or equal to the preset timeout period, the current transaction time consumption is determined to be the transaction time consumption period of the current transaction, and the transaction time consumption period is stored in the time consumption period queue of the time consumption statistics array, so that in the cross-system calling process, whether the time consumption period of the current transaction is longer than the preset timeout period or not is stored in the time consumption period queue of the time consumption statistics array, and the accuracy of determining the corresponding transaction timeout period of the cross-system call is further improved.
Further, the method for adjusting the timeout period further includes:
Step l, calculating a time consumption difference value between the time consumption time length corresponding to the current transaction of the cross-system call and the time consumption time length corresponding to the last cross-system call, and adding the time consumption difference value into the time interval queue.
Further, after the time-consuming duration corresponding to the current transaction of the cross-system call is obtained, calculating a difference value between the time-consuming duration corresponding to the current transaction of the cross-system call and the time-consuming duration corresponding to the transaction corresponding to the last cross-system call, obtaining a time-consuming difference value, and adding the time-consuming difference value into a time interval queue. It should be noted that, the time-consuming duration corresponding to the current transaction is the transaction time-consuming duration of the current transaction. In the process of calculating the time-consuming difference value, the time-consuming time duration corresponding to the current transaction is subtracted by the time-consuming time duration corresponding to the last cross-system call corresponding transaction.
According to the method and the device for determining the time-out duration of the cross-system call corresponding transaction, the time-consumption difference value between the time-consumption duration of the current transaction and the time-consumption duration corresponding to the last cross-system call corresponding transaction is calculated, the calculated time-consumption difference value is added into the time interval queue, the data size of the time-consumption difference value in the time interval queue is enriched, and the accuracy of determining the time-out duration of the cross-system call corresponding transaction is further improved.
Further, a third embodiment of the method for adjusting the timeout period of the present invention is provided.
The third embodiment of the timeout period adjustment method is different from the first or second embodiment of the timeout period adjustment method in that the timeout period adjustment method further includes:
Step m, determining timeout data corresponding to timeout transactions in each time-consuming time length queue and each occurrence time queue in the time-consuming statistics array, acquiring current occurrence time corresponding to current transactions in cross-system call, and acquiring a time period corresponding to the occurrence time queue.
And determining timeout data corresponding to timeout transactions in each time-consuming time length queue and each occurrence time queue in the time-consuming statistics array. The time-out data in the time-consuming time length queue is time-consuming time length which is longer than the corresponding time-out time length, and the time-out data in the time-consuming time length queue is time-out corresponding to the time-out data in the time-consuming time length queue. It is understood that the corresponding timeout durations in the different time-consuming duration queues may or may not be the same; each time consuming duration in the time consuming duration queue is in the corresponding time generating queue, and the corresponding time generating exists. Acquiring the occurrence time corresponding to the current transaction of the cross-system call and acquiring the time period corresponding to the occurrence time queue. In order to facilitate the distinction, in this embodiment, the occurrence time of the current transaction is recorded as the current occurrence time, and the time periods corresponding to the occurrence time queues may be the same or different, and the time periods corresponding to the occurrence time queues may be set according to specific needs, which does not limit the size of the time periods in this embodiment. In the time-consuming statistics array, each time-consuming duration queue has a corresponding occurrence time queue.
And n, determining target time according to the time period and the current occurrence time.
And step o, deleting the occurrence time smaller than the target time in the occurrence time queue corresponding to the current transaction, and deleting the time-consuming time corresponding to the occurrence time smaller than the target time in the time-consuming time length queue corresponding to the current transaction.
After the time period and the current occurrence time are acquired, the time corresponding to the current occurrence time is pushed forward for the time period, so that the target time is determined, the occurrence time smaller than the target time in the occurrence time queue corresponding to the current transaction is deleted, and the time consuming time corresponding to the occurrence time smaller than the target time in the time consuming time queue corresponding to the current transaction is deleted. If the current occurrence time is marked as TT and the time period is marked as M, the target time is marked as TT-M. If the current occurrence time is 8 points 30 minutes 45 seconds and the time period is 5 minutes, subtracting 5 minutes from the target time is 8 points 30 minutes 45 seconds, namely, the current occurrence time is pushed forward for 5 minutes, the obtained target time is 8 points 25 minutes 45 seconds, the occurrence time which is smaller than 8 points 25 minutes 45 seconds in the current transaction corresponding occurrence time queue is deleted, namely, the occurrence time which is 25 minutes 45 seconds before 8 points is deleted, and the corresponding time-consuming time duration which is 25 minutes 45 seconds before 8 points in the current transaction corresponding time-consuming time duration queue is deleted.
And step p, deleting time-consuming difference values corresponding to the occurrence time smaller than the target time in the time interval queue, and deleting timeout data in the time-consuming duration queue and the occurrence time queue.
And deleting time-consuming time difference corresponding to the occurrence time smaller than the target time in the time interval queue after the target time is determined, and deleting time-consuming time length queue and timeout data in the occurrence time queue. Specifically, when deleting the time difference of time consumption in the time interval queue, deleting the time duration of time consumption in the time consumption time queue as the time difference of time consumption corresponding to the subtracted number.
It should be noted that, if the present embodiment is presented on the basis of the second embodiment, the steps i, j, k and l should be performed before the step h.
According to the method and the device for calculating the time-out duration, before the time interval average value, the time-consuming trend proportion value and the time-consuming average value are calculated, part of data in the time-consuming duration queue, the occurrence time queue and the time interval queue are deleted, so that the data size for calculating the time-out duration is reduced, and the efficiency for calculating the time-out duration is improved.
In addition, referring to fig. 2, the present invention further provides an apparatus for adjusting a timeout period, where the apparatus for adjusting a timeout period includes:
an obtaining module 10, configured to obtain a segment interval duration in the corresponding time-consuming statistics array of cross-system call;
The calculating module 20 is configured to calculate an average value of time intervals of the time-consuming differences in the time interval queues corresponding to the time-consuming statistic array; calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the time interval queue, and calculating a time-consuming average value of the corresponding transaction of the cross-system call according to the time-consuming statistics array and the time-consuming trend proportion value; calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value;
An adjustment module 30, configured to adjust a timeout period of a next transaction across the system according to the timeout period.
Further, the computing module 20 includes:
The first acquisition unit is used for acquiring the average abnormal times of the module to be executed in a first preset duration and acquiring the total abnormal times of the module to be executed in a second preset duration;
and the first calculation unit is used for calculating the abnormal probability corresponding to the module to be executed according to the average abnormal times and the total abnormal times.
Further, the obtaining module 10 is further configured to obtain a current time-consuming duration corresponding to the current transaction through the system call;
The timeout period adjusting device further includes:
the judging module is used for judging whether the current time-consuming time length is greater than a preset timeout time length or not;
A first determining module, configured to determine, if the current time consumption period is greater than the preset time-out period, a sum of the preset time-out period and a segment interval period as a transaction time-consuming period of the current transaction; if the current time-consuming time length is smaller than or equal to the preset timeout time length, determining the current time-consuming time length as the transaction time-consuming time length of the current transaction;
And the storage module is used for storing the time-consuming time of the transaction into a time-consuming time queue of the time-consuming statistics array.
The timeout period adjusting device further includes:
A second determining module, configured to determine timeout data corresponding to timeout transactions in each time-consuming duration queue and each occurrence time queue in the time-consuming statistics array;
the acquisition module is also used for acquiring the current occurrence time corresponding to the current transaction through system call and acquiring the time period corresponding to the occurrence time queue;
the second determining module is further configured to determine a target time according to the time period and the current occurrence time;
The deleting module is used for deleting the occurrence time smaller than the target time in the occurrence time queue corresponding to the current transaction, and deleting the time-consuming time corresponding to the occurrence time smaller than the target time in the time-consuming time length queue corresponding to the current transaction; and deleting the time-consuming difference value corresponding to the occurrence time smaller than the target time in the time interval queue, and deleting the time-consuming duration queue and the overtime data in the occurrence time queue.
Further, the calculating module 20 is further configured to calculate a time-consuming difference between a time-consuming duration corresponding to the current transaction and a time-consuming duration corresponding to the last cross-system call;
the device for adjusting the timeout period comprises:
And the adding module is used for adding the time consumption difference value into the time interval queue.
Further, the computing module 20 includes:
the first marking unit is used for marking each time consumption difference value in the time interval queue as a first target difference value and marking the next time consumption difference value corresponding to the target difference value as a second target difference value;
The first calculation unit is used for subtracting the corresponding first target difference value from the second target difference value to obtain a time length difference value of the time interval queue; and calculating the number of elements of the time-consuming difference value in the time interval queue, and calculating a time-consuming trend proportion value of the corresponding transaction of the cross-system call according to the number of elements and the time length difference value.
Further, the first computing unit includes:
the detection subunit is used for detecting whether the time length difference value is greater than zero or not to obtain a detection result;
A determining subunit, configured to determine a mapping value corresponding to each duration difference according to the detection result;
The calculating subunit is used for adding the mapping values corresponding to the time length difference values to obtain time interval trend values of corresponding transactions of cross-system call; dividing the time interval trend value by the number of elements to obtain the time-consuming trend proportion value of the corresponding transaction of the cross-system call.
Further, the calculating module 20 is further configured to calculate the number of transactions to be counted according to the time-consuming statistics array and the time-consuming trend proportion value; and calculating a time-consuming average value of corresponding transactions of the cross-system call according to the time-consuming trend proportion value and the number of the transactions to be counted.
Further, the computing module 20 includes:
The second calculation unit is used for calculating the total time consumption of the time-consuming time length queues in the time-consuming statistics array;
the acquisition unit is used for acquiring the absolute value of the time-consuming trend proportion value;
the second calculating unit is further configured to subtract the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiply the proportion difference value by the total time consumption to obtain the number of transactions to be counted.
Further, the computing module 20 further includes:
the detection unit is used for detecting whether the time interval trend value corresponding to the time consumption trend proportion value is larger than zero or not;
The extraction unit is used for starting to take time-consuming time from the last time-consuming time queue in the time-consuming statistics array if the time interval trend value is greater than zero until the number of the time-consuming time is equal to the number of the transactions to be counted; if the time interval trend value is smaller than zero, starting to take time duration from a first time duration queue in the time duration statistic array until the number of the time duration is equal to the number of the transactions to be counted;
The determining unit is used for determining a target time-consuming time length queue in which the time-consuming time length is located;
the third calculation unit is used for calculating the average value of the time-consuming time durations in the target time-consuming time duration queue to obtain the time-consuming average value of the corresponding transactions of the cross-system call.
Further, the computing module 20 further includes:
The second marking unit is used for marking the segment interval time as S, the time interval average value as AI, the time consumption trend proportion value as SL, the time consumption average value as AT and the timeout time as T;
the fourth calculation unit is configured to calculate a timeout duration by using a preset timeout duration calculation formula, where the timeout duration calculation formula is: t=at+ai+s×sl.
It should be noted that, the embodiments of the timeout period adjusting device are substantially the same as the embodiments of the timeout period adjusting method described above, and will not be described in detail herein.
In addition, the invention also provides a device for adjusting the timeout duration. As shown in fig. 3, fig. 3 is a schematic structural diagram of a hardware running environment according to an embodiment of the present invention.
It should be noted that fig. 3 is a schematic structural diagram of a hardware running environment of the device for adjusting the timeout period. The device for adjusting the timeout period in the embodiment of the invention can be terminal devices such as a PC, a portable computer and the like.
As shown in fig. 3, the device for adjusting the timeout period may include: a processor 1001, such as a CPU, memory 1005, user interface 1003, network interface 1004, communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the device for adjusting the timeout period may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on.
It will be appreciated by those skilled in the art that the arrangement of the time-out period adjustment device shown in fig. 3 does not constitute a limitation of the time-out period adjustment device, and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
As shown in fig. 3, an operating system, a network communication module, a user interface module, and an adjustment program for a timeout period may be included in a memory 1005 as one type of computer storage medium. The operating system is a program for managing and controlling the time-out time length and adjusting hardware and software resources of the device, and supports the operation of the time-out time length adjusting program and other software or programs.
In the timeout period adjusting device shown in fig. 3, the user interface 1003 is mainly used for connecting to a client, and performing data communication with the client to obtain data required by a transaction, such as time-consuming period, occurrence time, and the like; the network interface 1004 is mainly used for a background server, and performs data communication, such as calling and executing, with the background server; routing a corresponding configuration module; the processor 1001 may be configured to call an adjustment program for a timeout period stored in the memory 1005 and execute the steps of the adjustment method for a timeout period as described above.
The specific implementation manner of the device for adjusting the timeout period is basically the same as the embodiments of the method for adjusting the timeout period, and is not repeated here.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores an adjusting program of the timeout duration, and the adjusting program of the timeout duration realizes the steps of the method for adjusting the timeout duration when being executed by a processor.
The specific implementation manner of the computer readable storage medium of the present invention is basically the same as the above embodiments of the method for adjusting the timeout period, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. The method for adjusting the timeout duration is characterized by comprising the following steps of:
Acquiring a segmentation interval duration in a cross-system call corresponding time-consuming statistics array, and calculating a time interval average value of time-consuming difference values in a time interval queue corresponding to the time-consuming statistics array, wherein the segmentation interval duration refers to interval duration among all sub-statistics arrays in the time-consuming statistics array, any one time-consuming statistics array corresponds to one time interval queue, time-consuming time differences of the time-consuming durations of the cross-system call corresponding to the transaction are stored in the time interval queue for two times, and the absolute value of the sum of the time-consuming time differences is divided by the number of time differences to obtain the time interval average value of the time-consuming difference values in the time interval queue, and the sum of the time-consuming time differences is smaller than zero;
marking each time consumption difference value in the time interval queue as a first target difference value, and marking the next time consumption difference value corresponding to the target difference value as a second target difference value;
Subtracting the corresponding first target difference value from the second target difference value to obtain a time length difference value of the time interval queue;
detecting whether the time length difference is greater than zero or not to obtain a detection result, and determining a mapping value corresponding to each time length difference according to the detection result;
Adding the mapping values corresponding to the time length difference values to obtain a time interval trend value of the corresponding transaction of the cross-system call;
calculating the number of elements of the time consumption difference value in the time interval queue, dividing the time interval trend value by the number of elements to obtain a time consumption trend proportion value of the corresponding transaction of the cross-system call;
Acquiring an absolute value of the time-consuming trend proportion value, and calculating the total time consumption of the time-consuming duration queues in the time-consuming statistic array;
subtracting the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiplying the proportion difference value by the total time consumption to obtain the transaction quantity to be counted;
detecting whether the time interval trend value corresponding to the time consuming trend proportion value is larger than zero or not;
if the time interval trend value is greater than zero, starting to take time duration from the last time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
If the time interval trend value is smaller than zero, starting to take time duration from a first time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
calculating the average value of the time-consuming time durations in the target time-consuming time duration queue to obtain the time-consuming average value of corresponding transactions of cross-system calls;
Calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value;
and adjusting the timeout duration of the next transaction across the system according to the timeout duration.
2. The method for adjusting a timeout period according to claim 1, wherein before the step of obtaining the inter-system call corresponding to the segment interval period in the time-consuming statistics array, further comprises:
acquiring a current time-consuming time length corresponding to a current transaction by cross-system call, and judging whether the current time-consuming time length is greater than a preset timeout time length;
If the current time consumption is longer than the preset timeout period, determining the sum of the preset timeout period and the segmentation interval period as the transaction time consumption period of the current transaction, and storing the transaction time consumption period into a time consumption period queue of the time consumption statistics array;
If the current time-consuming duration is smaller than or equal to the preset timeout duration, determining the current time-consuming duration as the transaction time-consuming duration of the current transaction, and storing the transaction time-consuming duration into a time-consuming duration queue of the time-consuming statistics array.
3. The method for adjusting a timeout period according to claim 1, wherein before the step of obtaining the inter-system call corresponding to the segment interval period in the time-consuming statistics array, further comprises:
Determining timeout data corresponding to timeout transactions in each time-consuming time length queue and each occurrence time queue in the time-consuming statistics array, acquiring current occurrence time corresponding to current transactions in cross-system call, and acquiring a time period corresponding to the occurrence time queue;
determining a target time according to the time period and the current occurrence time;
Deleting the occurrence time smaller than the target time in the occurrence time queue corresponding to the current transaction, and deleting the time-consuming time corresponding to the occurrence time smaller than the target time in the time-consuming time length queue corresponding to the current transaction;
And deleting the time-consuming difference value corresponding to the occurrence time smaller than the target time in the time interval queue, and deleting the time-consuming duration queue and the overtime data in the occurrence time queue.
4. The method for adjusting a timeout period according to claim 1, wherein before the step of calculating an average value of time intervals of time difference values in the time interval queue corresponding to the time-consuming statistics array, the method further comprises:
Calculating the time consumption difference between the time consumption duration corresponding to the current transaction of the cross-system call and the time consumption duration corresponding to the last cross-system call, and adding the time consumption difference into the time interval queue.
5. The method according to any one of claims 1 to 4, wherein the step of calculating a timeout period from the segment interval period, the time interval average, the time-consuming trend proportion value, and the time-consuming average includes:
the time interval duration is marked as S, the time interval average value is marked as AI, the time consuming trend proportion value is marked as SL, the time consuming average value is marked as AT, and the timeout duration is marked as T;
calculating to obtain the timeout duration by adopting a preset timeout duration calculation formula, wherein the timeout duration calculation formula is as follows: t=at+ai+s×sl.
6. An apparatus for adjusting a timeout period, wherein the apparatus for adjusting a timeout period comprises:
the acquisition module is used for acquiring the segment interval duration in the corresponding time-consuming statistic array of cross-system call;
The calculation module is used for calculating a time interval average value of time consumption differences in a time interval queue corresponding to the time consumption statistic array, the segmentation interval duration refers to interval duration among all sub-statistic arrays in the time consumption statistic array, any one time consumption statistic array corresponds to one time interval queue, time consumption time differences corresponding to transaction time consumption durations are stored in the time interval queue in a cross-system mode, and the absolute value of the sum of the time consumption time differences is divided by the number of the time differences to obtain the time interval average value of the time consumption differences in the time interval queue, wherein the sum of the time consumption time differences is smaller than zero;
The computing module is further configured to:
marking each time consumption difference value in the time interval queue as a first target difference value, and marking the next time consumption difference value corresponding to the target difference value as a second target difference value;
Subtracting the corresponding first target difference value from the second target difference value to obtain a time length difference value of the time interval queue;
detecting whether the time length difference is greater than zero or not to obtain a detection result, and determining a mapping value corresponding to each time length difference according to the detection result;
Adding the mapping values corresponding to the time length difference values to obtain a time interval trend value of the corresponding transaction of the cross-system call;
calculating the number of elements of the time consumption difference value in the time interval queue, dividing the time interval trend value by the number of elements to obtain a time consumption trend proportion value of the corresponding transaction of the cross-system call;
Acquiring an absolute value of the time-consuming trend proportion value, and calculating the total time consumption of the time-consuming duration queues in the time-consuming statistic array;
subtracting the absolute value of the time-consuming trend proportion value from 1 to obtain a proportion difference value, and multiplying the proportion difference value by the total time consumption to obtain the transaction quantity to be counted;
detecting whether the time interval trend value corresponding to the time consuming trend proportion value is larger than zero or not;
if the time interval trend value is greater than zero, starting to take time duration from the last time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
If the time interval trend value is smaller than zero, starting to take time duration from a first time duration queue in the time duration statistics array until the number of the time duration to be taken is equal to the number of the transactions to be counted, and determining a target time duration queue in which the time duration to be taken is located;
calculating the average value of the time-consuming time durations in the target time-consuming time duration queue to obtain the time-consuming average value of corresponding transactions of cross-system calls;
Calculating to obtain a timeout duration according to the segment interval duration, the time interval average value, the time-consuming trend proportion value and the time-consuming average value;
and the adjusting module is used for adjusting the timeout duration of the next transaction in a cross-system manner according to the timeout duration.
7. An adjustment device for a time-out period, characterized in that the adjustment device for a time-out period comprises a memory, a processor and an adjustment program for a time-out period stored on the memory and executable on the processor, which adjustment program for a time-out period, when executed by the processor, implements the steps of the adjustment method for a time-out period according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a time-out period adjustment program is stored, which when executed by a processor implements the steps of the time-out period adjustment method according to any one of claims 1 to 5.
CN201911057188.2A 2019-10-31 2019-10-31 Method, device, equipment and computer readable storage medium for adjusting timeout duration Active CN110784478B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911057188.2A CN110784478B (en) 2019-10-31 2019-10-31 Method, device, equipment and computer readable storage medium for adjusting timeout duration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911057188.2A CN110784478B (en) 2019-10-31 2019-10-31 Method, device, equipment and computer readable storage medium for adjusting timeout duration

Publications (2)

Publication Number Publication Date
CN110784478A CN110784478A (en) 2020-02-11
CN110784478B true CN110784478B (en) 2024-04-30

Family

ID=69388459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911057188.2A Active CN110784478B (en) 2019-10-31 2019-10-31 Method, device, equipment and computer readable storage medium for adjusting timeout duration

Country Status (1)

Country Link
CN (1) CN110784478B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500319B (en) * 2022-02-15 2024-01-26 中国工商银行股份有限公司 Method and device for simulating and processing overtime abnormal scene
CN116703601B (en) * 2023-08-03 2024-01-19 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium based on block chain network

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
US8966487B1 (en) * 2012-10-16 2015-02-24 Sprint Communications Company L.P. Application transaction wait time dynamic adjustment
CN105389214A (en) * 2015-11-10 2016-03-09 中国建设银行股份有限公司 Monitoring method and system
CN105631743A (en) * 2016-03-14 2016-06-01 中国银行股份有限公司 Method and system for ATM transaction real-time traffic control
CN107257363A (en) * 2017-05-27 2017-10-17 北京思特奇信息技术股份有限公司 A kind of method and system of respond request end request
JP2018139368A (en) * 2017-02-24 2018-09-06 富士通株式会社 Communication apparatus and communication method
CN109144700A (en) * 2018-09-03 2019-01-04 阿里巴巴集团控股有限公司 Determination method, apparatus, server and the data processing method of overtime duration
CN109995787A (en) * 2019-04-10 2019-07-09 北京奇艺世纪科技有限公司 A kind of data processing method and relevant device
CN110162384A (en) * 2019-04-19 2019-08-23 深圳壹账通智能科技有限公司 Time-out time dynamic adjusting method and system based on Redis distributed lock
WO2019192062A1 (en) * 2018-04-04 2019-10-10 上海金丘信息科技股份有限公司 Dynamic stake consensus method based on trusted members

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040225592A1 (en) * 2003-05-08 2004-11-11 Churquina Eduardo Enrique Computer Implemented Method and System of Trading Indicators Based on Price and Volume
US20170223768A1 (en) * 2016-02-01 2017-08-03 Qualcomm Incorporated Dynamic adjustment of transmission timeout interval in communication protocols

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8966487B1 (en) * 2012-10-16 2015-02-24 Sprint Communications Company L.P. Application transaction wait time dynamic adjustment
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
CN105389214A (en) * 2015-11-10 2016-03-09 中国建设银行股份有限公司 Monitoring method and system
CN105631743A (en) * 2016-03-14 2016-06-01 中国银行股份有限公司 Method and system for ATM transaction real-time traffic control
JP2018139368A (en) * 2017-02-24 2018-09-06 富士通株式会社 Communication apparatus and communication method
CN107257363A (en) * 2017-05-27 2017-10-17 北京思特奇信息技术股份有限公司 A kind of method and system of respond request end request
WO2019192062A1 (en) * 2018-04-04 2019-10-10 上海金丘信息科技股份有限公司 Dynamic stake consensus method based on trusted members
CN109144700A (en) * 2018-09-03 2019-01-04 阿里巴巴集团控股有限公司 Determination method, apparatus, server and the data processing method of overtime duration
CN109995787A (en) * 2019-04-10 2019-07-09 北京奇艺世纪科技有限公司 A kind of data processing method and relevant device
CN110162384A (en) * 2019-04-19 2019-08-23 深圳壹账通智能科技有限公司 Time-out time dynamic adjusting method and system based on Redis distributed lock

Also Published As

Publication number Publication date
CN110784478A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN109104336B (en) Service request processing method and device, computer equipment and storage medium
CN110784478B (en) Method, device, equipment and computer readable storage medium for adjusting timeout duration
US20130163740A1 (en) Asynchronous calls using intermittent callback for delay sensitive applications
CN105549910A (en) IO scheduling method and apparatus
CN112395067A (en) Task scheduling method, system, device and medium
US20190213052A1 (en) Distributed processing system, distributed processing method, and recording medium
CN110781145A (en) File system task scheduling method, device, equipment and readable storage medium
CN112506581A (en) Method and device for rendering small program, electronic equipment and readable storage medium
US9886320B2 (en) Method for prioritizing tasks queued at a server system
CN115756812A (en) Resource adjusting method and device and storage medium
CN113590017B (en) Method, electronic device and computer program product for processing data
CN110347477B (en) Service self-adaptive deployment method and device in cloud environment
CN106294457B (en) Network information pushing method and device
CN110019372B (en) Data monitoring method, device, server and storage medium
US20200127947A1 (en) Capacity-Based Scaling of Queue-Based Services
CN116048834A (en) Method, device and storage medium for updating integrated ranking list in real time
CN115202969A (en) Interface calling timeout processing method, device, equipment and storage medium
CN111858019B (en) Task scheduling method and device and computer readable storage medium
CN112669091A (en) Data processing method, device and storage medium
CN113439252A (en) Terminal control method, terminal control device, storage medium and electronic equipment
CN110377863B (en) Expansion fitting method and device for browsing resource evaluation points
CN113381941B (en) Task scheduling method and device, electronic equipment and computer storage medium
JP7384214B2 (en) Analysis processing device, system, method and program
US20220121459A1 (en) Keypress event smoothener and predictor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant