CN110716972A - Method and device for processing error of high-frequency calling external interface - Google Patents

Method and device for processing error of high-frequency calling external interface Download PDF

Info

Publication number
CN110716972A
CN110716972A CN201910869067.1A CN201910869067A CN110716972A CN 110716972 A CN110716972 A CN 110716972A CN 201910869067 A CN201910869067 A CN 201910869067A CN 110716972 A CN110716972 A CN 110716972A
Authority
CN
China
Prior art keywords
request
time
interval
data
data request
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.)
Pending
Application number
CN201910869067.1A
Other languages
Chinese (zh)
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.)
Shanghai Yidianshikong Network Co Ltd
Original Assignee
Shanghai Yidianshikong Network 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 Shanghai Yidianshikong Network Co Ltd filed Critical Shanghai Yidianshikong Network Co Ltd
Priority to CN201910869067.1A priority Critical patent/CN110716972A/en
Publication of CN110716972A publication Critical patent/CN110716972A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a processing method and a device for calling an external interface with high frequency to make errors, wherein the method comprises the steps of initiating a first data request according to a set first request time interval; if the first data request fails, recording the request times and the total request interval duration between the first request successful time node and the last request successful time node; increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval; if the second data request fails, taking the total request interval duration between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request; and if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, and sending and recording the consumed time of each request until the request is successful to obtain the total time of the current request interval.

Description

Method and device for processing error of high-frequency calling external interface
Technical Field
The invention relates to the field of artificial intelligence, in particular to a method and a device for processing errors of high-frequency calling of an external interface.
Background
IT companies need to use various systems to complete various tasks in the companies and to keep statistics of various company data, such as oa systems, operation and maintenance systems, work order systems, demand management systems, and so on. Some systems may be company self-research, some may use an external open source framework, or use the services of an external company to perform statistics on the company's relevant data retention. When using external services, frequent interface read and write operations may be required.
For external company services, there are usually various restrictions on the interface frequency of the calls. Such as less than or equal to 1-10 requests per second, or how many read interface operations can be performed and how many write interface operations can be performed for a specified time frame. Usually, when the accumulated statistical data of the company on the current external service is obtained in a centralized manner, the frequency of calling the interface exceeds the corresponding configuration, and at this time, the common manner is to either wait for the requests one by one or perform data summarization after performing requests of multiple batches in time intervals.
However, the following problems arise with the conventional approaches of the prior art:
1. the request-by-request method can continuously alarm that the number of requests exceeds the number of times, and if the number of times of external service limitation is exceeded, the external service provider may be limited, and even refuses to provide service in a short time.
2. The multiple batches of requests need to respectively execute the request pulling data in multiple time periods, and simultaneously, data merging needs to be performed again after the multiple requests are completed. Moreover, multiple batches of requests need to control each time of boundary data, which easily causes artificial operation failure.
Disclosure of Invention
In order to solve the problem that in the prior art, when an interface is frequently called, a provider refuses to provide service or manual operation is easy to fail due to the fact that requests in a piece by piece manner and in multiple batches are independently waited, the invention provides a method and a device for processing errors of calling an external interface at high frequency.
In a first aspect, the present invention provides a method for processing an error of an external interface with high frequency call, including:
initiating a first data request according to a set first request time interval;
if the first data request fails, recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node;
increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval;
if the second data request fails, taking the total request interval duration between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request;
if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the time consumed by each request until the request is successful after the fourth data request is sent to obtain the total time of the current request interval;
and setting the request frequency within the total duration of the current request interval to be less than or equal to the request frequency between the first request success time node and the last request success time node, and finishing the processing of the error of the high-frequency calling external interface.
Further, according to the set first request time interval, before initiating the first data request, the method further includes:
initializing the number of times of requests for debugging the external interface;
and carrying out initial calling on the external interface, and counting the time from the initiation of the data request to the receipt of a correct returned result to obtain a time node for the success of the first request.
Further, if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the consumed time of each request until the request is successful after the fourth data request is sent, wherein the step of obtaining the total time of the current request interval further comprises:
if the third data request is successfully sent, the third data request is set in a value which is at least twice of the third request time interval, so that the number of sent requests is smaller than or equal to the number of requests between the first request successful time node and the last request successful time node.
Further, if the second data request fails, taking the total duration of the request interval between the first request successful time node and the last request successful time node as a third request time interval, and before initiating the third data request, the method further includes:
and if the second data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the second request time interval as a final time interval.
Further, if the first data request fails, recording the number of times of requests between the first request successful time node and the last request successful time node, and the total duration of the request interval between the first request successful time node and the last request successful time node, further comprising:
and if the first data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the first request time interval as a final time interval.
Further, the increasing of the numerical value includes: a linear increase in the value or an exponential increase in the value.
In a second aspect, the present invention provides an apparatus for processing an error in invoking an external interface at a high frequency, the apparatus comprising:
a first data request initiating module, configured to initiate a first data request according to a set first request time interval;
the recording module is used for recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node if the first data request fails;
the second data request initiating module is used for increasing the value of the first request time interval and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval;
a third data request initiating module, configured to initiate a third data request by using a total duration of a request interval between a first request success time node and a last request success time node as a third request time interval if the second data request fails;
the sending and recording module is used for increasing the numerical value of the third request time interval to obtain a fourth data request if the third data request fails, sending the fourth data request and recording the consumed time length of each request until the request is successful after the fourth data request is sent, so as to obtain the total time length of the current request interval;
and the request sending frequency setting module is used for setting the request sending frequency within the total duration of the current request interval, so that the request sending frequency is less than or equal to the request frequency between the first request success time node and the last request success time node, and the processing of the high-frequency calling external interface error is completed.
Further, the first data request initiating module further comprises:
the initialization module is used for initializing the number of times of requests for debugging the external interface;
and the first request success time node obtaining module is used for carrying out initial calling on the external interface, counting the time from the initiation of the data request to the receipt of the correct return result and obtaining the first request success time node.
Further, the sending and recording module further comprises:
if the third data request is successfully sent, the third data request is set in a value which is at least twice of the third request time interval, so that the number of sent requests is smaller than or equal to the number of requests between the first request successful time node and the last request successful time node.
In a third aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the processing method for calling the external interface error with high frequency, when executing the program.
The processing method and the device for calling the external interface error at high frequency can ensure that the corresponding service interface request is carried out without errors subsequently after limited errors occur; a plurality of batches of request interfaces are not needed, all data needing to be counted are requested in a single script at one time, and manual data summarizing operation is not needed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for processing an error in high-frequency calling an external interface according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a flow of multiple requests for simulating a high frequency call to an external interface according to an embodiment of the present invention;
fig. 3 is a schematic overall flowchart of a method for processing an error in high-frequency calling of an external interface according to an embodiment of the present invention;
FIG. 4 is a block diagram of a processing apparatus for handling an error in invoking an external interface with high frequency according to an embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Many IT companies need to use various systems to complete various tasks in the company and to count and store various company data, at this time, interface read-write operations need to be frequently performed, for the services of external companies, various restrictions are usually imposed on the interface frequency to be called, and further, the problem that providers refuse to provide services or manual operations are prone to failure is caused. In order to solve the above problem, an embodiment of the present invention provides a method for processing an error in invoking an external interface with high frequency, where as shown in fig. 1, the method includes:
step S101, a first data request is initiated according to a set first request time interval;
specifically, when the external interface is called at a high frequency for multiple times of simulation, each interval time is set as an initial value (default configuration is 1 second), and then a first data request is initiated.
Step S102, if the first data request fails, recording the request times between the first request success time node and the last request success time node and the total request interval duration between the first request success time node and the last request success time node.
Specifically, after the default configuration time interval 1S is exceeded, a request failure occurs, and the number of times of requests is saved under the condition of the last success, namely the number of times of requests between the time node of the first request success and the time node of the last request success; and recording the current time of each request, namely counting the total time length of the request interval between the first request successful time node and the last request successful time node.
Step S103, increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval.
Specifically, in the embodiment of the present invention, a request interval of 1 second is initially set, after a first request is successful, the simulation of multiple interface calls is performed, and at this time, if a failure occurs for the second time or the subsequent N times, the time duration of the corresponding request interval needs to be increased. The reason for the second or nth failure may be:
1. network fluctuations cause increased time for requests to be returned to the caller, thereby requiring a timeout or return error.
2. The processing time of the service provider for different parameters is different when the parameters are requested to be changed, and some requests may take longer time.
In this case, it is necessary to increase the time interval of the first request, for example, to increase the time interval between two requests, to ensure that the time interval between two requests can withstand the increased time caused by network fluctuation and request parameter change, and to ensure that each request can be successful.
After the value of the time interval is increased twice for the first requested time interval, the request is made again.
And step S104, if the second data request fails, taking the total duration of the request interval between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request.
Specifically, if the request is resent or failed after increasing the default request time interval, the frequency limit of the request interface is suspected to be a specified maximum number of requests per unit time, beyond which the request must fail. And according to the total duration of the request interval between the first request success time node and the last request success time node in the step S102, taking the total duration as a new data request time interval, and sending the new request (i.e. the third data request).
Step S105, if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the consumed time of each request until the request is successful after the fourth data request is sent, so as to obtain the total time of the current request interval.
Specifically, if the third data request fails, the third request time interval continues to be increased in value until the subsequent request succeeds, and at this time, the total value of all current time intervals is recorded.
And step S106, setting the time within the total time of the current request interval, enabling the number of the sent requests to be less than or equal to the number of the requests between the first request success time node and the last request success time node, and finishing the processing of the error of the high-frequency calling external interface.
Specifically, if the subsequent request is still unsuccessful after increasing the time interval for multiple times, the interface frequency may be limited by a specified number of times per unit time. Therefore, the embodiment of the invention ensures that the data request is successfully sent, and the request times between the time node which successfully requests for the first time and the time node which successfully requests for the last time can be only carried out within the current time interval.
The processing method for calling the external interface error at high frequency can ensure that the corresponding service interface request is carried out without errors subsequently after limited errors occur; a plurality of batches of request interfaces are not needed, all data needing to be counted are requested in a single script at one time, and manual data summarizing operation is not needed.
Based on the content of the above embodiments, as an alternative embodiment: according to the set first request time interval, before initiating the first data request, the method further comprises:
initializing the number of times of requests for debugging the external interface;
and carrying out initial calling on the external interface, and counting the time from the initiation of the data request to the receipt of a correct returned result to obtain a time node for the success of the first request.
Specifically, the server obtains a link that needs to be requested, and initializes the content of the current link and the number of requests. For example, each link content is initialized to 0, and the like.
When the high-frequency calling external interface is subjected to first simulation, the processing time from the request to the result return is counted, the first request is ensured to return correct data, and the time of receiving the correct return result is taken as the first request success time node. If the first request fails, retry is carried out, and the error reason needs to be confirmed or corresponding interface developers need to be consulted after multiple failures.
Based on the content of the above embodiments, as an alternative embodiment: if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the consumed time of each request until the request is successful after the fourth data request is sent, wherein the step of obtaining the total time of the current request interval further comprises the following steps:
if the third data request is successfully sent, the third data request is set in a value which is at least twice of the third request time interval, so that the number of sent requests is smaller than or equal to the number of requests between the first request successful time node and the last request successful time node.
Specifically, if the third data request is successfully sent, it is described that the data request can be successfully sent by using the total duration of the request interval between the first request success time node and the last request success time node as the time interval, and at this time, the number of times of sending the request is controlled only within a time interval value at least twice as large as the time interval, where the number of times of sending the request is made to be less than or equal to the number of times of requesting between the first request success time node and the last request success time node, that is, the number of times of requesting is made to be less than or equal to the maximum number of times of frequency limit of the request interface.
Based on the content of the above embodiments, as an alternative embodiment: if the second data request fails, taking the total duration of the request interval between the first request successful time node and the last request successful time node as a third request time interval, and before initiating the third data request, the method further includes:
and if the second data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the second request time interval as a final time interval.
Specifically, after the second data request is sent, if the subsequent requests are successful, the second request time interval is set as the final time interval, and all subsequent requests are based on the current time interval.
Based on the content of the above embodiments, as an alternative embodiment: if the first data request fails, before recording the request times between the first request success time node and the last request success time node and the total request interval duration between the first request success time node and the last request success time node, the method further comprises the following steps:
and if the first data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the first request time interval as a final time interval.
Specifically, if the data request is successful and fails after the first data request, it may be determined that the time interval of the simulation is 1s and no other configuration is needed.
Based on the content of the above embodiments, as an alternative embodiment: the increase in the number includes: a linear increase in the value or an exponential increase in the value.
Specifically, in the above embodiments, after the request fails, the current time interval needs to be incremented by a numerical value, where in order to make the incremented numerical value more consistent with the actual operating situation, the embodiment of the present invention sets the incremented dimension to be linearly incremented or exponentially incremented.
Based on the content of the above embodiments, as an alternative embodiment: as shown in fig. 2, fig. 2 is a schematic diagram illustrating a flow of multiple requests for simulating a high-frequency call external interface according to an embodiment of the present invention. The method comprises the following specific steps:
step 1: the process is started, and data are initialized;
step 2: carrying out first simulation;
and step 3: judging whether the first simulation is successful; if successful, executing step 5; if the failure occurs, executing the step 4;
and 4, step 4: confirming the reason of the error;
and 5: carrying out simulation for multiple times;
step 6: judging whether the multiple times of simulation are successful; if successful, executing step 5; if the failure occurs, executing step 7;
and 7: and (5) completing simulation and counting successful interface data. The failed interface is dotted and subsequent simulation begins with the failed interface.
It should be noted that, multiple simulations are required to suspend the related operations and calculate the data that has been requested successfully every time an error occurs. Meanwhile, the current failed request needs to be checked, and when the simulation is performed again subsequently, the current failed request needs to be started, so that the request operation needs to be executed manually for many times.
Based on the content of the above embodiments, as an alternative embodiment: as shown in fig. 3, fig. 3 is a schematic overall flow chart of the method for processing an error in high-frequency calling of an external interface according to the embodiment of the present invention, and the specific steps are as follows:
step 11: initializing data;
step 12: carrying out first simulation;
step 13: judging whether the first simulation is successful; if successful, go to step 15; if the failure occurs, go to step 14;
step 14: confirming the reason of the error;
step 15: setting a request interval, and simulating related requests for multiple times;
step 16: judging whether the operation is successful; if successful, go to step 17; if the failure is found, go to step 18;
and step 17: completing all interface data requests, and performing relevant data statistics;
step 18: increasing the request and interval and judging whether the request and interval are feasible or not; if successful, go to step 15; if the failure is detected, go to step 19;
step 19: the frequency limited by the interface is the request quantity of the unit time corresponding to the appointed times, the time interval of the successful times is increased, only the successful times are ensured to be requested in the appointed time interval, and the request is suspended after the times are exceeded. The appointed time refers to the total time length T of the request interval between the first request success time node and the last request success time node, the request success times refers to the request times N between the first request success time node and the last request success time node, and if the time T is not used up and the request times reach N times, the transmission is carried out after the corresponding transmission time interval is exceeded.
According to still another aspect of the present invention, an embodiment of the present invention provides a processing apparatus for handling an error of a high-frequency call external interface, and referring to fig. 4, fig. 4 is a block diagram of the processing apparatus for handling an error of a high-frequency call external interface according to the embodiment of the present invention. The device is used for processing the high-frequency calling external interface error provided by the embodiment of the invention in the embodiments. Therefore, the description and definition of the processing method for high frequency calling external interface error provided by the embodiment of the present invention in the foregoing embodiments can be used for understanding the execution modules in the embodiment of the present invention.
The device includes:
a first data request initiating module 401, configured to initiate according to the set first request time interval
A first data request;
a recording module 402, configured to record, if the first data request fails, a number of requests between a first request success time node and a last request success time node, and a total duration of a request interval between the first request success time node and the last request success time node;
a second data request initiating module 403, configured to increase the value of the first request time interval, and initiate a second data request with the request time interval after the current value is increased as a second request time interval;
a third data request initiating module 404, configured to initiate a third data request by using a total duration of a request interval between a first request success time node and a last request success time node as a third request time interval if the second data request fails;
the sending and recording module 405 is configured to increase the value of the third request time interval to obtain a fourth data request if the third data request fails, send the fourth data request, and record the time consumed by each request until the request is successful after the fourth data request is sent, so as to obtain the total time of the current request interval;
and a request sending frequency setting module 406, configured to set, within the total duration of the current request interval, the number of times of requests sent to be less than or equal to the number of times of requests between the time node where the first request is successful and the time node where the last request is successful, and complete processing of errors in the high-frequency call external interface.
The processing device for calling the external interface with high frequency to make errors can ensure that the subsequent service interface request is carried out without errors after limited errors occur; a plurality of batches of request interfaces are not needed, all data needing to be counted are requested in a single script at one time, and manual data summarizing operation is not needed.
Based on the content of the above embodiments, as an alternative embodiment: before the first data request initiating module, the method further comprises:
the initialization module is used for initializing the number of times of requests for debugging the external interface;
and the first request success time node obtaining module is used for carrying out initial calling on the external interface, counting the time from the initiation of the data request to the receipt of the correct return result and obtaining the first request success time node.
Based on the content of the above embodiments, as an alternative embodiment: the sending and recording module also comprises:
if the third data request is successfully sent, the third data request is set in a value which is at least twice of the third request time interval, so that the number of sent requests is smaller than or equal to the number of requests between the first request successful time node and the last request successful time node.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device includes: a processor 501, a memory 502, and a bus 503;
the processor 501 and the memory 502 respectively complete communication with each other through a bus 503; the processor 501 is configured to call the program instructions in the memory 502 to execute the processing method for calling the external interface error with high frequency provided by the above embodiments, for example, including: initiating a first data request according to a set first request time interval; if the first data request fails, recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node; increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval; if the second data request fails, taking the total request interval duration between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request; if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the time consumed by each request until the request is successful after the fourth data request is sent to obtain the total time of the current request interval; and setting the request frequency within the total duration of the current request interval to be less than or equal to the request frequency between the first request success time node and the last request success time node, and finishing the processing of the error of the high-frequency calling external interface.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements steps of a method for handling an error of an external interface with high frequency. Examples include: initiating a first data request according to a set first request time interval; if the first data request fails, recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node; increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval; if the second data request fails, taking the total request interval duration between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request; if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the time consumed by each request until the request is successful after the fourth data request is sent to obtain the total time of the current request interval; and setting the request frequency within the total duration of the current request interval to be less than or equal to the request frequency between the first request success time node and the last request success time node, and finishing the processing of the error of the high-frequency calling external interface.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, the principle and the implementation of the present invention are explained by applying the specific embodiments in the present invention, and the above description of the embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for handling an error of an external interface called with high frequency, the method comprising:
initiating a first data request according to a set first request time interval;
if the first data request fails, recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node;
increasing the value of the first request time interval, and initiating a second data request by taking the request time interval after the value is currently increased as a second request time interval;
if the second data request fails, taking the total request interval duration between the first request successful time node and the last request successful time node as a third request time interval, and initiating a third data request;
if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording the consumed time of each request until the request is successful after the fourth data request is sent, so as to obtain the total time of the current request interval;
and setting the request frequency within the total duration of the current request interval to be less than or equal to the request frequency between the first request success time node and the last request success time node, and finishing the processing of the error of the high-frequency calling external interface.
2. The method of claim 1, wherein the initiating the first data request according to the set first request time interval further comprises:
initializing the number of times of requests for debugging the external interface;
and carrying out initial calling on the external interface, and counting the time from the initiation of the data request to the receipt of a correct returned result to obtain a time node for the success of the first request.
3. The method of claim 1, wherein if the third data request fails, increasing the value of the third request time interval to obtain a fourth data request, sending the fourth data request, and recording consumed time of each request until the request is successful after the fourth data request is sent, and before obtaining the total time of the current request interval, the method further comprises:
and if the third data request is successfully sent, setting the data request within a value which is at least twice of the third request time interval, so that the number of sent requests is less than or equal to the number of requests between the first request successful time node and the last request successful time node.
4. The method according to claim 1, wherein if the second data request fails, taking a total duration of the request interval between the first request success time node and the last request success time node as a third request time interval, before initiating the third data request, further comprising:
and if the second data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the second request time interval as a final time interval.
5. The method of claim 1, wherein if the first data request fails, before recording the number of requests between the first request success time node and the last request success time node and the total duration of the request interval between the first request success time node and the last request success time node, further comprising:
and if the first data request is successful, finishing the processing of the error of the high-frequency calling external interface by taking the first request time interval as a final time interval.
6. The method of claim 1, wherein the increasing of the value comprises: a linear increase in the value or an exponential increase in the value.
7. A device for handling an error in invoking an external interface at a high frequency, the device comprising:
a first data request initiating module, configured to initiate a first data request according to a set first request time interval;
the recording module is used for recording the request times between a first request success time node and a last request success time node and the total request interval duration between the first request success time node and the last request success time node if the first data request fails;
a second data request initiating module, configured to increase the value of the first request time interval, and initiate a second data request with the request time interval after the current value is increased as a second request time interval;
a third data request initiating module, configured to initiate a third data request by using a total request interval duration between the first request success time node and the last request success time node as a third request time interval if the second data request fails;
the sending and recording module is used for increasing the value of the third request time interval to obtain a fourth data request if the third data request fails, sending the fourth data request and recording the consumed time length of each request until the request is successful after the fourth data request is sent, so as to obtain the total time length of the current request interval;
and the request sending frequency setting module is used for setting the number of times of requests sent in the total duration of the current request interval, so that the number of times of requests sent is smaller than or equal to the number of times of requests between the first request success time node and the last request success time node, and the processing of errors of the high-frequency calling external interface is completed.
8. The apparatus of claim 7, wherein the first data request initiating module further comprises:
the initialization module is used for initializing the number of times of requests for debugging the external interface;
and the first request success time node obtaining module is used for carrying out initial calling on the external interface, counting the time from the initiation of the data request to the receipt of the correct return result and obtaining the first request success time node.
9. The apparatus of claim 7, wherein the sending and recording module further comprises, prior to:
and if the third data request is successfully sent, setting the data request within a value which is at least twice of the third request time interval, so that the number of sent requests is less than or equal to the number of requests between the first request successful time node and the last request successful time node.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for handling an error of an external interface according to any one of claims 1 to 6 when executing the program.
CN201910869067.1A 2019-09-12 2019-09-12 Method and device for processing error of high-frequency calling external interface Pending CN110716972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910869067.1A CN110716972A (en) 2019-09-12 2019-09-12 Method and device for processing error of high-frequency calling external interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910869067.1A CN110716972A (en) 2019-09-12 2019-09-12 Method and device for processing error of high-frequency calling external interface

Publications (1)

Publication Number Publication Date
CN110716972A true CN110716972A (en) 2020-01-21

Family

ID=69210504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910869067.1A Pending CN110716972A (en) 2019-09-12 2019-09-12 Method and device for processing error of high-frequency calling external interface

Country Status (1)

Country Link
CN (1) CN110716972A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115936637A (en) * 2023-03-10 2023-04-07 云账户技术(天津)有限公司 Electronic receipt pulling method, system, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739681A (en) * 2012-06-29 2012-10-17 奇智软件(北京)有限公司 Method and device for login control to log in server
CN106487883A (en) * 2016-09-28 2017-03-08 乐视控股(北京)有限公司 Network registration process method and module
CN107491455A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 Read method and device in a kind of distributed system
CN108076085A (en) * 2016-11-10 2018-05-25 北京国双科技有限公司 The method and data transmission device of a kind of data transmission
CN108271277A (en) * 2017-12-29 2018-07-10 深圳真时科技有限公司 A kind of communication connecting method and device
CN109118344A (en) * 2018-07-06 2019-01-01 阿里巴巴集团控股有限公司 A kind of business retries method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739681A (en) * 2012-06-29 2012-10-17 奇智软件(北京)有限公司 Method and device for login control to log in server
CN107491455A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 Read method and device in a kind of distributed system
CN106487883A (en) * 2016-09-28 2017-03-08 乐视控股(北京)有限公司 Network registration process method and module
CN108076085A (en) * 2016-11-10 2018-05-25 北京国双科技有限公司 The method and data transmission device of a kind of data transmission
CN108271277A (en) * 2017-12-29 2018-07-10 深圳真时科技有限公司 A kind of communication connecting method and device
CN109118344A (en) * 2018-07-06 2019-01-01 阿里巴巴集团控股有限公司 A kind of business retries method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115936637A (en) * 2023-03-10 2023-04-07 云账户技术(天津)有限公司 Electronic receipt pulling method, system, electronic equipment and readable storage medium
CN115936637B (en) * 2023-03-10 2023-05-02 云账户技术(天津)有限公司 Electronic receipt pull method, system, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN112650576B (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN108804215B (en) Task processing method and device and electronic equipment
CN110737548B (en) Data request method and server
CN111400041A (en) Server configuration file management method and device and computer readable storage medium
CN113687858A (en) Configuration file checking method and device, electronic equipment and storage medium
CN110413398B (en) Task scheduling method and device, computer equipment and storage medium
CN109656791B (en) gPC performance test method and device based on Jmeter
CN110070444A (en) A kind of block chain transaction flow management method and relevant apparatus
CN110716972A (en) Method and device for processing error of high-frequency calling external interface
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN111427582A (en) Management method, device and equipment of RT L code and computer readable storage medium
CN114090268B (en) Container management method and container management system
CN111884932B (en) Link determining method, device, equipment and computer readable storage medium
CN110708345A (en) Cloud disk upgrading method, cloud disk scheduling method, cloud host scheduling device and cloud disk scheduling system
CN114217843A (en) Operation and maintenance method and device of system and server
CN109542598B (en) Timed task management method and device
CN112766768B (en) Contract flow management method and device, electronic equipment and readable storage medium
CN116643733B (en) Service processing system and method
CN110149356A (en) Method and device is uniformly processed in a kind of network request abnormality
US11941432B2 (en) Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program
CN114900383B (en) Interface processing method, device, electronic equipment and computer readable storage medium
CN114356610A (en) Control method, device and equipment for interface calling and storage medium
CN115827050A (en) Data calling method and device, electronic equipment and storage medium
CN115686911A (en) Server-side self-checking method and device, electronic equipment and storage medium
CN118227584A (en) Heterogeneous data migration method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200121